SDB:Fsck: Unexpected Inconsistency
Symptom:
At boot time appears the following error message or similar:
checking file system..... Parallelizing fsack version 1.10 (24-Apr-97) /dev/sda5 contains a file systems with errors, check forced. /dev/sda5: Inode 8056 has illegal block(s)
/dev/sda5: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY (i.e., without -a or -p options) Loading /etc/default.keytab
fsck failed. Please repair manually and reboot. The root file system is currently mounted read-only. To remount it read-write do:
bash# mount -n -o remount,rw /
Attention: Only CONTROLL-D will reboot the system in this maintance mode. Schutdown or reboot will not work.
Cause:
This message informs that your filesystem has (eventually serious) defects. Attention: it is not advisable to keep on working with such a filesystem without fixing it ! Possible explanations to this defects are, for instance:
- The computer has been disconnected without a previous shutdown. Provided that commonly Unix and specially Linux perform permanent filesystem buffering (in memory) in order to make the system faster, and the filesystem updates on the hard disk take place usually every 30 seconds, by disconnecting the machine, it may lead to damages in the filesystem (in the sense of mixup of structures, not of a physical defect on your harddisk). By the way, a filesystem update can be forced with the command
sync
. - You have a problem with your hardware (damaged disk, controller, ...). This is often caused by a bad or weak connection between the data cable and the motherboard or the hard disk. This happens easily after installing or removing hardware. The problem could also occur due to faulty hardware.
Solution:
If there's another operative system in the same disk together with Linux, it can be tested if the harddisk operates normally under the other system. When this doesn't occur, the cause lies probably on a hardware problem.
Check the right placement of the data cable on the mainboard and on the hard disk. Remove the cable and plug it again on the board and on the disk. Because of corrosion could be the conductivity of the wrap connection affected. This can be repaired as follows.
Are you sure that your hardware is all right and that all data cables are properly plugged into the computer, then you can try to fix the filesystem with e2fsck
(Here we are taking the ext-2-Filesystem. It is the standard one.) e2fsck
is able to seek your disk for bad sectors, and to mark them so that they will never we written again.
Attention: You have to be aware, that e2fsck
can't cause any wonder. In some cases (specially if there are hardware problems or severe damaged filesystems) the use of e2fsck
may lead to an aggravation of your problem.
Do always before manually executing e2fsck
a backup of all important files !!!
The user handbook contains the complete manual-page of e2fsck
. Please read it, and execute the program from the rescue system (boot from CD or from SuSE installation disk and start the rescue system. Don't mount the concerned disk, see manual).
The command to repair the filesystem is (here we will take: /dev/sda5
as the damaged one):
e2fsck -f -c -y /dev/sda5
The meaning of the options es:
-
-f
: Checks even if it seems that the filesystem is looking good. -
-c
: Looks for "Badblocks". These will be marked and they will never be written again. -
-y
: Takes "yes" as answer to all questions. This way you can handle hundreds of mistakes without having to answer what to do in every single one of them. If you don't want to use this option, just leave it away.
If the new try with e2fsck
fails (the first try is already failed while booting), then only remains in the most cases formatting and installing again this partition.
<keyword>fsck,booten,filesystem,inconsistency,e2fsck</keyword>