Sunday, November 1, 2009

Fast File Copy in Linux (Ubuntu)

After a hiatus from doing proper backups (though I have done some improper backups) I finally got that HFS+ disk copied over to two other partitions, reformatted the disk as ext4, and started copying the data back.

Since much of the data was secondary backup I used simple rsync quite a bit on the first copy over
#copying HFS+ volume to ext3 volume
rsync -avh /mnt/tmp /mnt/backup


rsync would have been way too slow to do the exact copy once I reformatted the drive so I used tar instead. With my local SATA / SATA connection I seem to be getting several gigs per minute this way. Another nice touch to this approach is that it preserves hard links.
tar c /mnt/backup/ | tar xf - -C /mnt/tmp


If I were doing the same thing over a network, it would have been like this:
localhost-src:
tar cz /mnt/backup | nc remote-dest-ip-or-name 2342
remote-dest:
nc -l -p 2342 | tar xzf - -C /mnt/remote-backup 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home