You are not logged in.
Currently, any storage device I connect through any USB port of my laptop is mounted with writeback cache enabled. This is something I'd like to avoid. Why? Because I find annoying that copying, for example, a big file such a movie to a USB flash stick will show as completed before it actually is, which could lead to data loss as I might think it's done and pull it out.
The best way seems to mount the devices with the "sync" option. I've tried this udev rule:
SUBSYSTEM=="block", ENV{ID_BUS}=="usb", ENV{ID_TYPE}=="disk", ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_MOUNT_OPTIONS}="sync"
With no succes. I am using Gnome, which uses gvfs for automounting. I think that means there is something else to do here, but I don't know what?
Would anyone have any suggestions?
Thanks.
Offline
The best way is to unmount volumes you have mounted instead of just pulling it.
Offline
Yes, which then throws a notification that "data is still being written", which leads to me waiting for an undefinied amount of time until the cache is actually written.
I'd like to avoid that.
Offline
Open a system monitor while you are writing to a usb device, and watch it. For the last 11 years at least, an arch machine will write everything to the usb drive, pause for 5-10 seconds, then finish writing the last of it. Watch your system monitor for it being done.
If it is a ntfs external device, you definitely want to be sure that it is done before you pull it out. Or you will by looking for a microsoft machine to fix it's corrupt volume.
I think that you can have a look at these too.
/proc/sys/vm/dirty_background_bytes
/proc/sys/vm/dirty_bytes
Offline