Recently I’ve faced a problem with some server where /usr filesystem ot an error and was switched to read-only. Otherwise server was fine and I wanted to force fsck just on this filesystem, avoiding the rest ( 500gb /home filesystem would keep server down for a loong time which is completely opposite of my goal)
I tried to reboot the server – none of filesystems was checked. And I still had read-only /usr.
1 2 3 4 5 6 |
dmesg | grep EXT EXT3-fs error (device md4): ext3_lookup: unlinked inode 97697 in dir #97696 Aborting journal on device md4. ext3_abort called. EXT3-fs error (device md4): ext3_journal_start_sb: Detected aborted journal Remounting filesystem read-only |
Now, fsck force on reboot if number of mounts equial or greater then max mount count on mentioned filesystem.
Lets check these numbers
1 2 3 4 5 |
# dumpe2fs -h /dev/md4 | grep 'ount count' dumpe2fs 1.39 (29-May-2006) Mount count: 8 Maximum mount count: -1 |
This is the reason why – by setting maximum mount count to -1 automatic fsck on reboot was completely disabled. To fix this situation I needed to change Maximum mount count so that on next reboot fsck will run on this filesystem.
1 2 3 4 |
# tune2fs -c8 /dev/md4 tune2fs 1.39 (29-May-2006) Setting maximal mount count to 8 |
After next reboot just this filesystem would be checked with fsck, after you can set maximum mount count to some reasonable number – fore example default is to run fsck on each 32nd mount.
0 Comments.