Skip to content

Instantly share code, notes, and snippets.

@peterschwarz
Last active April 20, 2021 18:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterschwarz/8412469 to your computer and use it in GitHub Desktop.
Save peterschwarz/8412469 to your computer and use it in GitHub Desktop.
Backup and restore a raspberry pi

Mac Backup your Raspberry Pi

Given a Raspberry Pi with Rasbian, you'll need to backup your sdk every now and then.

(courtesy of @nickbauman)

Backup remotely

Requires public key exchange for pi account:

ssh pi@raspberry sudo dd if=/dev/mmcblk0 | gzip -c > raspberry.img.gz

Recover

Requires locally mounted disk device rdisk1:

gzip -dc /path/to/raspberry.img.gz | sudo dd of=/dev/rdisk1 bs=1m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment