Skip to content

Instantly share code, notes, and snippets.

@mariotpc
Last active March 29, 2021 17:16
Show Gist options
  • Save mariotpc/944b49ee602330e654a062beb5784dba to your computer and use it in GitHub Desktop.
Save mariotpc/944b49ee602330e654a062beb5784dba to your computer and use it in GitHub Desktop.
Backup and Restore SD Card - Raspberry Pi
To Backup on SD card:
Code: Backup
sudo dd bs=4M if=/dev/sdb | gzip > /home/your_username/image`date +%d%m%y`.gz
This will compress the image using gzip.
To restore the backup on SD card:
Code: Restore
sudo gzip -dc /home/your_username/image.gz | dd bs=4M of=/dev/sdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment