0

I have a Raspberry Pi 3B+ that I use for random tinkering projects.

What would be the correct way of backing up the entire "state" of the Pi, including any downloads, apps, scripts, settings, etc? Assume that only the SD card is used, not any other storage media.

The ideal outcome is that I can flash an entirely different project's image to the SD card, tinker with that, then go back to flashing the original SD card with all the settings / scripts / apps.

What's the best way to do this backup, and how do I flash the original file back to the SD card when I'm ready? Or is my only option simply buying an SD card for every "project"?

I'm currently using Raspbian but will probably use other OS's depending on the project I'm working on.

I found a similar question but that was asked 6 years ago, and was too advanced for me - I'm a beginner.

Pieter
  • 103
  • 2
  • "Assume that only the SD card is used, not any other storage media" so where do you intend to store this backup? – Milliways May 17 '20 at 09:43
  • Sorry, should have been more clear. What I meant was: assuming the current Pi system does not have any external storage that needs to be backed up. Only need to back up the SD card, for example on an external HDD or on my PC. – Pieter May 17 '20 at 10:11
  • 1
    Does this answer your question? [How to Backup/Shrink the image of my working Raspbian SD Card](https://raspberrypi.stackexchange.com/questions/103990/how-to-backup-shrink-the-image-of-my-working-raspbian-sd-card) – Milliways May 17 '20 at 10:32
  • I'm not sure, I'm not at all concerned with the size of the backup. I just want to be able to pick up an old project where I left off, including all settings etc, without needing separate SD cards for each project. – Pieter May 17 '20 at 10:40
  • it really depends - is it a windows PC? unfortunately etcher and the raspberry pi's flasher (the two most popular flashers on windows) don't have a read function like win32diskimager - for some reason that utility has fallen out of favour – Jaromanda X May 17 '20 at 11:43
  • I do have a Windows PC, but it doesn't have an SD card reader. My Mac does. Would that work with the solution you have in mind? – Pieter May 17 '20 at 12:44

2 Answers2

5

Best option is a complete clone of your SDCard as a bootable backup.

There's a tool in Raspbian to do that, all you need is a USB reader and a second SDCard that's the same size or bigger than your current SDCard.

SD Card Copier Tool

Dougie
  • 4,940
  • 7
  • 14
  • 27
3

@Dougie's answer will likely suit you best, but there are other solutions. One that has worked for me, and seems to have appeal for many others is called image-backup. Image-backup "creates a backup of a running Raspbian system to a standard 'raw' image file that can be written to an SD card". Here's why it might be better in some situations:

  • The backup is output to a file, not an SD card
  • It can do incremental backups (hourly, daily, on-demand, etc)
  • It does its backup job while the RPi is running

Note that it is invoked through the CLI, rather than the GUI.

Seamus
  • 18,728
  • 2
  • 27
  • 57
  • That sounds like it will do the job! I could try to have that backup made to an external network drive, so I don't have to mess around with multiple SD cards. Thanks! – Pieter May 18 '20 at 03:17