What's the best way to back up a . .?

Greetings!

As you all know, I am working on trying to find out why updating GoPiGo O/S causes the robot functions to (sometimes) fail.

My test methodology is, (should be :wink:), something like this:

  • Flash an image and boot it.
    • After first boot, create a backup.
  • Configure it.
    • Make another backup instance.
  • Do something else.
    • Create another backup.
  • And so on. . . .

This way I can, (theoretically), go back to any step along the way and try something else without having to recreate everything up to that instant in time.

Also, theoretically, if I have two instances that should be doing the same thing, (i.e. two fully updated instances), where one works and the other doesn’t, I can then compare the instances file-by-file to find out what is different.

What I am currently doing is this:

  1. I have an external SSD mounted on /home/pi/Project_Files/
  2. I have a directory there: /home/pi/Project_Files/GoPiGoOS_rsync_backups
  3. Inside that directory I have directories for individual backups and they contain a “boot” and “rootfs” directory.
    • For example:
/home/pi/Project_Files/GoPiGoOS_rsync_backups/first_boot/rootfs
/home/pi/Project_Files/GoPiGoOS_rsync_backups/configured/boot
/home/pi/Project_Files/GoPiGoOS_rsync_backups/configured/rootfs
[etc]

The way I do my backup is:

  1. Shut down.
  2. Remove the SD card from the 'bot.
  3. Boot something else
  4. Put the card in a caddy and plug it into a free USB port
  5. Execute `rsync -aAxXv [either the rootfs or boot partition on the SD card] [the rootfs or boot partition directory on the SSD]

Any ideas or suggestions?

2 Likes

RPi-clone is what I use, don’t have to shut down to make the backup

2 Likes

Unfortunately, that does the equivalent of a physical media clone to another physical media, completely overwriting it.  (i.e. Taking one SD card and creating another SD card that is a copy of it.)

What I want to do is take an accurate copy of the filesystem, including all attributes, permissions, links, magic, voodoo, and everything else that goes into making a filesystem a filesystem, and place that copy in a specified place, (directory), on another drive somewhere.

RPi-clone would end up destroying the target device because it would turn my 500 GB SSD into a gigantic image of the original SD card - destroying everything in its path - so obviously that won’t do.

2 Likes

I use Win32DiskImager to make back-up copies of my uSD cards into a Windows folder. I can then restore them with Balena Etcher.
/K

2 Likes

New thing that sounds like it might be “just what the doctor ordered” if you have enough space for a shrunk image of your system. I have not tried it yet, but wanted to document its existence somewhere for when I get brave:

1 Like