We posted a new tool today which you can use to make filesystems containing some prepopulated data.
Previously you’ve been able to create ISO and other read-only filesystems using programs like mkisofs and mksquashfs.
This program lets you do the same thing, but for any filesystem, for example an ext3 filesystem or NTFS.
Unlike ISO filesystems, ordinary filesystems don’t “just fit” around the files inside them. And so the main difficulty has been to estimate the amount of space you have to allocate in order to fit your files, with the least wasted space. This program automates this with a simple estimator function which should work for most cases and we hope to improve over time.
Usage is simple (virt-make-fs man page). Start with either a tarball or a directory full of files to add, and just do:
virt-make-fs [--type=fstype] /inputdir output.img
The new filesystem image will be read-only or read-write (provided I use suitable filesystem of course)?
Once you mount it somewhere, you can write to it. If you use the –size=… option then you can reserve extra space in the image.
What’s the cluster size of NTFS? Can it be changed? I wonder with current qcow2’s 64K clusters, perhaps it would be beneficial to align the FS with that size as well?
Yaniv, default cluster size is 4K, but can be changed to up to 64K. Actually, it’s a bit more complicated than that with larger filesystems requiring a larger cluster size, see:
http://support.microsoft.com/kb/140365