don't work around problems in the 'udisks' package
authorMatthias Förste <foerste@schlittermann.de>
Fri, 04 May 2012 12:08:34 +0200
changeset 5 fdaedf474996
parent 4 0565633d7bfa
child 6 12744a06a554
don't work around problems in the 'udisks' package
snapfsck.bash
--- a/snapfsck.bash	Thu May 03 21:37:39 2012 +0200
+++ b/snapfsck.bash	Fri May 04 12:08:34 2012 +0200
@@ -54,22 +54,15 @@
 lvcreate -n"$lvs" -L"$SNAPSIZE" -s "$vg/$lv" || die
 if e2fsck -fp "/dev/$vg/$lvs"; then
     tune2fs -C 1 -T "$d" "/dev/$vg/$lv" || die
-    # removing /dev/$vg/snap.$lv or just $vg/snap.$lv does not work reliably
-    # removing /dev/mapper/$vg-snap.$lv does not work reliably either nor does
-    # the workaround suggested at
-    # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549691#57
     waittime=1 # second
     tries=60
     i=1
-    until lvremove -f "$vg/$lvs"; do
-        if [ $i -lt $tries ]; then
-            warn retrying snapshot removal
-            sleep $waittime
-            i=$((i+1))
-        else
-            die giving up snapshot removal
-        fi
-    done
+    # if you have problems removing volumes then you may have the 'udisks'
+    # package installed; see:
+    # 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
+    lvremove -f "$vg/$lvs" || die
 else
     die fsck returned nonzero: this may indicate filesystem corruption on the origin volume. The snapshot has not been removed.
 fi