Explain why helper uses -f (force) in resize2fs
authorNikos Skalkotos <skalkoto@grnet.gr>
Thu, 15 Dec 2011 16:40:05 +0000 (18:40 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Thu, 15 Dec 2011 16:40:05 +0000 (18:40 +0200)
snf-image-helper/tasks/20FilesystemResizeUnmounted.in

index b611815..fb460b9 100644 (file)
@@ -44,6 +44,10 @@ if [[ "$ptype" == ext[234] ]]; then
     state=$($TUNE2FS -l "$device" | grep ^Filesystem\ state: | cut -d: -f2);
     state=$(echo $state) #trim the value
 
+    # We force a filesystem resize here if the file system is clean, even if
+    # resize2fs complains. By default resize2fs will refuse to resize a file
+    # system that has been mounted after the last fs check, but since we are
+    # sure the file system is clean it's safe enough to bypass this.
     if [ "$state" = "clean" ]; then
         $RESIZE2FS -f "$device"
     else