How to restore from an omv-backup?

  • Hi all,This thread is where I get pointed to for help on restoring a backup made with the backup addon. However nowhere in this thread (or anywhere else for that matter) discusses how to restore a fulldisk-dd backup. This is subtly different from the method described here for a dd backup restore. So if you have created a backup which ends in .ddfull.gz you need to approach things slightly differently.
    If you use the method described in the first page of this thread for dd restore you will get a corrupted partition and the dd operation will run out of space and fail to complete. This is because ddfull.gz backups are dd's of the whole physical disk including all partitions and that includes the EFI boot partition.

    The procedure for restoring is almost the same but differs in the restore instruction used.
    - boot into a recovery live boot linux system

    - identify where you have saved your backups. If your live system automounts the backup directory navigate into the directory. If it doesn't then mount your backup disk by issuing commands mkdir /mnt/backup and then mount the backup folder into that directory mount /dev/sdxx /mnt/backup , again navigate to the exact backup folder.
    - issue restore command sudo gunzip -c backup-omv-xx-xxx-xxxx_xx-xx-xx.ddfull.gz | sudo dd of=/dev/sdx bs=1M status=progress the important thing to note is that you are using the disks whole disk identifier (ie sda) rather than a partition identifier (ie sda2)

    Hope that helps if you get stuck like I did.

  • Hi All,

    I hope I am posting this in the right place.


    I have a OMV 5 on RPi4 running from a 16G SD card.

    I have taken boot drive backup using dd full disk backup multiple times on ext4 drive attached to Rpi. I copied the backup files onto my windows 10 laptop as my primary laptop for office is Windows.


    Due to some errors on my part which I am not able to undo myself, I decided to restore my backup. Now I read, I only need to use the .gz file and use usbimager. I am now using a new 32G SD card for this restore. I am however not able to boot after writing the .gz file onto this SD card.


    I am doing the restore from my windows 10 laptop. Is this the issue? Do I need a linux system only to do this restore? Please guide.

  • I am however not able to boot after writing the .gz file onto this SD card.

    dd is so powerful because it does a block-by-block copy, regardless of the filesystem types or operating systems. It looks like you packed the resulting file with gzip afterwards (therefore the .gz ending). To restore, you need to unpack your image again and copy it block-by-block to the sd card. So your restore command depends on the way how you have done the backup.

    You could use a linux live cd and use the dd command like

    Code
    gunzip -c /path/to/backup.img.gz | dd of=/dev/yoursdcard


    If you want to use windows, there are reports, that this can be done with rufus: https://rufus.ie/

    You might need to unpack your gzip before (for example with 7zip) and then write the image to the sdcard.

  • It looks like you packed the resulting file with gzip afterwards (therefore the .gz ending).

    Thanks for replying. I used the Backup plugin within OMV Web UI and created the backup. The .gz extension was done by the plugin itself.



    If you want to use windows, there are reports, that this can be done with rufus: https://rufus.ie/

    I have not tried rufus. Although while searching for the solution to restore this backup I came across USBImager tool (https://gitlab.com/bztsrc/usbimager) which uses .gz as file extension to copy to SD card. Since this tool is available in Windows, I used that.


    Using USBImager, the copy process completes successfully and I can see the partitions created in the new SD card. But it does not boot when inserted into Rpi. I also used my previous 2 backups but with same result. I am pretty sure my backups are not corrupted as I have them stored in two different systems and both have not worked.

    Code
    gunzip -c /path/to/backup.img.gz | dd of=/dev/yoursdcard

    Since I dont have a linux system, I am now planning to install a VM Image and try this command. Will update. Thanks :)

  • Well,

    It seems USBImager on windows is messing the restore as the same backup on the same SD card worked when I created the Linux VM and used the gunzip command piped to dd.


    The exact command i used was :

    Code
    gunzip -c backup-omv-13-Dec-2020_12-23-28.ddfull.gz | sudo dd of=/dev/sdb bs=1M status=progress

    Now my backup is restored and can boot from my Rpi...

    Thanks much !!!

  • Its a good idea to create a restore system on you OS disk which can then be accessed via the GRUB menu if you make your main system unbootable.
    This is setup using OMV-extras and the Kernel tab where you install the SystemRescueCD.

    Once done if you ever corrupt you main OMV partition this rescue system is available through GRUB to boot into and perform your dd restore operation. This means that there is always a Linux native system on the OMV box to easily recover your OMV system without recourse to other computers.

    Shoog

  • Having systemrescuecd installed is a good idea, but so is also having it on a bootable thumb drive. If the OMV partition itself gets smashed the installed version will be unreachable.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Boot systemrescuecd - if you installed the iso from omv-extras, it will be in your grub menu.

    For SBCs the correct approach is to create a new boot drive using the current up-to-date image, right?

    omv 6.9.6-2 (Shaitan) on RPi CM4/4GB with 64bit Kernel 6.1.21-v8+

    2x 6TB 3.5'' HDDs (CMR) formatted with ext4 via 2port PCIe SATA card with ASM1061R chipset providing hardware supported RAID1


    omv 6.9.3-1 (Shaitan) on RPi4/4GB with 32bit Kernel 5.10.63 and WittyPi 3 V2 RTC HAT

    2x 3TB 3.5'' HDDs (CMR) formatted with ext4 in Icy Box IB-RD3662-C31 / hardware supported RAID1

    For Read/Write performance of SMB shares hosted on this hardware see forum here

  • I'm hoping someone can help me here. I've tried reading through all the documentation and tips here but still a bit confused on how fsarchiver works with restoring.


    What I want to do is clone my drive using the fsarchiver backup I've created. My current drive is spitting out a lot of errors and I don't want to continue using it. I have the .fsa file ready to go, but going through the documentation and checking the file, it seems to only include the 1 partition sda1 and not the other 2 I see which include the swap partition. This leads me to believe I won't be getting an exact one-to-one match if I only restore the omv fsarchiver backup.


    I'm thinking, do I need to install OMV on my new SSD first (to get all the right partitions setup)? Then restore only the systems partition using the .fsa file I have (using the instructions on the first page)? Just wondering if in the future, if the main drive ever dies and I only have access to .fsa files, is this the best way to do it?

    • Offizieller Beitrag

    What is the output of


    fsarchiver archinfo <name of archive.fsa>


    That will tell you what is in the archive (how many partitions, which filesystem, which size etc.)


    Have you seen this (first post is a how-to):

    How to restore OMV 4.X from backup-plugin to system SSD

  • Thank you for that link! Bookmarked. It pretty much answered my question. Looks like I need to dd the .grubparts first, then I should be able to restore as normal.

  • Once done if you ever corrupt you main OMV partition this rescue system is available through GRUB to boot into and perform your dd restore operation. This means that there is always a Linux native system on the OMV box to easily recover your OMV system without recourse to other computers.

    This seems like a good approach for systems that have monitor - keyboard attached. For SBCs running headless, I would guess having a separate up-to-date boot image on a different SD card / USB device is the way to go.

  • @ryecoaaron could you please comment on the correct approach for SBC?

    having a separate up-to-date boot image on a different SD card / USB device is the way to go.

    or (if no up-to-data copy of the specifically used boot image before a defect is available)

    create a new boot drive using the current up-to-date image from a download site

    omv 6.9.6-2 (Shaitan) on RPi CM4/4GB with 64bit Kernel 6.1.21-v8+

    2x 6TB 3.5'' HDDs (CMR) formatted with ext4 via 2port PCIe SATA card with ASM1061R chipset providing hardware supported RAID1


    omv 6.9.3-1 (Shaitan) on RPi4/4GB with 32bit Kernel 5.10.63 and WittyPi 3 V2 RTC HAT

    2x 3TB 3.5'' HDDs (CMR) formatted with ext4 in Icy Box IB-RD3662-C31 / hardware supported RAID1

    For Read/Write performance of SMB shares hosted on this hardware see forum here

    • Offizieller Beitrag

    could you please comment on the correct approach for SBC?

    The backup plugin was original written with amd64/i386 systems that can boot a rescue disk in mind. sbc can't do that.


    So, I think it is better to shut the system down, put the sd card back in the system you wrote it with, and take an image on the sd card.


    If you want to use the backup plugin, you need to either sync the files to another system or unplug the data drive and plug it in the system that wrote the sd card. If you are using Windows (yuck), then boot the linux rescue cd on the windows system to do the restore.

    omv 7.1.0-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.5 | scripts 7.0.7


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Here is a basic restore procedure using fsarchiver for the same hard drive but a change went bad:

    • Boot systemrescuecd - if you installed the iso from omv-extras, it will be in your grub menu.
    • Mount your data drive - example: mount /dev/sde1 /mnt/backup
    • Figure out where your backup file is. fsarchiver uses the .fsa extension - example: /mnt/backup/omvbackup/backup-omv-07-May-2018_10-36-31.fsa
    • Figure out what your OS drive root partiton is. Don't get this wrong! - example: /dev/sda1
    • Restore the files - example fsarchiver restfs /mnt/backup/omvbackup/backup-omv-07-May-2018_10-36-31.fsa dest=/dev/sda1
    • reboot

    Here is a basic restore procedure using dd for the same hard drive but a change went bad:

    • Boot systemrescuecd - if you installed the iso from omv-extras, it will be in your grub menu.
    • Mount your data drive - example: mount /dev/sde1 /mnt/backup
    • Figure out where your backup file is. dd uses the .dd.gz extension - example: /mnt/backup/omvbackup/backup-omv-07-May-2018_10-36-31.dd.gz
    • Figure out what your OS drive root partiton is. Don't get this wrong! - example: /dev/sda1
    • Restore the files - example gunzip -c /mnt/backup/omvbackup/backup-omv-07-May-2018_10-36-31.dd.gz | dd of=/dev/sda1 bs=1M status=progress
    • reboot

    Sorry for bother you, but could you tell me is it the same instruction with OMV5?

    I have backup dd type and can not login to system at all Need help, can not login to system see "Reboot and Select proper device" after change case


    Does this restore flow help me?

    • Offizieller Beitrag

    could you tell me is it the same instruction with OMV5?

    Yes it is. There is a better how to - How to restore OMV 4.X from backup-plugin to system SSD

    omv 7.1.0-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.5 | scripts 7.0.7


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    Is it possible to restore only grub part? For example if I even can not login, that something is happened with grub, how can I restore only grub?

    Sure but it might be easier to boot a Debian ISO and select the repair option. Otherwise, there are grub repair images out there like super grub repair.

    omv 7.1.0-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.5 | scripts 7.0.7


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!