From: Michael Prokop Date: Thu, 13 Oct 2011 16:33:31 +0000 (+0200) Subject: do not run fsck when deploying virtual machine X-Git-Tag: v0.48~11 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=8fe289cf5be90207efd638da0ba1b6f48c0e78e5 do not run fsck when deploying virtual machine When running filesystem check on the loopback device of the virtual machine we get something like: | fsck.ext3: No such file or directory while trying to open /dev/mapper/loop1p1 since the loopback device has been removed already. Since fsck shouldn't be necessary at all let's just skip it when building VMs. --- diff --git a/grml-debootstrap b/grml-debootstrap index feb7aa1..3f14f75 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -1168,12 +1168,17 @@ umount_chroot() { # execute filesystem check {{{ fscktool() { - if [ "$FSCK" = 'yes' ] ; then - [ -n "$FSCKTOOL" ] || FSCKTOOL="fsck.${MKFS#mkfs.}" - einfo "Checking filesystem on $TARGET using $FSCKTOOL" - $FSCKTOOL $TARGET - eend $? - fi + if [ -n "$VIRTUAL" ] ; then + einfo "Skipping filesystem check since we deploy a virtual machine." + return 0 + fi + + if [ "$FSCK" = 'yes' ] ; then + [ -n "$FSCKTOOL" ] || FSCKTOOL="fsck.${MKFS#mkfs.}" + einfo "Checking filesystem on $TARGET using $FSCKTOOL" + $FSCKTOOL $TARGET + eend $? + fi } # }}}