FSCK as needed

Nicholas Leippe nick at leippe.com
Thu Jul 16 14:54:00 MDT 2009


On Thu Jul 16 2009 14:39:08 Charles Curley wrote:
> I do regular offsite backups via two external hard drives which I
> alternate weekly. I use a script to mount them.
>
> I'd like to add a provision to fsck the file systems but only if they
> need it, either by time since the last fsck, or by count. Is there a
> simple way to do that?
>
> Thanks

Yes, it's builtin to ext2/ext3. There exists two tuneable parameters (use 
tune2fs):

max-mount-counts        # -c option
interval-between-checks # -i option

These are examined whenever it gets mounted. I don't know what the defaults 
are, I've seen them displayed when tripped in the past though.

I think there isn't such a mechanism for reiserfs v3. I don't know about 
others such as xfs.

The other parameter to be aware of is the sixth field (fs_passno) in the fstab 
line (if you're using an fstab entry). If it's set to 0 or not present, fsck 
will not do any checks when mounting at boot--though this probably does not 
affect your setup since you're dealing with removeable devices.






More information about the PLUG mailing list