[CentOS] How to stagger fsck executions

Tue Apr 21 16:14:19 UTC 2015
Hugh E Cruickshank <hugh at forsoft.com>

From: Hugh E Cruickshank Sent: April 20, 2015 21:09
> 
> Over the weekend I had to reboot one of my systems and got hit with
> fsck runs on all of the filesystems. I would not mind so much except
> doing them all at once took over an hour. I would like to be able to
> stagger these, ideally only execute one fsck per reboot. I have been
> able to think of two possible solutions but neither is terrific.

I have come up with a third idea that would seem to address what I am
looking for...

1. Create a file with the list of filesystems in desired order of
   execution.

2. Create an init.d script that:

   a. Sets tune2fs -c 0 on all filesystems.
   b. Extracts the first filesystem from the file,
   c. Sets tune2fs -c 1 on it, and
   d. moves it to the end of the file.

The result is that on each reboot (after the first) only one filesystem
will be checked on each boot. The down side is that an fsck will be run
on every reboot however this could be mitigated by adding a boot count
that would be maintained and checked in the file.

It would appear that I have the beginnings of a workable solution.

Thanks for everyone's suggestions.

Regards, Hugh

-- 
Hugh E Cruickshank, Forward Software, www.forward-software.com