379

I dual boot Ubuntu and Windows 7.
I was browsing on FireFox in Ubuntu and all of a sudden I get some error message, so I rebooted.

Now when I try to boot into Ubuntu I get this message:

fsck from util-linux 2.26.2
/dev/sda6 contains a file system with errors, check forced.
/dev/sda6: Inodes that were part of a corrupted orphan linked list found.

/dev/sda6: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
fsck exited with status code 4
The root filesystem on /dev/sda6 requires a manual fsck

Busybox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) _

How can I fix this?

2
  • 2
    Have you been able to find out the root cause? I experienced exactly the same issue two times within two days using Kubuntu 16.04. Is this some software problem or an indication for defective hardware? Aug 14, 2016 at 10:19
  • 3
    @Silicomancer, I had this, and other related issues, and it seems quite likely to be related to a failing hard drive. I know my hard drive failed some of the S.M.A.R.T diagnostics right around when this problem occurred. Sometimes a manual 'fsck /dev/sdaX' would fix it, but other times the problem wouldn't be resolved and I'd get a kernel panic on the next boot. I've got a new HD in the mail.
    – gammapoint
    Apr 14, 2017 at 21:05

7 Answers 7

518

Try this:

fsck /dev/sda6

(where /dev/sda6 is the partition mentioned)

And enter Yes (y) to for each error. Or press a one time for always-yes.

Then reboot and it should be fine.

23
  • 17
    Ok, so run fsck -a /dev/sda6 and enter Yes to all errors. Nov 12, 2015 at 14:13
  • 4
    Reboot linux, and if all looks good from the booting, then you should go to the apt-get again. If puts you again to busybox terminal, run fsck -a /dev/sda6 and repair the errors. Nov 12, 2015 at 14:21
  • 30
    do not forget to add -y at the end, or else glue your finger pressed to y
    – aditya
    May 21, 2017 at 12:00
  • 15
    @aditya: You could also press 'a' for always instead of 'y' without using -y
    – Arigion
    Aug 12, 2017 at 10:17
  • 4
    @Rishabh Agrahari, I think maybe the disk. You should test it with smartd tools. Sep 11, 2018 at 6:31
110

I have noticed that even if you do a fsck on the disk the problem may occur again in a few days.

I have found that the problem is worse on SSD disks than the regular HDD disks. I have found some steps that may fix the problem temporarily.

fsck -fy /dev/sda1 

if sda1 is the right partition - the prompt will tell you exactly which one requires fsck.

After that if the systems boots up you may have another problem with the package management system, so if you open a terminal and type sudo apt-get update you may get an error. Do not worry. Run these commands:

sudo apt-get update
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

My opinion is that there is serious problem in Ubuntu with regard to SSD disks. The community should fix it.

I have found a possible cause of this problem: Probably the system did not shutdown normally.

5
  • 1
    After the fsck command type he command exit to force the system to boot again in runlevel 5 or just reboot with init 6.! Your choice.! Sep 8, 2016 at 9:47
  • 7
    Please edit your own posts if you want to add or clarify something. Sep 8, 2016 at 10:28
  • I was facing such problem for at least ~10 times for now and actually now I recall that before that I was always installing something. But not every installation followed by such problem.
    – Slaus
    Aug 7, 2017 at 16:33
  • 1
    Running fsck directly didn't work with me. I had to reboot, then choose from the boot menu to run Ubuntu in Safe Mode, and then running fsck worked. Mar 10, 2020 at 2:34
  • I'm still having these issues occasionally often when I leave ubuntu on overnight - my gut says SSD is worse as well and I've seen a post mentioning some task the OS does for SSD occasionally. Wondering what the solution is...
    – karns
    Sep 16, 2020 at 18:42
16

UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY means there is some file system error in the disk. Run the fsck command manually. After that it will ask some more questions - just answer y and press enter and finally reboot the server.

enter image description here

14

Type exit into the prompt, and it should tell you which partition has an error, e.g. /dev/sda6. Type fsck /dev/sdaX -y where X is the partition mentioned in the error. The -y flag answers yes to all the prompts it would otherwise have given you - you don't have to use it but it is recommended. Once it has finished, type reboot into the prompt, and if prompted, select to continue normal startup.

3
  • this worked. Thanks
    – Amal
    Jul 11, 2021 at 8:14
  • Great! You are a big help man! Sep 3, 2021 at 0:45
  • Perfect answer! May 15, 2022 at 18:53
2
fsck -y /dev/sda

eg:

fsck -y /dev/sda1
fsck -y /dev/sda2
1

In (initramfs) prompt, type the command "fsck" then the path to your hard drive, for example "fsck /deb/sda2" , after add "-y" in order to accept all the fixing errors, for example "fsck /dev/sda2 -y", then the computer will check the errors on the filesystem to repair them.

2
  • 1
    The minus y is a very bad idea you wont be able to see what it is fixing and maybe have a clue as to what was or is wrong.
    – David
    Feb 9, 2022 at 5:59
  • 1
    Indeed might be a bad idea to use the -y. In the worst case, it will tell you that you can use a to accept all following prompts.
    – marcelocra
    Apr 8, 2022 at 22:21
1

If you don't already have a recent backup of the partition, you may wanna run a backup first to before doing anything else. Repairing the disk should be safe in most cases, but may be better to have a backup in case things go awry. You will need to mount your backup drive to write to a backup compressed image file for example. Make sure you know which dev/sdX is which!

sudo mkdir -p /media/username/mydrive
sudo mount /dev/sdb1 /media/user/mydrive
# if= <----- your source to backup goes here!
sudo dd if=/dev/sda1 conv=sync,noerror bs=64KB | gzip -c > /media/user/mydrive/system-backup.img.gz

Now that you have safely created a backup image, you can safely try to fix disk errors

sudo fsck /dev/sda1 # enter y at prompts or a for all

Reboot should get you working again. Now make a good habit of regular backups.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .