0

I have been using a desktop version of Pi OS - Bullseye on my Pi Zero 2 and I think it's a good time to try headless as I am getting used to controlling my pi through SSH. I am planning to use Pi OS Lite Bullseye (64bit).

My question is how to back up the headless OS. For the desktop version, it's pretty much just one-click copy and done.

Surprisingly there is not much information about how to easily copy the sd card. It looks like the Windows pi imager does not have the functionality which would be very useful though.

If you have done a headless sd card backup (clone), could you guide me on how to do it in a terminal or any easy/secure method? Any reference would be very useful as well.

Thanks!

  • This should help; I use this on all of my RPi. Very solid, and straightforward to use IMHO: [image-backup](https://raspberrypi.stackexchange.com/a/120154/83790) – Seamus Apr 18 '22 at 05:07
  • Do you have access to the pi and can you remove the card? It's possible to just read back an image from the SD card. Unfortunately, you can't use the Raspberry Pi imager to do that (since it can't read back an image) but other tools can. – PMF Apr 18 '22 at 15:08
  • @PMF Yes, I can remove the card. Could you elaborate on what you mean by just reading back an image? It would be nice to have a Windows tool so that I can quickly make many copied SD cards. – mqmarathon Apr 23 '22 at 20:30
  • @mqmarathon Search for "Windows disk imager". These work very similar to the Raspberry Pi imager, except that they can also be used to read a disk and create a backup file. Make sure you verify the image. I just saw some instances of broken (and hence worthless) backup files. – PMF Apr 23 '22 at 20:46
  • @Seamus Tried this and it worked! Thanks! For anyone who tries this method, this takes a long to make an image and doesn't have any progress indicator. So be patient. In my case, I checked if 'image-backup' is still running and also constantly checked if the exporting image size is increasing in the targeted USB directory. This somehow halted or corrupted the process. The image didn't work and I had to do it again. Wait until you see an option for an image size optimization. – mqmarathon Apr 24 '22 at 13:14
  • @PMF Thanks! I will try. – mqmarathon Apr 24 '22 at 13:14
  • @mqmarathon: `"this takes a long [time] to make an image"`. Not in my experience; perhaps you're backing up to a slow thumb drive - or have the "jumbo" image that includes everything? As a *relative* comparison for backup time, try a backup using `dd` :) Also consider the fact that after the original image is created, updating the image to capture changes to your system is easily automated (e.g. `cron` or `systemd`), the updates are (in my case) typically less than 60 seconds to a NAS drive. – Seamus Apr 24 '22 at 20:37
  • @mqmarathon: Just noticed your Question has no answer! That's a shame... I have a suggestion for you: Now that you've been through the process, why not answer your own question? You can add the details and comments you think appropriate, and you'll be helping others. And you may have to wait a couple of days, but you can 'Accept' your own answer (but can't upvote it). – Seamus Apr 24 '22 at 21:00

0 Answers0