In Linux, how to do quick remove of USB device, like Windows, without file system impact or corruption?

655 views Asked by At

In Linux, how to do quick remove of USB device, like Windows, without file system impact or corruption?

I know the following:

  1. Lazy unmount will remove the mount reference, on USB device quick remove in Linux, but that does not protect file system, ext4, NTFS, vFat, whatever the USB device file system is, still may have pending writes cached.

  2. Mount with dirsync, sync, flush, none of these seem to work interface to no. 1 above. Have actually tested this, and you get warnings about running fsck, or chkdsk.

  3. Turning off write cache of device, would seem to make sense to avoid no. 1 and no. 2 above, right? Is that likely?

Is there a consistent method to disable the write cache before mount is done? Prefer that this be done via a UDEV add rule, i.e. call script, whatever.

Windows feature as noted above... Really does imply it is just a write cache/sync removal configuration.

enter image description here

0

There are 0 answers