Backup SD card
To clone an SD card setup for your Raspberry Pi on a Mac, do the following:
Input the SD card you want to clone. Open the Terminal window and type:
This will list your connected disks. See the name of your SD card, on mine in looks like this:
Make an image of the content with the following command:
sudo dd if=/dev/disk1 of=~/Desktop/boot.dmg
This might take a while and when it is finished you will see how many bytes were transferred.
Edject your SD card and input the SD card you want to clone to.
Format new SD card
If the SD card is not formatted you can open the Disk Utility and select the card(not the volumes) . Click on the “Erase”-tab and select the format “MS-DOS(FAT)”. Name your card and click on the button “Erase”. This will only take a few seconds. The SD card is now formatted in FAT32.
If you want to change the format to FAT16 just go to your Terminal window and type:
sudo newfs_msdos -F 16 /dev/disk1
Note that the name of the disk can be different. Run “diskutil list” again to find out.
Clone SD card
Now the SD card is prepared to get the cloned image. Unmount the volumes on the SD card before you go ahead with cloning. NOTE! That you should unmount and NOT eject.
To transfer the image you just made before you write in the Terminal window:
sudo dd if=~/Desktop/boot.dmg of=/dev/disk1
This can take long depending on the class of your SD card.
During the process you can to checks that the cloning is progressing. Open a new Terminal window and type:
This will list processes on your computer with “dd” as part of it. At the bottom of the list you will find something like this:
11502 s002 S+ 0:00.01 sudo dd if=~/Desktop/boot.dmg of=/dev/disk1 bs=5
11503 s002 R+ 0:58.27 dd if=~/Desktop/boot.dmg of=/dev/disk1 bs=5
11524 s003 R+ 0:00.00 grep dd
Note the id of the process and type:
sudo kill -s SIGINFO 11503
In the other window where you did your clone command, it will now print out how much data that has been transfered to your SD card in the format seen on success in the below example.
When the process is finished you will see how many bytes were tranfered and compare it with the bytes when you made the backup.
60392+1 records in
60392+0 records out
30920704 bytes transferred in 132.542963 secs (233288 bytes/sec)