Skip to content

Instantly share code, notes, and snippets.

@bachkukkik
Last active May 31, 2020 07:48
Show Gist options
  • Save bachkukkik/22918497c528e87e9e3e13fd2b29d3e3 to your computer and use it in GitHub Desktop.
Save bachkukkik/22918497c528e87e9e3e13fd2b29d3e3 to your computer and use it in GitHub Desktop.
MacOS Terminal for Backup and clone raspberry pi SD Card

Backup Procedure:

Check disk -> unmount disk -> Backup SD Card -> Eject

Clone Procedure:

Check disk -> unmount disk -> Format card -> unmount disk -> Clone SD Card -> Eject

MacOS Command Line

  • Check disk diskutil list

  • unmount disk sudo diskutil unmountDisk /dev/disk4

  • Format card sudo diskutil eraseDisk FAT32 SDCARD MBRFormat /dev/disk4

  • Backup SD Card sudo dd bs=4m if=/dev/disk4 | gzip > ~/Downloads/pi_kk_20200531.img.gz

  • Clone SD Card gunzip --stdout ~/Downloads/pi_kk_20200531.img.gz | sudo dd bs=4m of=/dev/disk4

  • Eject sudo diskutil eject /dev/disk4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment