Raspberry PI: Restoring a Backed-Up SD Card from dd-Image

Verfasst von

in

,

In accordance to this great blogpost I’d like to add restoring the backup for the sake of completion. This one’s real quick so let’s get started.

A word of warning

In the following we will work with diskutil (I’m on a Mac). Please take good care when picking and handling a disk device using that tool as mistakes can lead to severe data losses. And as I’m just a guy on the internet that loves to share knowledge I cannot cover any problems and cannot grant any liabilities. I just wanted to – again – share my knowledge and things that worked for me. If you have doubts, please step back, contact a professional and let me know of your doubts and sorrows in the comments down below.

Restoring your backed-up Raspo-Image

Given we created 2026-10-11-raspo-backup.img (can highly recommend the date naming schema) and given a fresh card, do the following steps:

  1. Plug in your new shiny card into your laptop containing the backup image using the builtin or external card reader of your choice.
  2. Locate your card’s dev-path. Please be careful to pick the right one using for example the shown name and/or available space as indicators.
    >diskutil list

    For me it was /dev/disk3 so going forward I will use that path as the example. You use yours of course!
  3. Unmount it.
    >diskutil unmountDisk /dev/disk3
  4. Write the backup to your new card. We use the rdisk-path like we did in the awesome post linked above.
    >sudo dd if=/path/to2026-10-11-raspo-backup.img of=/dev/rdisk3 bs=4m status=progress
  5. Eject the new card.
    >diskutil eject /dev/disk3
  6. Plug it into your Raspo.
  7. Recommended: Plug your raspo to an external monitor.
  8. Hit the power button to boot.
  9. Check your Raspo-system. It should be running as expected from a cloned system.

In case you need it: Expand the new card’s file system

The reason I had to backup my Raspo was that I ran a way too small SD card for way too long. That had to cause disk space trouble eventually, but I didn’t reckon I reach that point that fast. But well… here we are. So I had to backup everything, buy a new card with more space and deploy my system there whilst carefully working around the lack of disk space on the current system. The method Tony described best fulfilled these requirements. Thank you very much!

After restoring my image as described above, I did the following to expand the file system on the card:

The steps

  1. Open the Raspo config TUI:
    >sudo raspi-config
  2. Navigate to „Advanced Options“ and hit Enter
  3. Navigate to „Expand Filesystem“ and hit Enter.
  4. Confirm further panels until raspi-config offers you a reboot.
  5. Hit yes here or hit no and reboot it whenever you feel like.
    I recommend doing it right here.
  6. After reboot use
    >df -h
    in the terminal to check your disk space. It should be on par with your new card.

Conclusion

Alright. That one wasn’t that hard at all I hope. At this point I’d like to thank Tony once more for his great blogpost that saved my bottoms during these dire times. Please take good care, always watch your steps when working with diskutil and enjoy your Raspo as like do – again.

As you might have seen I’m an avid Testautomation Engineer. So if you want to get to know my daily work, feel free to have a look here. Or if you’d rather continue working with Linux, I got you covered as well here, here and here.

Have a great week!

Share it with:

Kommentare

Schreibe einen Kommentar