[shr, others?] Flash drive mounted with sync option

2009-06-29 Thread Ben Wong
Hi!  Can anyone help me to figure out if the following behavior is a bug or not?

Under SHR (both testing and unstable), drives and partitions not
listed in fstab are automounted using the sync option which is
*very* slow and possibly damaging to flash media.

Slowness: While attempting to untar a file onto a partition mounted
using the sync option, my card could only handle 4KBps.  When I
removed the sync option, the data rate increased by a hundred fold to
400KBps.

Damage: Quote from the man page for mount (from Debian):

   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'd like to submit a bug report with a suggestion to remove the -o
sync option, but before I do, I wonder if anybody can tell me if
there is a valid reason to be using sync on all automounted drives.

--Ben

P.S.  I believe this bug/feature is controlled by /etc/udev/scripts/mount.sh:

automount() {   
  ! test -d /media/$name  mkdir -p /media/$name

  if ! $MOUNT -t auto -o sync $DEVNAME /media/$name
  then
#logger mount.sh/automount $MOUNT -t auto $DEVNAME
\/media/$name\ failed!
rm_dir /media/$name
  else
logger mount.sh/automount Auto-mount of [/media/$name] successful
touch /tmp/.automount-$name
  fi
}

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [shr, others?] Flash drive mounted with sync option

2009-06-29 Thread Nikita V. Youshchenko
 I'd like to submit a bug report with a suggestion to remove the -o
 sync option, but before I do, I wonder if anybody can tell me if
 there is a valid reason to be using sync on all automounted drives.

The reason is - if mount is not sync, something is writtent to the device, 
and then device is removed before it is manually unmounted AND unmount 
syscall completes, then device filesystem will become broken, possibly 
unrecoverable.

Since users don't like to manually unmount their devices, and developers 
really don't like when users blame them for unrecoverable data loose, 
default is to mount sync.

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [shr, others?] Flash drive mounted with sync option

2009-06-29 Thread Ben Wong
 Since users don't like to manually unmount their devices, and developers
 really don't like when users blame them for unrecoverable data loss,
 default is to mount sync.

Thank you for reminding me of that.  You might be right that it is was
a developer's choice, but if so it was a very poor design decision.
The benefit of avoiding an fsck is quite modest, especially with
journaled file systems.  And, unless there's something I'm missing, a
sync'd flash filesystem is unusably slow on the Freerunner.

Here is an example of how I installed SHR onto a free partition on my
SD card today:

  zcat openmoko-shr-image-*-om-gta02.rootfs.tar.gz | ssh -v
r...@192.168.0.202 tar -C /media/mmcblk0p2 -xf -

  With sync:  All day to untar the distribution (no exact time, xfr canceled)
  Without sync:  570 seconds to untar the distribution

--Ben

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community