do not run fsck when deploying virtual machine
authorMichael Prokop <mika@grml.org>
Thu, 13 Oct 2011 16:33:31 +0000 (18:33 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 13 Oct 2011 16:49:26 +0000 (18:49 +0200)
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.

grml-debootstrap

index feb7aa1..3f14f75 100755 (executable)
@@ -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
 }
 # }}}