Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the best way to clone a disk between two Macs? I ask this every couple years or so and every time I get the same answer. "Use Carbon Copy Cloner", they say. But the unfortunate fact is that CCC is a file-level copy between disks. When I migrate to my new Mac, sure all the files are there but there are quirks here and there (including file dates being different etc).

So, really now, once again: how do you clone the disk over byte-for-byte?

share|improve this question

You can use the dd command to make a bit-perfect clone of a drive. It's a command line tool that ships with OS X. In order to make the clone perfect you'll need to ensure the source and the destination aren't actively in use.

To prepare for the clone I recommend creating a secondary boot disk that you can boot from. Your source for the clone should be an offline volume, not in use, when you're making the copy. Otherwise you risk copying things that are in incomplete states on disk.

With your machine booted to your secondary boot disk, log in and fire up a Terminal or iTerm window.

Run diskutil to get a list of your available drives. One of them will be your target drive you're trying to clone. The other will be your source drive. For example:

> diskutil list
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            319.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3       
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS Backup                  499.8 GB   disk1s2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk2
   1:                        EFI                         209.7 MB   disk2s1
   2:                  Apple_HFS Clone                   499.8 GB   disk2s2

Let's say that Macintosh HD is the source and Clone is the target for our dd operation. Start the clone with:

> sudo dd if=/dev/disk0 of=/dev/disk2 bs=128m conv=noerror,sync

When dd finishes you may see an error like this:

dd: /dev/disk2: short write on character device
dd: /dev/disk2: Input/output error
3726+1 records in
3726+1 records out
500107862016 bytes transferred in 14584.393113 secs (34290619 bytes/sec)

That last error message is actually okay. The last block written was a short block because there wasn't a full 128MB block to copy. No worries.

Now you've got a bit-wise perfect clone of your Macintosh HD drive. Reboot your system using the Macintosh HD drive and enjoy your clone!

Edit: To address a slowness comment made by @Gordon Davisson in his answer, there's some anecdotal evidence out there that using rdisk# instead of disk# can make dd a whole lot faster. I haven't tried it though. So your dd call would be:

> sudo dd if=/dev/rdisk0 of=/dev/rdisk2 bs=128m conv=noerror,sync

in the above example.

share|improve this answer
+1 great answer – binarybob Mar 27 '12 at 19:49
rdisk# bypasses a 4KB OS buffer. More info. I'd advise that you chose a smaller bs, as going above 1m actually makes it slower. (At least over USB. I can't tell if it's an external USB drive or a direct SATA connection.) – Nick ODell Dec 27 '12 at 22:18
It may be worth experimenting a bit with the bs setting. I got significant increases in throughput (almost double) by decreasing the size from bs=1m to bs=65536. – Jens Wegar Aug 9 '14 at 14:20
@JensWegar I wonder if there's a way to know the best block size to give dd for a given transfer without having to resort to trusting internet searches or doing trail-and-error runs? – Ian C. Aug 9 '14 at 16:32
@IanC. I read somewhere that the block size of the HDD could be used as an indicator of the ideal size to give dd. On the other hand another source said there is no bullet proof way of figuring out the optimal size. So can't give any real advice there. However, it didn't take too long to experiment. Probably the ideal value is a factor of 2, so I'd start with 4096, then 8192, 16384 and so on. You'll find the peak pretty quickly this way. – Jens Wegar Aug 11 '14 at 15:53

Disk Utility can do volume-to-volume cloning with the Restore tab. Between two Mac OS Extended volumes, this'll do a block copy, i.e. it just copies the volume structures, so all the files come out identical (down to the file ID numbers). This is essentially the same thing dd does, except that Disk Utility can expand/contract the volume if the destination isn't exactly the same size as the source, and it's a lot faster (for some reason, dd is quite slow on OS X).

EDIT: After seeing @Ian's note about speed using /dev/rdiskN vs. /dev/diskN, I ran some quick&dirty benchmarks copying between two 4GB flash drives:

dd using /dev/diskN: 2737 seconds
dd using /dev/rdiskN: 907 seconds
Disk Util, full volume: 840 seconds to copy + 213 seconds to verify
Disk Util, empty volume: 4 seconds to copy + 1 second to verify

So it looks like the rdisk suggestion makes dd run about the same speed as Disk Utility; the real differences are that Disk Utility verifies its data (slower, but maybe safer) and skips blank space (faster if the disk isn't nearly full). That, and as I said above DU can resize as it copies.

share|improve this answer
The Disk Utility for OS X is documented at…. – KatieK Mar 27 '12 at 18:30

Apple's bespoke command line utility to do disk cloning is asr.

It is tailored to the specifics of OS X needs to perform file by file as well as block based imaging and deals with differences in partition sizes, allows network streaming (and even multicast streaming) as well as copying between disks that are locally connected. Unlike dd, it knows about Apple's latest Core Storage volume management and is the program that the graphical Disk Utility calls to move data from one partition or volume to another.

You can read more at the manual page for asr.

share|improve this answer
Note that asr is the same tool that Disk Utility's Restore tab uses (see my answer). The command-line interface has additional options that the GUI interface omits, such as converting between HFS+ (case insensitive) and HFSX (case sensitive) formats, and putting the copy in a Core Storage volume group. But it may be harder to use for people who aren't used to the command line. – Gordon Davisson Jan 26 '14 at 18:45

Carbon copy cloner was good, but then on my Mac Pro it no longer made bootable clones, I tried it 3 times and every clone failed to boot unlike previously. So I switched to SuperDuper! and that clone booted fine

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

How about good ol' fashioned dd. It can make a bit-by-bit copy of your drive. There are lots of guides out there on how to do this such as this one or this one

share|improve this answer
Answers on Ask Different need to be more than just a link. It's okay to include a link, but please summarize or excerpt it in the answer. The idea is to make the answer stand alone. – patrix Sep 30 '13 at 12:41

There are two types of cloning Mac drive. File level and block level based cloning. As we know carbon copy cloner can create file level based clone only and its one of the big competitor Superduper can create clone of volumes and partition only not the whole disk. So, I will suggest to go for a new emerging Mac cloning software that is Stellar Drive Clone capable to both file level and block level cloning.

It can create bit by bit exact copy of your entire drive and particular volumes on your any external drive, volume and network drive too. It can create clone of drive on folder and restore backups from the same in its free demo version feature. It can create clone of recovery HD and support window file formats, MBR, ExFAT, FAT32 etc on your Mac.

share|improve this answer
As written your answer isn't much more than a list of product features but without any explanation about how the mentioned tool can solve the problem the OP has. Can you please make your answer more useful by describing the necessary steps in more detail (and maybe also explaining which benefits this method has compared to the ones described in the other answers)? – patrix Sep 30 '13 at 12:41

protected by Community Jul 21 '14 at 12:52

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.