fs2di, or (f)ile(s)ystem "2" (d)isk (i)mage, is a tool that allows you to take filesystem images and turn them into disk images. None of the existing tools that I could find for this purpose worked exactly how I wanted, so I made fs2di. The generated disk images are partitioned appropriately (although currently only MBR is supported, but GPT support will probably eventually be added).
System / software dependencies are:
- mincbuild (optional, for build)
- A shell environment (for program execution)
- To build fs2di, run
mincbuild
ormake
- To install fs2di after building, run
./install.sh
as root - To uninstall fs2di after installation, run
./uninstall.sh
as root
To turn a filesystem image called disk-fs.img
into a bootable disk image
called disk.img
, run:
$ fs2di --out=disk.img disk-fs.img boot 6
This assumes a sector size of 512 bytes, a partitioning scheme of MBR, and a partition volume type of 6 (FAT16B).
For more information, read the documentation.
Feel free to fork this repository and create your own version. If you add support for GPT or fix a bug, I request that you open a pull request here.