I can create a regular file on an existing file-system (say, ext4), make it into a block device (via losetup
), and format it with an ext4 file-system of its own.
But the above hard-disk is of a fixed size.
Question:
VirtualBox
allows you to create VDI, VMDK, and VHD types of hard-disks that can be either fixed- or dynamically-sized. Is there any way to make a file-based dynamically-sized hard-disk for use by a Linux host OS?Is it possible to employ any of these three types of file-based, dynamically-sized hard-disks outside of
VirtualBox
, on a Linux host OS?
I'm on Ubuntu 16.04.
cat
) writes to a file sitting in this hdisk, then this hdd should automatically expand if needed.qemu-img
necessary? I think, the key point in your answer is sparse files, which I did not know ext4 supported. I could create a sparse file, and uselosetup
andmke2fs
, right?