Re: Mount option hazardous to USB Flash!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steffen Kluge wrote:

> Michael H. Warfield wrote:

>> BE FOREWARNED!  If you are going to write massive amounts of data
>> (lots of little files or even just one great big one) to USB keys
>> with FAT file systems, do NOT use the hotplug automounts!  Unmount
>> the key and mount it somewhere else without the sync option.  Writing
>> will run much much faster, though unmounting and sync will take
>> longer.


> Interesting. However, it seems to conflict with this snippet from the > mount(8) man page: > > The following options apply to any file system that is being > mounted (but not every file system actually honors them - e.g., > the sync option today has effect only for ext2, ext3 and ufs) > > What gives? It appears FAT mounts should ignore -o sync...

I got a 1GB flash player this week.  I was transferring files on using
the default fstab-sync options throughout the week and it's been going
slowly, especially considering transfers using the same machine on
Windows were fast.  I assumed Fedora just wasn't using USB 2.0 for some
reason.  Mr Warfield's post last night prompted me to try dropping
the sync option and:
1. cp commands from the command line now finish quickly, _without_
   the player display showing 'writing'.  Previously they lasted
   longer and the player display would flicker between 'writing'
   (short bursts) and 'ready' (long periods).
2. Unmounting was previously fast, with the icon disappearing from
   the desktop immediately.  Now unmounting takes longer, and while
   unmounting the player display shows 'writing' uninterrupted.

It definitely seems that sync does have an effect.

I haven't timed transfer with and without sync, but the display of
'writing' without interruption during unmounting (wo sync) versus
intermittent display of 'writing' (w sync) during copy suggests
async should be faster.

It took quite a while to work out how to change the HAL options for
mounting the player.  Neither the fstab-sync manpage or the HAL
documentation mention the need to restart the haldaemon to re-read
/usr/share/hal/fdi/, which took a while to find out.  Once I had that
I couldn't find a rule that would match usb disks, although it should
have been easy:

<match key="info.category" string="storage">
  <match key="storage.bus" string="usb">
    <merge key="storage.policy.mount_option.sync" type="bool">false</merge>
  </match>
</match>

Might be expected to work but didn't seem to pick up the player.

In the end I basically replicated the offending section of the default
profile:

[ian@localhost ~]$ cat /usr/share/hal/fdi/95userpolicy/async-usb-key.fdi
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">
<device>
<match key="volume.size" compare_lt="2147483648">
<match key="@block.storage_device:storage.hotpluggable" bool="true"> <merge key="volume.policy.mount_option.sync" type="bool">false</merge>
</match>
<match key="@block.storage_device:storage.removable" bool="true">
<merge key="volume.policy.mount_option.sync" type="bool">false</merge>
</match>
</match>
</device>
</deviceinfo>


And the player is now mounted on connection without the sync option.
I had also tried adding a volume.policy.mount_option.async key
to make sure, but this didn't seem to work properly: the player
didn't get mounted, but a mount point was created.  Looking in
/etc/fstab showed the option 'aiocharset=utf8', and no 'async'.
Something not quite right there.

imalone


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux