Skip to content

Instantly share code, notes, and snippets.

@maxpeterson
Last active December 26, 2015 14:49
Show Gist options
  • Select an option

  • Save maxpeterson/7168948 to your computer and use it in GitHub Desktop.

Select an option

Save maxpeterson/7168948 to your computer and use it in GitHub Desktop.
Backup raspberrypi card
  • Find the disk

diskutil list

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            319.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *4.0 GB     disk1
   1:                 DOS_FAT_32 NOOBSv1_3               4.0 GB     disk1s1
  • Backup the disk (dontforget to prefix sisk number with r)

sudo dd if=/dev/rdisk1 bs=1m | gzip > ~/Desktop/pi.img.gz

  • Restore the disk, if necessary unmount it sudo diskutil umount /dev/disk1s1

gzip -dc ~/Desktop/pi.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