FUSE-mounting partitions in image file
Posted: Sat May 28, 2022 9:50 am
Let's say I've written a FUSE driver for my OS's filesystem. On a particular disk image file, that filesystem is one of several partitions. I'd like to be able to mount that partition in my host/development system to streamline the process of populating it for testing purposes, particularly before I get writing working in my OS project.
The FUSE manual doesn't seem to indicate any way to specify a specific partition by name within an image file to mount (or even by specifying an offset + length, as one might with losetup).
It occurs to me that (as perhaps indicated above) one could use losetup + partx to detect and add loopback devices for the partitions, and then mount the partition's loopback device via fuse--but that seems a bit kludgey. Is there a better, more straightforward way that I'm overlooking or that someone else has come up with (and that does not require privilege elevation, as working with loopback devices does)?
The FUSE manual doesn't seem to indicate any way to specify a specific partition by name within an image file to mount (or even by specifying an offset + length, as one might with losetup).
It occurs to me that (as perhaps indicated above) one could use losetup + partx to detect and add loopback devices for the partitions, and then mount the partition's loopback device via fuse--but that seems a bit kludgey. Is there a better, more straightforward way that I'm overlooking or that someone else has come up with (and that does not require privilege elevation, as working with loopback devices does)?