mount, sync and speeds

Place to discuss Fedora and/or Red Hat
Post Reply
Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

mount, sync and speeds

Post by Tux » Sat Jan 13, 2007 6:35 pm

HAL on my Fedora box is setup to add "sync" to the mount options of my removable devices. I really object to this because I am taking about a 50% performance hit on the speeds I _should_ be getting even in unfavourable conditions.

A) Does anyone know what sync actually does?
mount(8) wrote:sync
All I/O to the file system should be done synchronously. In case of media with limited number of write cycles (e.g. some flash drives) "sync" may cause life-cycle shortening.
I have found that this gives some sort of protection to doofus' who pull out devices before unmounting. Well, I have a good enough understanding of Operatiing Systems not to do this so I don't really wan't HAL nannying me with obtuse mount options.

B) How can I modify the mount options that udev/HAL applies?

I would still like to retain the graphical mount/unmount functionality (ie. don't want to put my drive in the fstab)

TIA as always.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Jan 13, 2007 6:47 pm

That's odd, I just plugged my 1GB USB flash drive in and it automounted but doesn't appear to be using the sync option:

Code: Select all

/dev/sda1 on /media/disk-1 type vfat (rw,noexec,nosuid,nodev,shortname=winnt,uid=500)
That's on FC6.

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Sat Jan 13, 2007 6:53 pm

I've read that sync doesnt actually do anything on a fat partition, so that may be why.

It certainly adds it for my ext3:

Code: Select all

[tux@localhost ~]$ cat /media/.hal-mtab
/dev/sda1       500     0       ext3    noexec,nosuid,nodev,sync,data=ordered   /media/disk
/dev/sdb1       500     0       vfat    noexec,nosuid,nodev,uid=500,noatime,utf8,shortname=lower        /media/IHP140

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Jan 13, 2007 7:35 pm

If you look at the changelog on hal (rpm -q hal --changelog) you will see where someone last year had patched it to never use the sync option. Apparently that has been changed again. This leads me to believe the package will have to be modified and rebuilt. I'll download the SRPM and see if there might be a simple option in the spec file unless you beat me to it. I might not get to it right away.

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Sun Jan 14, 2007 1:21 pm

Ok, FIXED!

The offending setting is located in /usr/share/hal/fdi/policy/10osvendor/20-storage-methods.fdi (on FC6)

There is a line, which adds 'sync' as a valid mount option for all drives:
<append key="volume.mount.valid_options" type="strlist">sync</append>

I have just commented out this line (127) as a stopgap measure. Ideally I would tweak the XML so that it is only disabled for removable devices, but seeing as I _never_ use sync I will leave this for another day.

Thanks for looking into it void. I can't actually see where the patch got reverted. At the time this issue was fixed (FC4 Era) the requred change was actually to the policy file 10-storage-policy.fdi which no longer exists. The orginal fedora bugzilla entry was #157674.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sun Jan 14, 2007 2:07 pm

Very cool. I was hoping it wasn't a compiled in option. I wonder if it wouldn't hurt to ask or suggest that this be removed on one of the Fedora mailing lists? There are quite a few to choose from, not sure which would be appropriate:

https://www.redhat.com/mailman/listinfo/

Post Reply