3

Trying to backup the contents of a 2 TB external drive to another of equal capacity. Finder copying is extremely slow. Is there a quicker alternative?

Bachalo
  • 753
  • cp does it file at a time, writing file system entries etc... You can clone the drive (copies sectors regardless of what's in them).. https://help.ubuntu.com/community/DriveImaging – guiverc Jul 16 '18 at 02:27
  • Have you tried cp -b ? – C0deDaedalus Jul 16 '18 at 03:20
  • tar cf - . | pv | (cd /mountpoint; tar xf -) should be the quickest. BUT your question contains a trap: backups are not about being QUICK. They are about being SECURE. You really should use the answer by Sebastian regardless of speed and time. If it is a USB2 connection a USB3 connection will give you the most speed increase. – Rinzwind Jul 16 '18 at 13:56

1 Answers1

5

I would recommend using rsync for this:

rsync -avP /disk1/ /disk2

while /disk1 and /disk2 are the mount points of your two disks. The -a flag will keep file metadata intact and -vP will give you a verbose progress indicator.

Main advantage is that you can stop the process at any time and continue later simply by running the same command again.

Sebastian Stark
  • 6,122
  • 19
  • 48
  • But it will not be quicker ;-) – Rinzwind Jul 16 '18 at 13:20
  • But it is more fail safe, which is preferable for backups – Sebastian Stark Jul 16 '18 at 13:21
  • I didn't measure, but I would think it's also quicker than using any GUI tool. But that's just guessing. – Sebastian Stark Jul 16 '18 at 13:23
  • Oh, I agree on all the benefits but it wont be quicker and that's his main concern :D tar is going to be the quickest tool (and will also be less secure ;) ) Oh the memories that haunt me after my boss asked me the same question. It took us 8 weeks of testing :-X – Rinzwind Jul 16 '18 at 13:23
  • I agree tar is faster. If you get it right and error free the first time. – Sebastian Stark Jul 16 '18 at 13:26
  • why disk1 with slash and disk2 without slash? – sugab Aug 01 '21 at 22:01
  • @bagustris this is straight from the "Usage" section of rsync(1): "A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination." If you want symmetry you can add a slash to the destination, it shouldn't make a difference. – Sebastian Stark Aug 10 '21 at 04:36