diff --git a/bin/disk-image-create b/bin/disk-image-create index 415cbaf92..943cf6c6d 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -417,7 +417,7 @@ LOOPDEV=$(sudo losetup --show -f $TMP_IMAGE_PATH) export EXTRA_UNMOUNT="detach_loopback $LOOPDEV" export IMAGE_BLOCK_DEVICE=$LOOPDEV eval_run_d block-device "IMAGE_BLOCK_DEVICE=" -sudo mkfs $MKFS_OPTS -t $FS_TYPE -L ${DIB_ROOT_LABEL} ${IMAGE_BLOCK_DEVICE} +sudo mkfs -t $FS_TYPE $MKFS_OPTS -L ${DIB_ROOT_LABEL} ${IMAGE_BLOCK_DEVICE} # Tuning the rootfs uuid works only for ext filesystems. if echo "$FS_TYPE" | grep -q "^ext"; then sudo tune2fs -U ${DIB_IMAGE_ROOT_FS_UUID} ${IMAGE_BLOCK_DEVICE} diff --git a/doc/source/user_guide/building_an_image.rst b/doc/source/user_guide/building_an_image.rst index 8137fd00d..16dccc110 100644 --- a/doc/source/user_guide/building_an_image.rst +++ b/doc/source/user_guide/building_an_image.rst @@ -58,18 +58,25 @@ formats are: Filesystem Caveat ----------------- -By default, disk-image-create uses a 4k byte-to-inode ratio when creating the -filesystem in the image. This allows large 'whole-system' images to utilize -several TB disks without exhausting inodes. In contrast, when creating images -intended for tenant instances, this ratio consumes more disk space than an -end-user would expect (e.g. a 50GB root disk has 47GB avail.). If the image is -intended to run within a tens to hundrededs of gigabyte disk, setting the -byte-to-inode ratio to the ext4 default of 16k will allow for more usable space -on the instance. The default can be overridden by passing --mkfs-options like -this:: +By default, disk-image-create uses a 4k byte-to-inode ratio when +creating the filesystem in the image. This allows large 'whole-system' +images to utilize several TB disks without exhausting inodes. In +contrast, when creating images intended for tenant instances, this +ratio consumes more disk space than an end-user would expect (e.g. a +50GB root disk has 47GB avail.). If the image is intended to run +within a tens to hundrededs of gigabyte disk, setting the +byte-to-inode ratio to the ext4 default of 16k will allow for more +usable space on the instance. The default can be overridden by passing +``--mkfs-options`` like this:: disk-image-create --mkfs-options '-i 16384' vm +You can also select a different filesystem by setting the ``FS_TYPE`` +environment variable. + +Note ``--mkfs-options`` are options passed to the mfks *driver*, +rather than ``mkfs`` itself (i.e. after the initial `-t` argument). + Speedups -------- If you have 4GB of available physical RAM (as reported by /proc/meminfo