<div class="gmail_quote">On Tue, Sep 13, 2011 at 8:39 PM, Matt Garman <span dir="ltr"><<a href="mailto:matthew.garman@gmail.com">matthew.garman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
My question is more along the lines of "best<br>
practices"---what are most people doing with regards to regular fsck's<br>
of ext2/3/4 filesystems?  Do you just take the defaults, and let it<br>
delay the boot process by however long it takes?  Disable it<br>
completely?  Or do something like taking the filesystem offline on a<br>
running system?  Something else?<br></blockquote></div><br>If you are running on LVM and have (enough) free space available then there is a very easy way to check the filesystem for errors.  If this finds errors then you can run it on the real filesystem when you can schedule downtime to fix them.  It also will give you a good estimate about the amount of time you will need to schedule.<br>
<br>- Create an LVM snapshot of the volume you want to check<br>- Preen the filesystem to fix and minor in-progress stuff the snapshot caused<br>- Force a full filesystem check and watch for any errors<br><br>lvcreate -s -L 50G -n fsck_snapshot vg_name/lv_name<br>
e2fsck -p -C0 /dev/vg_name/fsck_snapshot<br>e2fsck -fy -C0 /dev/vg_name/fsck_snapshot<br>lvremove -f vg_name/fsck_snapshot<br><br>Make sure the 50G above gives you enough room for all the writes that will take place during the fsck operation.<br>
<br>-Shad<br>