First, you'll need to list your disks. Just use the following to see which /dev/diskN
node we're going to:
diskutil list
We'll need to unmount the disk to be cloned. We'll use the following command for that:
diskutil unmountDisk /dev/diskN
After 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,sync
Where 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 -l
instead ofdiskutil list
- Your device node should be located under
/dev/sda
, instead of/dev/disk
- Use
umount
instead ofdiskutil unmountDisk
to unmount any drives