Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount exfat filesystems with the sync option by default #1177

Open
kotarou3 opened this issue Aug 28, 2023 · 1 comment
Open

Mount exfat filesystems with the sync option by default #1177

kotarou3 opened this issue Aug 28, 2023 · 1 comment

Comments

@kotarou3
Copy link

Removable drives are frequently formatted with the vfat and exfat filesystems

Currently vfat filesystems are mounted with the flush option by default:

vfat_defaults=uid=$UID,gid=$GID,shortname=mixed,utf8=1,showexec,flush

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 unmount

Flushing the write buffer frequently is especially important for removable drives with slow write speeds because:

  • The user may "yank" the drive without unmounting, resulting in data loss if the write buffer isn't empty
  • The user will have an indication of when the write will actually complete, and is likely to refrain from "yanking" until then
  • Even if the drive is unmounted, the user might not wait for an unknown-length unmount (potentially ranging from minutes to an hour for sufficiently large buffers and sufficiently slow write speeds) to complete before "yanking"

Unfortunately, exfat doesn't support the flush option at the moment, so the closest would be sync, which flushes every write.
So please consider updating the default mount options on exfat to use the sync mount option

@tbzatek
Copy link
Member

tbzatek commented Feb 5, 2024

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/[email protected]/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants