Home Interests Raspberry Pi

How to Back Up and Restore Your Raspberry Pi SD Card on Mac

Easily backup, restore, or clone your SD card!
howchoo   (455)
September 20, 2023
6 minutes

Share

You'll Need 2

What you'll need
Interests
Howchoo is reader-supported. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.
Posted in these interests:

Mac

mac • 24 guides
pi • 92 guides

This short guide will show you how to create a backup image of your Raspberry Pi’s SD card on Mac (MacOS and OS X), as well as how to restore the image later. This approach will also work for cloning your SD card to another card.

Backing up a properly configured system is a good idea that will save you tons of time down the road.

Let’s get started!

1 – Connect the SD card to your computer

Use whatever SD card adapter you have to connect your SD card to your computer.

2 – Open Terminal

Navigate to Applications > Utilities > Terminal.

3 – Find your SD card name

Enter the following command to find your SD card’s name:

diskutil list

You can identify your card by size and partition type. You should see the Raspberry Pi boot partition type of Windows_FAT_32 next to the drive.

For example, my card’s name is /dev/disk2.

4 – Create a full SD card backup

Use the following command to use the dd utility to backup your Raspberry Pi SD card, changing /dev/disk1 to your disk’s name and path:

sudo dd if=/dev/disk1 of=~/PiSDCardBackup.dmg

Enter your password when prompted.

This will create a file named PiSDCardBackup.dmg in the user directory (~). To change the filename or put it somewhere else, you can change ~/PiSDCardBackup.dmg to something else. For example, ~/Documents/OctoPrint.dmg will name the file OctoPrint.dmg and place it in your Documents folder.

While the backup process is running, you should just see a flashing | indicator.

🛈 Depending on the size of the contents of your card, this may take a while! It took about an hour to create a backup of my full 32GB SD card.

5 – Safely eject your SD card

Don’t forget to safely eject your card before removing it from your computer to prevent data corruption. You can do this in Finder by clicking the eject icon in the sidebar. You’re all done!

6 – Restoring the SD card

To restore your backup or clone it onto another SD card, reinsert it into your computer and use the following commands:

diskutil unmountDisk /dev/disk1
sudo dd if=~/PiSDCardBackup.dmg of=/dev/disk1

Be sure to replace /dev/disk1 once again with your card ID, and specify the proper location for the backup image you’re restoring from.

When you’re finished, eject your SD card once more.

🛈 The card ID might have changed since reinserting the card; be sure to always check for the card ID each time you want to back up or restore a card.
NEXT UP

How to Enable the “Popping” Sound When Adjusting the Volume on Your Mac

howchoo
howchoo   (455)
December 13, 2023

Starting with MacOS Sierra and High Sierra, your Mac will no longer play a “pop” sound when you adjust your volume. If you prefer to have this sound when you adjust volume up and down (as I do), this guide will teach you how to reenable it. 1 – Open Sound System Preferences Navigate to System

Continue Reading

howchoo

 455 guides

Introducing Howchoo, an enigmatic author whose unique pen name reflects their boundless curiosity and limitless creativity. Mysterious and multifaceted, Howchoo has emerged as a captivating storyteller, leaving readers mesmerized by the uncharted realms they craft with their words. With an insatiable appetite for knowledge and a love for exploration, Howchoo's writing transcends conventional genres, blurring the lines between fantasy, science fiction, and the surreal. Their narratives are a kaleidoscope of ideas, weaving together intricate plots, unforgettable characters, and thought-provoking themes that challenge the boundaries of imagination.

Discover interesting things!

Explore Howchoo's most popular interests.

Explore