diff -r b917ead1b6ef -r a2875a6fd7b2 snapfsck.sh --- a/snapfsck.sh Fri May 04 15:37:10 2012 +0200 +++ b/snapfsck.sh Tue May 08 11:36:14 2012 +0200 @@ -39,7 +39,7 @@ # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549691#74 # https://bugzilla.redhat.com/show_bug.cgi?id=577798#c5 # https://www.redhat.com/archives/linux-lvm/2010-August/msg00029.html - lvs "$vg/$lvs" >/dev/null 2>&1 && lvremove -f "$vg/$lvs" + lvs "$vg/$lvs" && lvremove -f "$vg/$lvs" } @@ -67,7 +67,11 @@ d=$(date +%Y%m%d%H%M%S) lvcreate -n"$lvs" -L"$SNAPSIZE" -s "$vg/$lv" -if e2fsck -fp "/dev/$vg/$lvs"; then +# fix any noncritical problems automatically and don't make any noise (on +# stderr) about it; note that these problems remain present on the origin +# volume +e2fsck -fp "/dev/$vg/$lvs" 2>&1 || true +if e2fsck -fy "/dev/$vg/$lvs" 2>&1; then tune2fs -C 1 -T "$d" "/dev/$vg/$lv" else die fsck returned nonzero: this may indicate filesystem corruption on the origin volume.