Other fsck.ext4 during boot up

My /etc/fstab includes an ext4 partition which I like to mount on startup. On occasions it is not in a clean state when booting and I manually need to run fsck.ext4 to continue booting.

Is there any way to automatically invoke fsck.ext4?
 
Yes, last number on the line is a "pass". This indicates in what order the filesystem check should happen. You normally want to 'stagger' this a bit so you're not running the filesystem check on every filesystem at the same time (and choking your I/O in the process). A pass of 0 means that a filesystem check is never done.

Code:
     The sixth field, (fs_passno), is used by the fsck(8) and quotacheck(8)
     programs to determine the order in which file system and quota checks are
     done at reboot time.  The fs_passno field can be any value between 0 and
     ‘INT_MAX-1’.

     The root file system should be specified with a fs_passno of 1, and other
     file systems should have a fs_passno of 2 or greater.  A file system with
     a fs_passno value of 1 is always checked sequentially and be completed
     before another file system is processed, and it will be processed before
     all file systems with a larger fs_passno.

     For any given value of fs_passno, file systems within a drive will be
     checked sequentially, but file systems on different drives will be
     checked at the same time to utilize parallelism available in the
     hardware.  Once all file system checks are complete for the current
     fs_passno, the same process will start over for the next fs_passno.

     If the sixth field is not present or is zero, a value of zero is returned
     and fsck(8) and quotacheck(8) will assume that the file system does not
     need to be checked.
fstab(5)
 
Yes, last number on the line is a "pass". This indicates in what order the filesystem check should happen. You normally want to 'stagger' this a bit so you're not running the filesystem check on every filesystem at the same time (and choking your I/O in the process). A pass of 0 means that a filesystem check is never done.
How is this 'staggering' achieved?
 
Back
Top