How to backup and restore SD card image on MacOS
Sometimes you want to create a backup of SD card on MacOS, for example I have a Raspberry Pi which I use to run Pi-Hole or Retropie. It’s easy to do without any extra software.
Connect SD to a computer and open Terminal
Navigate to Applications > Utilities > Terminal.
Find your SD card name
Enter the following command to find a disk name:
diskutil list
For example my SD disk is /dev/disk2
Create a backup of SD card
Using dd utility create a backup:
sudo dd if=/dev/disk2 of=PiBackup.dmg
Enter your password and wait for some time until a backup is created.
Eject the disk
Safetly eject the disk via Finder.
Restore a backup to SD card
To restore a backup insert a SD card, find it’s name via diskutil list and run the commands:
diskutil unmountDisk /dev/disk2
sudo dd if=PiBackup.dmg of=/dev/disk2
Enter the password and wait for some time until an image is copied to the disk.
April 6, 2023 ∙
how-to