You can run fsck manually in Linux to fix the error “unexpected inconsistency; run fsck manually fsck exited with status code 4”. Let us learn how:
How to run fsck manually in Linux
sudo umount /dev/sdb
sudo fsck /dev/sdb
NOTE: Replace the “/dev/sdb” with the partition showing error or replace /dev/sdb with the device you want to unmount.
You can also run “sudo fsck -py /dev/sdb” where:
- -p will automatically apply repairs
- -y will apply corrections to detected filesystem errors
If you do not specify a filesystem with the command, it will analyze the fstab file (/etc/fstab).
If you wish to run fsck on all filesystems at once, run the command “fsck -AR”.
Note:
- Run the fsck command as root user
- Unmount the device before running fsck
Remember to unmount the device/disk befor you execute fsck command as it may damage your files. Whenever you try running fsck on a mounted device, you should see an error like this: fsck from util-linux 2.34 e2fsck 1.45.5 (28-aug-2023) /dev/sda3 is mounted. e2fsck: Cannot continue, aborting.
Upon successful execution of the command, you will see the total number of fies and clusters on the device/partition “/dev/sda3: 5 files, 1967/1972 clusters”
unexpected inconsistency; run fsck manually fsck exited with status code 4
If you are getting an error “unexpected inconsistency; run fsck manually”, you will have to follow the steps given below:
- Type exit into the prompt – it will 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.
- Once it has finished, type reboot into the prompt, and if prompted, select to continue normal startup.
NOTE: If you are getting an error “/dev/sda3 is mounted.”, follow the steps given above to umount and the run fsck command manually.
Once you get back to the normal startup, open terminal and run the following commands: sudo apt-get update sudo apt-get clean sudo apt-get update sudo apt-get upgrade
That’s all, reboot the system again.