Sysadmin: How to force fsck on reboot on single filesystem on Linux

fsck
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.

Now, fsck force on reboot if number of mounts equial or greater then max mount count on mentioned filesystem.
Lets check these numbers

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.

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.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">