First, you'll need to list your disks. Just use the following to see which /dev/diskN node we're going to:
diskutil listWe'll need to unmount the disk to be cloned. We'll use the following command for that:
diskutil unmountDisk /dev/diskNAfter unmounting all volumes, we're all set to start copying the contents of the disk:
sudo dd if=/dev/rdisk2 of=/dev/rdisk3.img bs=128m conv=noerror,syncWhere if stands for input file and of lists the desired output stream.
Also, notice the r leading each diskX name. This is supposedly done in order to improve speed up the whole process.
NOTE This process varies slightly if using any Linux distro or anything other than OS X:
- It's not necessary to unmount the drive before using
dd - Devices can be listed via
fdisk -linstead ofdiskutil list - Your device node should be located under
/dev/sda, instead of/dev/disk - Use
umountinstead ofdiskutil unmountDiskto unmount any drives