Greeting OMV folks,
These are my steps to completely backup raspi 4 micro SD card without worrying about what is needed or what is not.
In my opinion, it is more robust and Linux noob friendly.
It will backup everything in the sd card for easy future restore with balenaEtcher to a new sd card.
I choose this sd card -> Lexar high performance 633x microSDHC UHS-1 V10 A1 U1 from EC's video https://youtu.be/YUResed38uo for it's high iops which is great for SBCs.
Linux/Mac(either one), Windows machine, external hard drive/usb, new micro sd card.
1. Make sure all processes running are stateless, or it would need to be stopped before backup.
* Most of my processes are running in docker, where the app configs are mounted in an external hard drive which is also my drive for smb.
* Reason is that once everything are restored from backup, all the apps can start within no time.
2. Shutdown Pi and pull out the micro sd card.
* I tried https://github.com/lzkelley/bkup_rpimage to backup while pi is running. After restore, all docker containers are coming back up and running. But only omv5 is not working. Didn't spend enough time to figure out why.
* Although I want to leave the sd card in my Pi while doing backup. Right now it doesn't seem to work without looking at the above script to check which part/mount is not backed up for omv5.
* I did check out dd and using fsarchiver provided by omv-extra. But it seemed to just backup the root mount. I would like to backup the whole sd card for my pi. Will do more research later regarding dd, fsarchiver and rsync.
* Tried clonezilla but it doesn't seem to support raspi.
3. Plug the micro SD card in a windows machine and use Win32DiskImager to make an image out of the micro sd card
* I used an external ssd to store the image for step 4 & 5 since a linux/mac machine is needed.
* Download from https://sourceforge.net/projects/win32diskimager/
* Choose a location to store the image and the name of image under Image File section.
* Choose the correct device drive to your micro sd card.
* Click Read to create the image. This will take sometime.
* Click Verify Only to make sure no corrupted data introduced during the image creation. This will also take sometime.
4. Use PiShrink to shrink the image to a much smaller size (Highly recommended)
* Easier to transfer and store with smaller size.
* Different brand sd cards might have different sizes even-though they stated same capacity, it will cause problem if the image is slightly larger than the new sd card.
5. Links to use PiShrink
* Linux: https://github.com/Drewsif/PiShrink
* Windows: didn't find anything for windows. (WSL doesn't work with PiShrink)
1. Use balenaEtcher to write the image to the new sd card.
2. Plug in the new sd card to the Pi. Power on and let it start.
* ssh to the pi
* run sudo raspi-config
* go to option 7-Advanced Options
* choose option A1 to expand the file system to make use of all the available space of the sd card, otherwise the mount would be the size of the image.
P.S. It may take sometime to backup and restore, also it will have some downtime while creating the backup image and it may sound stupid that I backup things unnecessary. But it gives me peace of mind that I have everything backed up and all I need is a cheap 6 dollar micro sd card if things ever go wrong. I don't need to spend time to figure out what went wrong and what to restore.
P.S.S I hope this might help newbies who can follow along like they are installing Raspbian. But any suggestion would be more than welcome. Like how to make a backup image while the system is running. I would like to put this as a how-to in the guides section if I can get it updated with better ideas.