29

Whenever I switch on Ubuntu I always see the following message.

(Initramfs): /dev/sda1 contains a file system with errors, check forced.
  Inodes that were a part of a corrupted orphan linked lost found.
  /dev/sda1 : UNEXPECTED INCONSISTENCY; RUN fsck manually.(I.e .,
  without -a or -p options). fsck exited with status code 4. The root
  filesystem on /dev/sda1 requires a manual fsck
  • This shouldn't occur repeatedly. What do you to shut down Ubuntu? – David Foerster Feb 19 '17 at 17:44
  • Do you dual-boot with Windows? If so, do you have a driver installed in Windows that allows it to read/view Ubuntu EXT4 files/partitions? Please start comments directed at me with @heynnema or I may miss them. – heynnema Feb 19 '17 at 18:20
  • No i did not dual-boot windows @heynnema – Abhishek Barman Feb 19 '17 at 18:26
  • I don't know but the message occurs repeatedly whenever I shutdown and then restart it again. @David Foerster – Abhishek Barman Feb 19 '17 at 18:29
  • @AbhishekBarman: Again, how exactly do you shut down Ubuntu? – David Foerster Feb 19 '17 at 20:01
31

Lets first check your file system for errors.

For 17.10 or older...

  • boot to the GRUB menu
  • choose Advanced Options
  • choose Recovery mode
  • choose Root access
  • at the # prompt, type sudo fsck -f /
  • repeat the fsck command if there were errors
  • type reboot

For 18.04 or newer... (or if the above steps don't work for you)...

  • boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode
  • open a terminal window by pressing Ctrl+Alt+T
  • type sudo fdisk -l
  • identify the /dev/sdXX device name for your "Linux Filesystem"
  • type sudo fsck -f /dev/sdXX, replacing sdXX with the number you found earlier
  • repeat the fsck command if there were errors
  • type reboot
| improve this answer | |
  • 23
    Why not just do the fsck -fy /dev/sda1 directly on the prompt ? – Soren A Feb 19 '17 at 20:07
  • 2
    At the prompt he gets just after the message. I have never seen this message without a following 'minimal grub' prompt. – Soren A Feb 19 '17 at 20:14
  • 3
    Belive me, it works !! – Soren A Feb 19 '17 at 20:33
  • 1
    At the prompt he gets below the error message .. whatever it is. – Soren A Feb 19 '17 at 20:46
  • 3
    ... At the (initramfs) prompt I was able to run fsck directly (no need for sudo). The system fixed a whole bunch of filesystem errors, and I was able to restart Ubuntu normally. Your answer was almost correct. – mathguy Mar 30 '18 at 17:41
29

From there, you should be able to drop to some maintenance shell (if not already opened), where you may run fsck -yf /dev/sda1.

If there are any errors rerun fsck -yf /dev/sda1

To login as usual simply run exit and proceed normally.

| improve this answer | |
  • 1
    Here y in -yf is for yes wherever the system asks for y/n choice – Rahul Gaur Jan 20 at 4:45
  • I'm very grateful to mathguy for his comment, because remotely supporting someone who is using Linux for development but isn't intimately familiar with grub or working in the CLI makes complicated boot sequences almost impossible, but your comment and his mention that it should work at initramfs was invaluable. askubuntu.com/questions/885062/… – dragon788 Jul 6 at 15:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.