Calling live-snapshot now produces an output file.
[live-boot-grml.git] / bin / live-snapshot
index 141d266..c50bcc0 100755 (executable)
@@ -302,7 +302,7 @@ Do_snapshot ()
                ext2|ext3)
                        DU_DIM="$(du -ks ${SNAP_COW} | cut -f1)"
                        REAL_DIM="$(expr ${DU_DIM} + ${DU_DIM} / 20)" # Just 5% more to be sure, need something more sophistcated here...
-                       genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root="${SNAP_COW}" "${DEST}"
+                       genext2fs --size-in-blocks=${REAL_DIM} --reserved-percentage=0 --root="${SNAP_COW}" "${DEST}"
                        ;;
 
                jffs2)
@@ -313,8 +313,13 @@ Do_snapshot ()
 
 Clean ()
 {
-       umount "${MOUNTP}"
-       rmdir "${MOUNTP}"
+       if echo "${DEST}" | grep -q "${MOUNTP}"
+       then
+               echo "${DEST} is present on ${MOUNTP}, therefore no automatic unmounting the latter." > /dev/null 1>&2
+       else
+               umount "${MOUNTP}"
+               rmdir "${MOUNTP}"
+       fi
 }
 
 Main ()