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

Ben Wong lists.openmoko.org at wongs.net
Mon Jun 29 10:01:54 CEST 2009


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
}



More information about the community mailing list