Write through on external hdd making writing very slow

Bug #9104 reported by Laurent Mouillart
6
Affects Status Importance Assigned to Milestone
pmount (Ubuntu)
Fix Released
Wishlist
Martin Pitt

Bug Description

I use an external USB hard drive as seconday storage system, but the write
through policy make it very slow.
I think it's possible to scan the vendor info to know if it's an harddrive and
disable the write through and enable write back policy.

scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: HDS72258 Model: 0VLAT20 Rev: 0 0
  Type: Direct-Access ANSI SCSI revision: 02

Revision history for this message
Martin Pitt (pitti) wrote :

This is a difficult decision. SCSI devices like USB sticks, hard disks and
digital cameras are technically very similar and in fact the only thing that
tells them apart (that can be seen from the OS) are their vendor and model names
(which are pretty arbitrary).

We mount such devices with 'sync' to have a reasonably safe default for people
who just rip out their devices without proper unmounting. Depending on the
particular program, i. e. the size of chunks it writes to the device this
considerably slows down writing.

We will not change this for Warty, but for now I see several possible workarounds:

- you change to async at runtime by 'sudo mount -o remount,async /dev/sda1' (or
whatever your mounted partition(s) is/are)
- you create an fstab entry for sda which mounts it async (this requires that
the device is always plugged in at boottime)
- you change 'sync' to 'async' in the pmount source and rebuild the package

Revision history for this message
Laurent Mouillart (laurent-mouillart) wrote :

May be in futur release, it would be possible to have additional tab in the
device manager that permit to select the device on witch you would change the
writing policy.

Revision history for this message
Martin Pitt (pitti) wrote :

For the records, I uploaded pmount 0.3 yesterday. This version supports the
option -a/--async to mount the device with write back. So there is now at least
a manual possibility.

Now we need to integrate this into the GUI stuff, preferably into the "Removable
media" configuration dialog. We could add an option "mount devices
asynchronously if they are bigger than N MB", this is what upstream hal
currently does. Any other/better idea?

Revision history for this message
Martin Pitt (pitti) wrote :

Finally fixed by new versions of pmount (0.4-1ubuntu1), hal (0.4.1-1ubuntu5),
integrated all this in

 gnome-volume-manager (1.0.2-4ubuntu4) hoary; urgency=low
 .
   * debian/patches/ubuntu-05-pmount.patch:
     + now depend on pmount >= 0.4
     + now use pmount-hal for mounting devices
     + call every gvm_device_mount invocation with the hal UDI, not with the
       device node
     + this will finally respect the HAL policy for hotpluggable storage
       devices (Ubuntu bug #9104)
   * Removed debian/patches/02_search_fstab.patch,
     debian/patches/ubuntu-06-search_fstab_pmount.patch, this is now done by
     pmount.

Revision history for this message
Andrea76 (andrea76) wrote :

the latest version of pmount resolves the problem?

Revision history for this message
Martin Pitt (pitti) wrote :

@trapanator: it's solved for ages (look at the date, this got fixed in Hoary in 2004).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.