You are not logged in.
Hello everyone ![]()
I use Gnome as a DE, there's this built-in automount feature (part of Nautilus I think ?) that is very usefull.
I know I can use /etc/fstab to set options for given drives, detected by their UUID for instance.
But I'd like to be able to set default options for any "USB" drive for instance, or maybe for any "exfat" partition.
Still having the automount process to manage the mount point folder creation using uuid and everything, just having default settings for "families" of devices, how could I do that ?
Cheers
Last edited by RogerRabbit (2024-02-24 15:27:15)
Offline
Offline
https://wiki.archlinux.org/title/Udisks … nt_options
FFFFF....
Last edited by V1del (2024-02-23 22:09:54)
Offline
Thanks for this collegial answer.
Well, not sure what I'm doing wrong but it's like this file does nothing.
I'd like to add the "sync" option on exfat drives, so I tried...
exfat_defaults=sync
...
exfat_defaults=sync
exfat_allow=sync
...
exfat_defaults=uid=$UID,gid=$GID,iocharset=utf8,errors=remount-ro,sync
exfat_allow=uid=$UID,gid=$GID,iocharset=utf8,errors=remount-ro,sync
All these in the [defaults] section of the file, unplugging/replugging the USB stick each time, I even restarted the computer whereas the documentation says the changes are live, and you don't need to restart the daemon for the changes to take effect...
Offline
Even when manually mounting the drive with
udisksctl mount -o sync -b /dev/sda1the sync option is not there. I grabbed the udisk events while doing so :
Monitoring the udisks daemon. Press Ctrl+C to exit.
01:29:43.300: The udisks-daemon is running (name-owner :1.59).
01:29:50.636: Added /org/freedesktop/UDisks2/jobs/16
org.freedesktop.UDisks2.Job:
Bytes: 0
Cancelable: true
ExpectedEndTime: 0
Objects: /org/freedesktop/UDisks2/block_devices/sda1
Operation: filesystem-mount
Progress: 0.0
ProgressValid: false
Rate: 0
StartTime: 1708734590635066
StartedByUID: 0
01:29:50.652: /org/freedesktop/UDisks2/jobs/16: org.freedesktop.UDisks2.Job::Completed (true, '')
01:29:50.652: /org/freedesktop/UDisks2/block_devices/sda1: org.freedesktop.UDisks2.Filesystem: Properties Changed
MountPoints: /run/media/bugs/75E7-D462
01:29:50.652: Removed /org/freedesktop/UDisks2/jobs/16
01:29:50.652: /org/freedesktop/UDisks2/block_devices/sda1: org.freedesktop.UDisks2.Filesystem: Properties Changed
** (udisksctl monitor:3792): WARNING **: 01:29:50.652: (udisksctl.c:2811):monitor_on_interface_proxy_properties_changed: runtime check failed: (g_strv_length ((gchar **) invalidated_properties) == 0)
01:29:50.653: /org/freedesktop/UDisks2/block_devices/sda1: org.freedesktop.UDisks2.Block: Properties Changed
UserspaceMountOptions: uhelper=udisks2
01:29:50.653: /org/freedesktop/UDisks2/block_devices/sda1: org.freedesktop.UDisks2.Filesystem: Properties Changed
** (udisksctl monitor:3792): WARNING **: 01:29:50.653: (udisksctl.c:2811):monitor_on_interface_proxy_properties_changed: runtime check failed: (g_strv_length ((gchar **) invalidated_properties) == 0)
01:29:50.691: /org/freedesktop/UDisks2/block_devices/sda1: org.freedesktop.UDisks2.Filesystem: Properties Changed
** (udisksctl monitor:3792): WARNING **: 01:29:50.691: (udisksctl.c:2811):monitor_on_interface_proxy_properties_changed: runtime check failed: (g_strv_length ((gchar **) invalidated_properties) == 0)Offline
I'd like to add the "sync" option on exfat drives, so I tried...
Have you tried that w/ a vfat partition?
I just tried (never used the FS before… ever)
dd if=/dev/zero of=exfat.iso count=10k
mkfs.exfat exfat.iso
sudo mount -o loop,sync exfat.iso /media/DISK
mount | grep DISKNo "sync" in that mount to be found (but I'm running an older kernel)
Try that first and be aware that, if it works, it'll most likely slow down the write process and kill your SD card in no time.
Offline
/home/bugs/exfat.iso on /run/media/bugs/DISK type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)Well does this mean that exfat does not support sync !?
Offline
BTW I'm trying to do this because performances on USB are poor.
When I copy large files, it's very fast at first (while copying to cache), then it gets slower and slower, even under the normal write speed of the media. And when the copy is done, I can't remove the stick just then, if I use the sync command to commit everything, the time for the sync is almost as long as the copy was, this is unproductive.
P. S. Maybe you have suggestions to prevent that behavior ?
Last edited by RogerRabbit (2024-02-24 09:49:35)
Offline
Get a faster USB key.
The behavior you see is because of the file cache, if you've a fast source, a slow destination and plenty of RAM, it can take a while until it is cleared.
See https://lonesysadmin.net/2013/12/22/bet … rty_ratio/ on how to tune that.
nb. that the overall process will NOT become any faster - rather slower - but more frequent cache flushes will cause the userspace perception to be close to reality.
(An alternative approach was to use a copy tool that frequently reads the destination, resp. runs an extrapolating heuristic on that base - it'll make things even slower, though)
All of that is way better than mouting NAND memory "sync" (which is why I guess the specialized exFAT doesn't even allow that)
Fyi, you seem to still use the fuse exfat driver, not the kernel one.
Offline
Sorry for derailing this thread, but I just wanted to say thank you @seth for all the help you are giving in this forum, you are awesome!
Last edited by micronetic (2024-02-24 14:24:58)
Offline
Thanks for this information I'll dig further on how to tune things to make the copy "real" and especially don't need to wait for a very long sync after the copy, and see why I'm not using the kernel driver on this computer.
Also I can give a bit of information, exfat does support sync, because it's enabled on a USB HDD drive that I have, so I guess this has someting to do with NAND memory more than with exfat FS.
Also, I'm using exfat for compatibility across OSes (macos, windows), as far as I know, this is the only one that is natively supported for read/write on the 3 systems, and that allow large partitions AND large files.
Cheers, I'll mark this as solved because the topic subject is answered.
Offline
because it's enabled on a USB HDD drive that I have
Can you post the output of "mount" while that (and your exfat usb key) are mounted?
/home/bugs/exfat.iso is a loop device on your $HOME partition and I kinda doubt that the FS will try to discriminate HW (also every SSD uses NAND memory)
Fwi, FAT32 supports 16TB partitions and 4GB files.
Offline
Here you go, this one is from an other computer running Debian bookworm.
/dev/sda1 on /media/roger/CA72-2796 type exfat (rw,nosuid,nodev,relatime,sync,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro,x-gvfs-show)
/dev/sdc1 on /media/roger/75E7-D462 type exfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro,uhelper=udisks2)I use fstab to force sync on this specific device :
/dev/disk/by-uuid/CA72-2796 /media/roger/CA72-2796 auto nosuid,nodev,nofail,noauto,x-gvfs-show,sync,uid=1000,gid=1000 0 0Offline
Also I just understood why I was using the old fuse exfat driver.
I was looking for the "mkfs.exfat" binary, so i typed "pacman -F mkfs.exfat" and found two packages matching the file, I installed the wrong one, "exfat-utils" AKA "fuse-exfat" instead of "exfatprogs".
Fwi, FAT32 supports 16TB partitions and 4GB files.
I store files from 5 to 50 GB on this USB key.
/home/bugs/exfat.iso is a loop device on your $HOME partition and I kinda doubt that the FS will try to discriminate HW (also every SSD uses NAND memory)
Oh yeah sorry, then it would be fstab that is more powerful than udisks2 ?
(I tried the same udisks2.conf settings on the Debian with same results)
Offline
fstab is certainly not more powerful than "mount -o sync", I'd rather see it fail b/c of the loop device.
Please post the actual /etc/udisks2/mount_options.conf you've created (regardless of whether mounting the device "sync" is actually a good idea, I highly recommend to pursue the dirty_ratio approach)
Offline
Here is the latest one that I had on the Arch machine, which is the one I performed mosts of the tests, except while showing the USB HDD exfat setup as sync in fstab.
[udisks2]
# Comma separated list of modules to load.
# Use asterisk to load all the modules.
modules=*
# Valid options are 'ondemand' or 'onstartup'.
modules_load_preference=ondemand
[defaults]
# Valid options are 'luks1' or 'luks2'
encryption=luks2
fuseblk_defaults=sync
fuseblk_allow=sync
exfat_defaults=sync
exfat_allow=syncAs said in my second message of this thread, I tried many settings.
As the FS was named fuseblk because of the wrong exfat driver, I tried to build things up.
Now I uninstalled fuse-exfat so I'm using the linux driver, and the behavior is the same, no sync in mount :
/dev/sda1 on /run/media/bugs/75E7-D462 type exfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro,uhelper=udisks2)Offline
[defaults]
exfat_defaults=uid=$UID,gid=$GID,iocharset=utf8,errors=remount-ro,sync
exfat_allow=uid=$UID,gid=$GID,dmask,errors,fmask,iocharset,namecase,umask,syncAnd because there're some interference: STAY AWAY FROM /etc/udisks2/udisks2.conf !
The correct file to edit is /etc/udisks2/mount_options.conf
Offline
Woa I'm so sorry, I almost misled you for no reason...
/dev/sda1 on /run/media/bugs/75E7-D462 type exfat (rw,nosuid,nodev,relatime,sync,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro,uhelper=udisks2)To finish, why would you not recommand sync on NAND ?
NAND memory lifetime is based on the number of write cycles, wouldn't the amount of data copied be the same with or without sync ?
Offline
So I found it :
What happens, with the sync option on a VFAT file system, is that the
FAT tables are getting pounded and over-written over and over and over
again as each and every block/cluster is allocated while a new file is
written out. This constant overwriting eventually wears out the first
block or two of the flash drive.
https://groups.google.com/g/linux.kerne … EKbBmRFY0J
I'll try to verify if this still applies to exfat, this a more modern FS maybe they took this into account.
Offline
Also found some usefull information here :
https://github.com/storaged-project/udisks/issues/1177
Basically the exfat FS is quite new to the linux kernel and still in the works...
I like the suggestions to help reach accurate timers for the copy to make it comfortable when you can actually unmount the drive.
The strange thing here is that I filled half of the key at normal speed, but now I'm having trouble to fill the second half (it's copying at 1.5MB/s right now)...
(the drive is a 500GB sandisk)
I synced/unmount the drive in between, so it's not about the dirty bytes that need to be flushed.
Anyway I gave up the idea to set the sync option, and I understood about dirty bytes thanks to your link.
Thanks a ton for all your help.
Offline