How would you partition a pre-created image file (let's say with dd or qemu-img), partition it, and format each partition with the file system of your choice without having privileged access to the system (e.g. no access to the loopback device)?
The only robust option I'm aware of is to create a
#QEMU VM just for partitioning and formatting another image (i.e. it runs a script and shuts down immediately after that).
PS. In this scenario, a container, given more infrastructure required, would actually be worse and more heavy-weight option than a VM.
#partitioning