From d5b30d126e490bdd4775c3dc1d2c77dc75d34057 Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Fri, 25 Oct 2013 11:18:33 +0100 Subject: [PATCH] Increase the size heuristic for images Occasionally cloud-init fails to resize the disk on first boot, this is occuring because the filesystem has only 10% free. Nudging the disk size up a bit more should give us a little more headroom so this is less likely to occur. I havn't been able to find out what value ensures we wont hit this problem but I can say for sure this fixes all casses of the problem I have seen. Change-Id: Ib23f3a654151338ad91839e49b323b65b4054245 --- bin/disk-image-create | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/disk-image-create b/bin/disk-image-create index e66503e2..6a57fb97 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -144,11 +144,11 @@ MKFS_OPTS="" if [ -n "$DIB_IMAGE_SIZE" ]; then truncate -s${DIB_IMAGE_SIZE}G $TMP_IMAGE_PATH else - # in kb*0.75 - underreport to get a slightly bigger device + # in kb*0.70 - underreport to get a slightly bigger device # Rounding down size so that is is a multiple of 64, works around a bug in # qemu-img that may occur when compressing raw images that aren't a multiple # of 64k. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1180021 - _NEEDED_SIZE=$(sudo du --block-size=750 -x -s ${TMP_BUILD_DIR}/built | \ + _NEEDED_SIZE=$(sudo du --block-size=700 -x -s ${TMP_BUILD_DIR}/built | \ awk ' { print $1 - ( $1 % 64) } ') truncate -s${_NEEDED_SIZE}K $TMP_IMAGE_PATH if [ "$FS_TYPE" = "ext4" ] ; then