Open kotarou3 opened 1 year ago
I'm not totally convinced to use sync
by default, it's very expensive. Of couse the current status is not good either.
As @vojtechtrefny pointed out, there might be a way to limit the dirty buffer for a particular device - see /sys/class/bdi/<bdi>/max_bytes
. However, this feature has only been added in kernel 6.2 (the exfat
filesystem driver was added in 5.7):
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=00df7d51263b46ed93f7572e2d09579746f7b1eb
https://lore.kernel.org/all/20221119005215.3052436-6-shr@devkernel.io/
Removable drives are frequently formatted with the
vfat
andexfat
filesystemsCurrently
vfat
filesystems are mounted with theflush
option by default: https://github.com/storaged-project/udisks/blob/060c9492d616f5b5287e834b50297e414c52f166/data/builtin_mount_options.conf#L4 This results in the write buffer being flushed frequently, so writes of large files end up being throttled to the disk's write speed (rather than RAM), resulting in accurate write speed indications in userspace and a speedy unmountFlushing the write buffer frequently is especially important for removable drives with slow write speeds because:
Unfortunately,
exfat
doesn't support theflush
option at the moment, so the closest would besync
, which flushes every write. So please consider updating the default mount options onexfat
to use thesync
mount option