Hi, I'm trying to mount my FSKit volume with a client app (SwiftUI).
I already successfully did it with the "mount" command and I can instantiate my file-system with FSPathURLResource.
Also, I managed to mount the file-system with DiskArbitration in a SwiftUI app, but I only managed to get it working with FSBlockDeviceResource.
Is there a way to programmatically do it in a client app? Or is "mount" command currently the only option?
I already successfully did it with the "mount" command and I can instantiate my file-system with FSPathURLResource.
What is your file system actually "doing"? What's the path target?
The issue here:
Also, I managed to mount the file-system with DiskArbitration in a SwiftUI app, but I only managed to get it working with FSBlockDeviceResource.
...is that block storage devices are the only reason DiskArbitration exists at all. More specifically, DiskArb exists because the expectation that disk will automatically mount when you plug them in is fairly complicated to implement, which then to its larger role of telling the rest of the system what was going to happen and letting them "vote" on that activity. None of that really applies to other file system types (for example, network file systems or disk images), which basically all work by saying "mount this target using this specific file system". Note, for example, that while DiskArb can "see" network volume mounts (meaning, they appear in its callbacks), it can't actually initiate them. The mount itself is either initiated through the NetFS.framework or one of the mount_* commands.
That leads to here:
Or is "mount" command currently the only option?
In practice, "/sbin/mount" is the system’s primary mounting interface. I think the "mount()" syscall is better understood as the SPI mount commands use to communicate with the kernel, NOT the API apps use to "mount volumes". Notably, the way diskarbitrationd ultimately mounts volumes is by using posix_spawn to run "/sbin/mount". There's nothing particularly "wrong" about doing the same thing by calling "/sbin/mount" yourself.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware