How Too Peripherals Python Tutorials

Backup/Restore SD card to/from image

Post Reply
raspberrypi / howtoo     Views: 657Prev .. Next
Backup/Restore SD card to/from imagePosted: Wednesday, February 15, 2017 [15:23:34] - 1
rootPosted by:rootMember Since:
June 16 2010
Posts: 356
On Mac OS X:
In terminal:
View Codediskutil list

you will see similar to the this:
View Code/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 499.8 GB disk0s2
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *41.9 MB disk1
1: Apple_partition_map 32.3 KB disk1s1
2: Apple_HFS data 41.9 MB disk1s2
/dev/disk3
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *15.7 GB disk3
1: Windows_FAT_32 NO NAME 15.7 GB disk3s1


To backup your SD card use DD command:
View Codesudo dd if=/dev/rdiskX of=/path/to/image bs=1m

where /dev/rdiskX is the disk name copied from the screen before (/dev/disk3 in our case).
Process may take a long time depending on SD card size and connection speed of the media where backup image is stored.There's no place like ~
RE: Backup/Restore SD card to/from imagePosted: Wednesday, February 15, 2017 [15:35:00] - 2
rootPosted by:rootMember Since:
June 16 2010
Posts: 356
Restoring on Mac OS X is just as easy.
Use the same "diskutil list" to identify the mounted SD card.
Unmount the SD card (important!):
View Codediskutil unmountDisk /dev/diskX

Format SD card, process is fast and ensures clean restore:
View Codesudo newfs_msdos -F 16 /dev/diskX

where "/dev/diskX" is the Disk name taken from "diskutil list".

Once SD card is formatted, image can be restored from the image using DD program:
View Codesudo dd bs=1m if=/path/to/image of=/dev/rdiskX

"if" - input file
"of" - output file
Restore process can take a long time as well.There's no place like ~
raspberrypi / howtooPrev .. Next
 
Post Reply
Home - Raspberrypi: How Too Peripherals Python Tutorials
Our Telegram Group