04 November 2012

Speeding Up Copy Process Between Two Hard Drives

cp command is not suitable for large data transfers between two hard drives. It makes about 10..100KB/sec. Obviously, it will take 29 hours to copy 10GB with 100KB/sec.

There are serveral ways to speed it up(copy over USB or Firewire, for instance). But I found it rather handy to use rsync.

Transfer rate over Ethernet is usually 10..100MB/sec(theoretically, even up to 1GB/sec). Thus, it will take about 17 minutes to copy 10GB over Ethernet. You can do it with command as follows:

$ mkdir -p /mnt/hdd
$ sudo mount /dev/sdbX /mnt/hdd
$ rsync -az user@localhost:/some/folder/* /mnt/dest-hdd/

a("archive mode") option takes care of permissions, ownership, group, symlinks and so. z instructs rsync to use compression.