Disable fsyncs in helper's VM resize operation
authorNikos Skalkotos <skalkoto@grnet.gr>
Fri, 28 Sep 2012 13:46:41 +0000 (16:46 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Fri, 28 Sep 2012 13:46:41 +0000 (16:46 +0300)
You can disable this behaviour by defining the DO_SYNC image property.

snf-image-helper/common.sh
snf-image-helper/tasks/20FilesystemResizeUnmounted.in
snf-image-host/multistrap.conf

index 5e2e27b..c2f2efc 100644 (file)
@@ -36,6 +36,7 @@ BLOCKDEV=blockdev
 REGLOOKUP=reglookup
 CHNTPW=chntpw
 DATE="date -u" # Time in UTC
+EATMYDATA=eatmydata
 
 CLEANUP=( )
 ERRORS=( )
index ebd90fb..71cc284 100644 (file)
@@ -41,6 +41,10 @@ if [ -z "$SNF_IMAGE_RESIZE_PART" ]; then
     exit 0
 fi
 
+if [ -n "$SNF_IMAGE_PROPERTY_DO_SYNC" ]; then
+    unset EATMYDATA
+fi
+
 table=$(get_partition_table "$SNF_IMAGE_DEV")
 partition=$(get_partition_by_num "$table" "$SNF_IMAGE_RESIZE_PART")
 id=$(cut -d: -f1 <<< "$partition")
@@ -57,7 +61,7 @@ if [[ "$ptype" == ext[234] ]]; then
     # 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"
+        $EATMYDATA $RESIZE2FS -f "$device"
     else
         log_error "The file system state of partition: \`$device' " \
             " is not clean (state = $state)"
index 5cdecfd..cd94a77 100644 (file)
@@ -17,11 +17,15 @@ unpack=true
 # the order of sections is not important.
 # the debootstrap option determines which repository
 # is used to calculate the list of Priority: required packages.
-debootstrap=Debian
-aptsources=Debian
+debootstrap=Debian Backport
+aptsources=Debian Backport
 
 [Debian]
 packages=linux-image-amd64 ntfs-3g ntfsprogs xmlstarlet python reglookup chntpw parted
 source=http://ftp.gr.debian.org/debian
 suite=stable
 
+[Backport]
+packages=eatmydata
+source=http://backports.debian.org/debian-backports
+suite=stable-backports