davidgiven/fluxengine

Expose as block device on Linux

Opened this issue · 1 comments

Not just to read, that is easy to just export, do loopback and mount. But full real time support.

For simple operations fluxengine can be used itself, but for more complex, it is nice to mount drive directly.

Current workflow would be to read, save image, loopback mount, do stuff, unmount, overwrite whole disk. Cumbersome, slower.

Would be great to expose drive as block device to Linux, so filesystem drivers can access it directly (ones in kernel or FUSE based one), as well tools like partitioning tools, dd, etc

This would also allow to easily integrate read and write of real drives and disks in real time in emulators.

This can be done using few alternative methods:

  • VDUSE (vDPA Device in Userspace) - similar to FUSE but for block devices, since 2021
  • TCMU
  • ublk (io_uring block in userspace), since 2022, experimental, relatively simple.

Or network based (all supported on Linux):

  • NBD - network block device, since about 1997 in Linux, 2001 standarized. Clients available also for few other OSes.
  • iSCSI - more versatile, but more complex protocol compared to NBD. Many OSes supported too
  • NVMe-oF - not too complex, but probably less support than NBD, but also available on major OSes
  • ATA-over-Ethernet - less common, might be too restrictive

Network based ones are a interesting option, as could allow to access drive from other computers.

Not all above would be suitable of course, as 1) some formats might not have standarized way of converting sectors and tracks to LBA, 2) some formats might be using really weird sector sizes that are not supported by a given mechanism.

I do not have know enough to do specific suggestions.

Do you know about the FluxEngine filesystem commands? They let you read and write individual files without needing to image the entire disk (for supported filesystems, of course).