There are really 2 types of backups.
Image-based backups can make for easier restores, assuming the exact same hardware will be used on the restore-side. With raspberry-pi systems, that is NOT unreasonable. Images are huge and require a 1-for-1 amount of storage. If you need 2 copies, then you need 2x the storage. 3 copies = 3x the storage. Additionally, creating images requires downtime. It is not safe to make an image backup of a running Unix system. Probably 95% of the time, it will work fine, but that other 5% it will not. Consider yourself warned. That means to make an image, you’ll need some other equipment and a different OS which can be booted. For a beginner, I doubt talking them through this is possible.
There are 2 types of OSMC systems.
- Those with all the media locally connected and
- those with no media directly loaded, so the Pi/Vero only needs configuration information
By setting up the first OSMC so that media is separate from the OS, on different storage, you can remove many complexities and huge file backups. This effectively makes it the same as the second type of OSMC where all the media is on different devices on the network.
Pretty much all the OSMC configuration data is stored in ~osmc/.kodi/ … so backing that up is really the only necessary thing IME.
Let’s look at an OSMC system:
$ df -hT -x squashfs -x tmpfs -x devtmpfs
Filesystem Type Size Used Avail Use% Mounted on
/dev/mmcblk0p2 ext4 30G 5.1G 23G 19% /
/dev/mmcblk0p1 vfat 240M 40M 200M 17% /boot
This has a 32G microSD for storage and all the media is on the network, not local.
$ du -sh /home/osmc/
3.8G /home/osmc/
So of the 5.1G used by the OS and OSMC, 3.8G are for OSMC. I keep downloaded addons in the HOME for the osmc userid, also called HOME or ~/. However, really all the kodi settings are in ~/.kodi/ … which is 3.8G in my system. I just looked. The non-Kodi stuff is just a few MB, not really important.
By backing up just the HOME (i.e. /home/osmc/ ), I’ll effectively get 99% of what is needed. There are some files in /etc/ and /boot/ that would be very helpful, especially if the Raspberry Pi has mpeg2 or h.264 decoding driver licenses, but it isn’t really “mandatory.” In /etc/ the main things to get are any extra fstab entries, but most people wouldn’t mount remote storage using that as kodi has a serviceable GUI.
In /boot/, these files could be locally modified:
/boot/cmdline.txt
/boot/config.txt
/boot and /etc/ are pretty tiny, so I’d just grab everything.
So, a minimal backup would get /boot/, /etc/, and /home/.
OS/Settings Restore - that’s a little harder. Basically, I’d just provide the remote people with 2 microSD cards, setup identically, so all they need to do is swap in the alternate card and reboot, then connect the backup and call me on the phone/jitsi/whatever for help. Ideally, I’d ssh into the system, see the backup storage media, selectively copy a few files from /etc/ and /boot/, then copy everything from /home/osmc/ onto the fresh drive.
The backup storage would likely be using a USB3-to-microSD adapter. Good, fast, ones are $10 or less. I just picked up one a few weeks ago with a USB3.1 interface which writes and reads data as fast as any microSD can handle.
Notice, I’ve completely ignored media files. In my world, those are on an NFS server running Ubuntu headless and backups are simple 1-copy rsync run a few times weekly. Something like this:
ionice rsync -av --stats --progress $EXCLUDES --delete /d/D1/ /d/b-D1/
That is fine for huge files that I simply can’t afford to have more than 2 copies due to sizes.
It is not sufficient for the OS or /home/osmc/ backups. Those really should be versioned and have perhaps 1 backup each week. rsnapshot is a reasonable tool for making versioned backups. The target storage must use a Linux file system, no FAT-whatever or NTFS. EXT4 would be a good choice. A few how-to articles for rsnapshot:
https://www.cyberciti.biz/faq/linux-unix-apple-osx-bsd-rsync-copy-hard-links/
Just configure /boot/, /etc/ and /home/ for the weekly backups and perhaps 5 versions.
Why not backup the OS and all updates? There’s no need. Just install the current minimal, core OS, then a simple patching round will bring the OS back to current. Once every quarter or every 6 months, the remote admin would want to snail-mail 2 microSD cards with updated OS. If media isn’t placed onto that storage, an 8G would be fine. After all, I’m using less than 6G total. If you go crazy, 16G microSD would be fine too, if you can find them. In the last few months, I’ve picked up high-endurance 32G and 64G microSD cards for Pi projects. These were $8 and $12 each. If you are charging for this support service, just bill for new SD storage too.