Sample Header Ad - 728x90

Create and populate FAT32 filesystem without mounting it

36 votes
1 answer
10919 views
Is there a way to create a FAT32 filesystem containing a set of files, without needing to mount it or have root access? I am developing a software application for an old operating system as a hobby, and as part of the build process I would like to package up some source files into a FAT32 disk image, then launch QEMU to boot the image and run an old compiler in it. Afterwards I would like to extract the compiled file out of the FAT32 disk image. I can create the filesystem with mkfs.vfat, however the only way I know of to get files into and out of the image is to mount it, which typically requires root access and is not conducive to being embedded in a build process. Ideally I am after something like the zip and unzip utilities, only instead of creating/extracting .zip files, it would create and extract disk images in FAT16 or FAT32 format. Does anything like this exist? The only things I can find online all involve mounting the disk image.
Asked by Malvineous (7395 rep)
Jan 17, 2021, 12:31 AM
Last activity: Jan 17, 2021, 12:42 AM