I'm using an m2 SSD in a USB C enclosure as a root partition on Linux. Despite trying different enclosure brand, there are always some rare disconnection (when moving the cable for example).
A quick disconnect will always force remount the partition readonly and won't be recoverable (eg: I would need to reboot).
Back in the days, with e-SATA, disconnecting the disk would freeze I/O, but everything would be back to a working state after reconnecting the drive.
This is also similar to the hard
mount option for NFS.
Is there a way to achieve with an USB storage device - freeze the I/O during disconnect instead of remounting the partition readonly and returning I/O errors for I/O calls?
toram
(from a live ISO copied to ram). Then you can physically unplug every storage drive with no issues, if you wanted. Of course, you would have to mount a physical drive to save any changes since all root filesystem writes are only to temporary ram (tmpfs) files.