Backup Raspi 4 micro sd card image (my take), better solutions?

  • 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 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 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

    * 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:

    * Mac:

    * 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.

    Enjoy :)

    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.


  • But it seemed to just backup the root mount. I would like to backup the whole sd card for my pi.

    It has a "dd full disc" option now. The image is gzip'd and can be restored by usbimager as suggested by macom.

    omv 6.0.8-1 Shaitan | 64 bit | 5.15 proxmox kernel | omvextrasorg 6.0.5 | kvm plugin 6.0.3 plugins source code and issue tracker - github

    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Hi, here is my update.

    I did a dd full disk backup and it created a 2.5gb ddfull.gz file in about 30 mins for a 32gb sd card.

    Below were what I tried to use the ddfull.gz file to write to a new sd card. So close, but still not perfect.

    1. usbimager, showed 1.2gb in the progress bar when writing to sd card and took 2 mins. ->not able to ssh into the server and not able to see the omv ui nor my docker containers.

    2. balenaEtcher, shows 1.4gb when imported the .gz file. Took forever to write, stuck at 99% for too long so I aborted.

    3. Decompressed the .gz file, resulted in a 30gb .ddfull file.

    Used usbimager to write to the sd card, It showed 30gb in the progress bar and took 42mins. Was able to ssh to the server, omv booted, docker worked. But when I tried do apt update, was getting below errors.

    Err:22 buster-backports/main armhf Packages
    Could not open file /var/lib/apt/lists/partial/deb.debian.org_debian_dists_buster-backports_main_binary-armhf_Packages.xz - open (117: Structure needs cleaning) [IP: 80]
    Ign:26 usul/main armhf Packages
    Err:26 usul/main armhf Packages
    Could not open file /var/lib/apt/lists/partial/packages.openmediavault.org_public_dists_usul_main_binary-armhf_Packages.gz - open (117: Structure needs cleaning) [IP: 80]

    4. So I switched back to the original working one that I got from win32imager and pishrink. (apt update no problem)

    Thus I have 2 questions:

    1. Why would those 2 apps shows around 1.4gb for the image , it is almost half size of the compressed file. Shouldn't it show the decompressed size like 30gb?

    2. Does the error from above indicate some file system corruption when I wrote it from the decompressed .ddfull file?

    Thanks so much again for checking on it.

  • This happened to my Raspberry pi running OMV where my sd card got corrupted or something. At first I can't go to the OMV console and I have to constantly reboot my raspberry pi 4 to get it up and running. Fortunately, when I set up my raspberry pi, I used dd to backup my sd card and then used pi shrink. I was lucky enough to get a shrunk img file from a backup and copied it to my computer.

    I originally installed an 16gb sd card from Microcenter shrink to about 3.7gb img file. Then I figured that I used a "reliable" 8gb samsung sd card to dump the image and then used the raspi-config tool to expand it. It is a good thing when I moved all the dockers into the hard drive instead of the sd card otherwise it will be more of a pain

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!