Skip to content

Instantly share code, notes, and snippets.

@lacymorrow
Last active August 25, 2018 01:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lacymorrow/96b5d110afc87860859e68f774615ff3 to your computer and use it in GitHub Desktop.
Save lacymorrow/96b5d110afc87860859e68f774615ff3 to your computer and use it in GitHub Desktop.
Clone SD image backup
> via https://raspberrypi.stackexchange.com/questions/311/how-do-i-backup-my-raspberry-pi
With gzip, to save a substantial amount of space:
sudo dd if=/dev/rdiskx bs=1m | gzip > /Users/tmorrow/Documents/rpi0-arch.gz
And, to copy the image back onto the SD:
gzip -dc /path/to/backup.gz | sudo dd of=/dev/rdiskx bs=1m
(using rdisk is preferable as its the raw device - quicker)
To find out which disk your device is type diskutil list at a command prompt - also, you may need to be root; to do this type sudo -s and enter your password when prompted.
http://elinux.org/RPi_Easy_SD_Card_Setup#Copying_an_image_to_the_SD_card_in_Mac.C2.A0OS.C2.A0X_.28command_line.29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment