Skip to content

Instantly share code, notes, and snippets.

@piuggi
Forked from jmsaavedra/rPi-SD-imaging.md
Created July 21, 2014 21:37
Show Gist options
  • Save piuggi/9364f88f2da67d86873a to your computer and use it in GitHub Desktop.
Save piuggi/9364f88f2da67d86873a to your computer and use it in GitHub Desktop.
#rPi IMAGE COPY AND RESTORE
#see all volumes mounted to machine
$ diskutil list
#locate your SD card
#change {N} your disk number
#unmount the disk you’re speaking to
$ diskutil unmountDisk /dev/disk{N}
#-------------------------------------
#>>> NEW SD CARD FORMAT AND FLASH EXISTING IMAGE <<<
#format the disk to fat 32
$ sudo newfs_msdos -F 32 /dev/disk{N}
#make sure you use the disk number with r in front (rawdisk)
#change the if path to the path of your image
$ sudo dd bs=1m if=/Users/Path/To/Existing/Image/rpi_image.dmg of=/dev/rdisk{N}
#-------------------------------------
#-------------------------------------
#>>> CREATING IMAGE OF EXISTING SD CARD <<<
$ sudo dd bs=1m if=/dev/rdisk{N} of=/Users/Desired/Path/To/Image/rpi_image_new.dmg
#-------------------------------------
#eject the disk
$ diskutil eject /dev/disk{N}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment