This isn't an OctoPrint-specific question, but I bet some users here have run into this, and might have some suggestions. I'm doing some development related to OctoPrint. I have an installation of OctoPi running OctoPrint, and some additional configurations set. I'd like to make a backup/clone of the SD card so that, if the system becomes unstable, or I'd just like a fresh copy to test against, I can re-apply the backup.
I'm running OSX and I've tried creating a backup image of my OctoPi SD card using balenaEtcher, Carbon Copy Cloner, and Apple's Disk Util, but nothing seems to work. For example, when I use Disk Util to create an image of the SD card, the image is created, but when I try to restore onto another SD card (the same brand and same size even) I get "Error 22 - Invalid Argument".
I've tried creating a backup image and then restoring several times, with several different applications, but nothing is working end-to-end so far, and I was wondering 1) how are the restore/install images for OctoPi made? and 2) if anyone has a recommended way (and preferably with instructions) for creating a backup image.
The advantage of having this second microSD card available on the RPi is I can mount the partitions and copy individual files or directories from one OS instance to another.
I like the simple answers left here but they didn't help me as a noom, I have no idea as to how to use rpi clone. BUT I find a wonderful post that looks complex, but is the easiest and best way I have found to make a rliable and easy to verfy backup of my Rbpi. It also includes instructions on how to automatically make backups periodically.