On Tue, October 9, 2007 12:11, Lars Luthman wrote:
On Tue, 2007-10-09 at 14:02 +0300, Sampo Savolainen
wrote:
Quoting Patrick Shirkey
<pshirkey(a)boosthardware.com>om>:
For example if I transfer 200mb to a usb disk the
copy command takes
about 30 seconds before it returns and the data takes about 5 minutes
before it is actually finished being transferred and the device is
unmountable.
quick-hack(tm)
(cp -a /xxx /usb_device && sync) &
But remember sync flushes _everything_.
Slightly-slower-hack: add the 'sync' option to whatever script or config
file is used to mount the device (/etc/fstab, udev rules, KDE service menu
etc). That way all writes will be synchronised automatically.
just a little note of warning on this last one, specially if the usb drive
is of the solid-state/flash type: the mount sync option used to force
every block write and, besides it used to take much longer to complete the
transfer, that used to shorten the media life, it wears out you know?
that was specially true when copying large files or batches of too many,
too many times. I've been bitten by this one and already trashed too many
sd cards when I was ripping complete movies (200MB+) for my son's gp2x :)
i don't know whether this still applies to latest kernels, or to any
particular filesystem, as I'm avoiding the sync mount option on removable
media (usually vfat formatted) for about a year now, but I would like to
be wrong ;)
cheers
--
rncbc aka Rui Nuno Capela
rncbc(a)rncbc.org