Speeding up USB Writes
If you’re writing alot of file to a USB Drive formatted with ext2/3 file system, here’s a tip that will speed things up tremendously (for various values of “tremendous”): mount the USB drive with the noatime attribute. The mount command for that is
mount -o noatime /dev/sdb1 /mnt/usb1
Or if the partition is already mounted, you can remount it without unmounting it like this:
mount -o remount,noatime /dev/sdb1 /mnt/usb1
(Careful! Don’t put any spaces between the ‘remount’ and the ‘noatime’ options!)
Unlike legacy operating systems, most *nix and Linux file systems keep track of not only the creation (ctime) and modification time (mtime), but also the last time the file was accessed (atime). So, when you copy a file, you actually write to it twice: once to copy the file and once to update the atime field in the inode.
On one system, remounting with noatime reduced an rsync session from six hours to three hours. On another system, the time was reduced from 1 hour to 12 minutes!
I know, it doesn’t make sense to me why you would want to keep track of the access time of a file, but the people who design these operating systems know more than I do.
Tags: usb

