[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How often should I fsck my ext3 partition?



On Wed, 05 Apr 2006, Mike McCarty wrote:

> Ali Milis wrote:
> >Johannes Wiedersich wrote:
> >
> >>The debian default of my sarge installations is that the ext3-FS are
> >>fsck'ed about every 30 mounts or 180 days (whatever comes first).
> >
> >This is just my  Euro 0.01 opinion:
> >
> >180 days is reasonable for new disks.
> >Perhaps you would like to lower it when your disk goes old.
[ . . . ]
> 
> A related question is how to do it without taking the machine down
> uncleanly or fiddling an arcane file somewhere. I've thought about
> perhaps doing...
> 
> $ mount -o remount -o ro /dev/hda5
> $ fsck /dev/hda5
> $ mount -o remount -o rw /dev/hda5
> 
> (I have /dev/hda5 mounted as / on my machine.) Is there any
> exposure in this? I'm pretty leery of running fsck on a
> r/w file system.

Running fsck on a r/w file system is a Bad Plan(TM).  (I don't think fsck
will even do it without a force flag.)

One convenient option is to use the clock-time based check interval for
ext2/3.  For example,
  tune2fs -i 60d -c 0
will force a fsck on the first reboot every 60 days (and disable the 'every
n mount-counts' interval).

Regarding Johannes' question about filesystem errors getting rsynced to
backups.  Yes, that is very possible (had it happen to me once).  You can
greatly reduce the likelihood by using rsync's '--checksum' option, at the
cost of a (much) longer backup time...

-- Brad



Reply to: