Backup your PI SD Card

September 29, 2014 | By More

After customization the Raspberry Pi, you may want to take a backup of it so that in case the SD card gets corrupted, you can easily restore the image.

  • Plug the SD card into the Mac or card reader
  • In Terminal, execute diskutil list to find your SD card make note of the disk number (/dev/diskX)
  • Then execute the following command for a backup: sudo dd if=/dev/rdiskX bs=1m | gzip > /path/to/backup.img.gz
    Replace the X with your disk number that you found in the previous step. Note the ‘r’ in /dev/rdiskX is intentional to take advantage of better performance (see the blog post I linked for details).
  • For a restore, the command would be: gzip -dc /path/to/backup.img.gz | sudo dd of=/dev/rdiskX bs=1m

Of course there is an app for that too if you aren’t comfortable with the command line. Its called Apple-PI Baker and its available for download from here. It currently at version 1.6 at the time of writing this.

Comments below please.


Category: RaspberryPI

About the Author ()

Comments are closed.