Red Hat Bugzilla – Bug 816098
virt-make-fs fails to make a btrfs filesystem because it doesn't allocate enough space
Last modified: 2012-05-03 11:49:08 EDT
Description of problem:
btrfs has a minimum filesystem size of 256 MB. virt-make-fs
doesn't take this into account when estimating the size of
filesystem to create, so if the input files are less than this
size it will fail with an error similar to:
mkfs: btrfs: /dev/vda1: device /dev/vda1 is too small (must be at least 256 MB) at /usr/bin/virt-make-fs line 451.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Choose a small tarball (much smaller than 256 MB in size)
2. virt-make-fs -F qcow2 -t btrfs --partition=mbr input.tar output.qcow2
Fails with an error as above.
It should increase the estimate to the minimum size and thus
Note that the overhead of btrfs is much larger than expected.
eg: With a 6 MB tarball, a 512 MB disk doesn't have enough space:
$ virt-make-fs -F qcow2 -t btrfs --partition=mbr --size=512M \
Formatting '/tmp/disk.qcow2', fmt=qcow2 size=536870912 encryption=off cluster_size=65536
virt-make-fs: error copying contents into filesystem
An error here usually means that the program did not estimate the
filesystem size correctly. Please read the BUGS section of the manpage.
tar_in: tar subcommand failed on directory: /: tar: libguestfs-1.17.1/ChangeLog: Cannot write: No space left on device
tar: libguestfs-1.17.1/.gitignore: Cannot write: No space left on device
With a 1 GB filesystem, only 388 MB is usable, indicating an
overhead of 636 MB just for btrfs(!)
$ virt-make-fs ... --size=1G ...
$ virt-df -h /tmp/disk.qcow2
Filesystem Size Used Available Use%
disk.qcow2:/dev/sda1 1.0G 37M 351M 4%
Link should be:
Patches posted to the upstream mailing list:
Fixed in 1.17.39.