[LAD] [OT] bash vs disk activity

Patrick Shirkey pshirkey at boosthardware.com
Tue Oct 9 11:58:40 UTC 2007


On Tue, 2007-10-09 at 13:11 +0200, Lars Luthman wrote:
> On Tue, 2007-10-09 at 14:02 +0300, Sampo Savolainen wrote:
> > Quoting Patrick Shirkey <pshirkey at boosthardware.com>:
> > 
> > > 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.

Thanks everyone for the quick replies.

I mounted with mount -o sync /dev/sdb1

and now a 2 minute transfer takes 8 minutes.

Does anyone have a script for monitoring with iostat or vmstat while in
async mode?

I'm thinking a bash equivalent to the disk monitor on gkrellm which
allows me to know when a transfer has completed.




Cheers.


-- 
Patrick Shirkey
Boost Hardware Ltd.




More information about the Linux-audio-dev mailing list