Put MKFS_OPTS after filesystem type
mkfs's arguments are mkfs [options] [-t type] [fs-options] device [size] So it seems our MKFS_OPTS are really supposed to be fs-options, rather than options to mkfs itself. Why didn't we notice? It's quite a trap -- mkfs.ext2 has a "-t" option, so when we're calling $ mkfs -i 4096 ... -t ext4 ... We actually just fall-back to the default from the mkfs wrapper which is mkfs.ext2 which works! But when you make that, say, xfs, we're not calling the right wrapper at all. Also update documentation Closes-Bug: #1648287 Change-Id: I3ea5807088ab361bd9c235c07fb1553fbaf9178b
This commit is contained in:
parent
8c74c8e409
commit
5e2330d89c
@ -417,7 +417,7 @@ LOOPDEV=$(sudo losetup --show -f $TMP_IMAGE_PATH)
|
|||||||
export EXTRA_UNMOUNT="detach_loopback $LOOPDEV"
|
export EXTRA_UNMOUNT="detach_loopback $LOOPDEV"
|
||||||
export IMAGE_BLOCK_DEVICE=$LOOPDEV
|
export IMAGE_BLOCK_DEVICE=$LOOPDEV
|
||||||
eval_run_d block-device "IMAGE_BLOCK_DEVICE="
|
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.
|
# Tuning the rootfs uuid works only for ext filesystems.
|
||||||
if echo "$FS_TYPE" | grep -q "^ext"; then
|
if echo "$FS_TYPE" | grep -q "^ext"; then
|
||||||
sudo tune2fs -U ${DIB_IMAGE_ROOT_FS_UUID} ${IMAGE_BLOCK_DEVICE}
|
sudo tune2fs -U ${DIB_IMAGE_ROOT_FS_UUID} ${IMAGE_BLOCK_DEVICE}
|
||||||
|
@ -58,18 +58,25 @@ formats are:
|
|||||||
Filesystem Caveat
|
Filesystem Caveat
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
By default, disk-image-create uses a 4k byte-to-inode ratio when creating the
|
By default, disk-image-create uses a 4k byte-to-inode ratio when
|
||||||
filesystem in the image. This allows large 'whole-system' images to utilize
|
creating the filesystem in the image. This allows large 'whole-system'
|
||||||
several TB disks without exhausting inodes. In contrast, when creating images
|
images to utilize several TB disks without exhausting inodes. In
|
||||||
intended for tenant instances, this ratio consumes more disk space than an
|
contrast, when creating images intended for tenant instances, this
|
||||||
end-user would expect (e.g. a 50GB root disk has 47GB avail.). If the image is
|
ratio consumes more disk space than an end-user would expect (e.g. a
|
||||||
intended to run within a tens to hundrededs of gigabyte disk, setting the
|
50GB root disk has 47GB avail.). If the image is intended to run
|
||||||
byte-to-inode ratio to the ext4 default of 16k will allow for more usable space
|
within a tens to hundrededs of gigabyte disk, setting the
|
||||||
on the instance. The default can be overridden by passing --mkfs-options like
|
byte-to-inode ratio to the ext4 default of 16k will allow for more
|
||||||
this::
|
usable space on the instance. The default can be overridden by passing
|
||||||
|
``--mkfs-options`` like this::
|
||||||
|
|
||||||
disk-image-create --mkfs-options '-i 16384' <distro> vm
|
disk-image-create --mkfs-options '-i 16384' <distro> 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
|
Speedups
|
||||||
--------
|
--------
|
||||||
If you have 4GB of available physical RAM (as reported by /proc/meminfo
|
If you have 4GB of available physical RAM (as reported by /proc/meminfo
|
||||||
|
Loading…
Reference in New Issue
Block a user