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

  • Issue resolved. It ended up being that another SATA drive, connected to the same controller as the SAS drive, had a partition with the SAME UUID as the root partition I was restoring. This was the actual issue all along. I didn' t think it was an issue because the UUID on the USB stick matched as well, but I guess it didn't matter when booting to USB.

    In my first attempt to test the restore process, I was using this SATA drive. Grub was not restored / installed correctly on this SATA drive, after restoring the dd portion of the backup, which contains the MBR and partition table, so it was not bootable. I just ended up leaving the SATA drive as is was, after that first attempt, and then added the SAS drive, which I decided would be the permanent boot drive.

    When I eventually resolved the issue, I actually changed 2 things, so I didn't pinpoint the root cause.

    I booted to systemrescuecd and took an fsarchvier backup of the USB stick

    • I restored the new fsarchver backup to the SAS drive
    • I also cleared the partitions off that SATA drive before I rebooted.

    I initially thought there was an issue where something was not being backed up correctly, by using the backup plugin on the live running OS, and that instead running the backup from the liveCD resolved the issue. But that was not the case. I kind of knew in the back of my mind that the partition had been sitting on that SATA drive, but didn't think it was a problem because the partition UUID on the USB stick also matched, and it was not an issue booting from USB. But it did matter with the 2 hard disks matching, when trying to boot from hard disk. This explains why I could restore my original backups to another USB or a VM and boot without any issue. I reproduced this by simply restoring the dd portion of the backup to the sata drive again, which restores the partition table and UUID, without any data, and upon reboot, it reproduced the broken boot issue where boot halted at initramfs

    This is due to my somewhat noobness with linuxI will not make this mistake again!

  • Issue resolved. It ended up being that another SATA drive, connected to the same controller as the SAS drive, had a partition with the SAME UUID as the root partition I was restoring.

    This is what can happen when you bit for bit clone a drive and try to use both in the same machine.

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


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

    Edited once, last by gderf ().

  • Thanks for the guide, but i still seem to struggle. Sorry for the noob questions.....


    I have OMV 5.x and have it installed on 223 GB SSD and want it to replace it with 60 GB SSD because it is a bit of a overkill. I first tried it with Clonezilla but after several fails I gave up. (yes made sure that the partition fitted the 60 GB SSD).

    I used fsarchiver to backup OMV.


    When I restore the backup to the 60GB SSD drive it won't boot afterwards.


    This is the lsblk output from my 223 GB SSD drive:


    Code
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda      8:0    0 223.6G  0 disk
    |-sda1   8:1    0    41G  0 part /
    |-sda2   8:2    0     1K  0 part
    `-sda5   8:5    0    12G  0 part
    sdb      8:16   0   1.8T  0 disk
    `-sdb1   8:17   0   1.8T  0 part /srv/dev-disk-by-label-media

    So what did I do:


    I installed using a USB Stick OMV 5.x on the new clean 60 GB drive. Started it up and installed the SystemRescueCD om OMV and rebooted in to it.

    mounted the sdb1 disk where the fsarchiver backup is saved.



    The questions I have:


    • When you do dd if=/mnt/YOUSHOULDKNOW/backup.grubparts of=/dev/YOUSHOULDKNOW, is the YOUSHOULDKNOW of the destination drive (in my case the 60 GB SSD) /dev/SDA of /dev/SDA1?
    • When is used the dd command I did with /dev/SDA, should I then see the same partition table of my 223 GB SSD drive?
    • The same goes for when using the fsarchiver command, to what partition should it restore, I assume SDA1?

    I think my problem has to do with different sized disks however I changed the partition size to fit on the 60 GB SSD.


    Is there not a way to install a fresh installation of OMV and then restore the configuration files and such?


    All help is welcome.


    Francis

  • Same here.


    It's impossible to restore from fsarchiver. Even with same disk size in my case. Tried everything with no luck, that includes removing all partitions from my boot device and dding the grubpart file.

  • It's impossible to restore from fsarchiver

    No it isn't impossible. Maybe the guide is missing something. Maybe you were using gpt and need to use the gpt backup file instead of the mbr. There are lots of things that can go wrong. I haven't had time to babysit this process in a while but when I originally wrote the plugin, I was able to restore many times.

    omv 6.0.30-1 Shaitan | 64 bit | 5.15 proxmox kernel | plugins :: omvextrasorg 6.0.9 | kvm 6.1.19 | mergerfs 6.1.1 | zfs 6.0.9
    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Thanks for the guide!

    My openmediavault server's ssd disk died, and I replaced it with a new one (different brand, same capacity). Now I wanted to restore my last backup made with fsarchiver via the omv backup plugin, and I'm following the guide. After following the first 13 steps, I'm stuck with the last 2, where the critical things are done.

    These were the partitions on my new ssd nvme disk before trying to restore (I had installed OMV on it):

    Code
    Device         Boot     Start       End   Sectors   Size Id Type
    /dev/nvme0n1p1           2048 486395903 486393856 231.9G 83 Linux
    /dev/nvme0n1p2      486397950 488396799   1998850   976M  5 Extended
    /dev/nvme0n1p5      486397952 488396799   1998848   976M 82 Linux swap / Solaris

    After I ran the "restore grub and the partition table" step:

    Code
    dd if=/mnt/array/Backup/omvbackup/backup-omv-30-ago-2021_03-00-01.grubparts of=/dev/nvme0n1

    Now it looks like this:

    Code
    Device         Boot Start       End   Sectors   Size Id Type
    /dev/nvme0n1p1          1 488397167 488397167 232.9G ee GPT

    And when I try to restore the main partition:

    Code
    fsarchiver restfs backup-omv-30-ago-2021_03-00-01.fsa id=0,dest=/dev/nvme0n1p1

    I get the following error:

    Code
    oper_restore.c#152,convert_argv_to_strdicos(): "/dev/nvme0n1p1" is not a valid block device

    So I think I messed the partition table. Maybe the grubparts are not written to /dev/nvme0n1 but to other place? Before trying to restore the partition table I could see GRUB installed with:

    Code
    dd bs=512 count=1 if=/dev/nvme0n1 2>/dev/null | strings

    But I can't see that anymore.

  • Had a not even 1year old crucial MX500 SSD 250gb as my omv system drive die on me and had a chance to test ryecoaarons backup plugin. Had regular fsarchiver backups of my entire system drive on my mergerFS filesystem.


    Inserted a new system SSD, reinstalled OMV (not sure if necessary, but went quick), booted systemrescuecd from a different usb drive and then restored according to the instructions on page 1. Rebooted, everything works as if the SSD never failed. Thanks for the plugin and your work! Took like half an hour. Great


    I just have one question, maybe because i don't understand EFI booting or GPT. Why is the dd of the .grubparts file necessary? Doesn't fsarchiver restore the full partition? I don't have a seperate boot partition, just /dev/sdc1 as boot and file partition for OMV and a swap partition.

  • I just have one question, maybe because i don't understand EFI booting or GPT. Why is the dd of the .grubparts file necessary?

    It isn't needed for some of the backup options. I originally added it for rsync and left it for all options since it uses very little space.

    omv 6.0.30-1 Shaitan | 64 bit | 5.15 proxmox kernel | plugins :: omvextrasorg 6.0.9 | kvm 6.1.19 | mergerfs 6.1.1 | zfs 6.0.9
    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Hello!

    how are you?


    My OMV its works fine, version 5.x, with backup plugin installed. OMV is installed on server only, without Virtual Machine.

    So, follow the steps with fsarchiver on OMV GUI. The directory to put the backup files is our disk backup.

    The backup process went well. After this I did use rsync to send/copy the files to ssd usb driver. Then, get other machine with a new disk, formated in ext4 gpt. Run live system, plug the ssd usb, mount the devices and go...


    so.....

    I did follow the steps about.
    dd if=/mnt/YOUSHOULDKNOW/backup.grubparts of=/dev/YOUSHOULDKNOW


    OK!


    15 - Extract the backup to that drive (and correct partition): fsarchiver restfs backup.fsa id=0,dest=/dev/YOUSHOULDKNOW

    (id=0 means that just the first filesystem from the backup will be restored. I am assuming that you did just backup one filesystem with one backup.)


    Right, ok!


    But, after reboot system, the system does not UP. Seems cannot get grub, or run grub. when I check with live cd system, all system files there, all directories. I check the smb.conf file and right, the same file that is run on the server production.


    Please, How can I fix this.

    Somebody can Help


    Thanks


    Douglas


    Douglas Giovani Oechsler
    Prudentópolis-PR-Brazil

  • Is there a possibility to backup the system in a somehow easier way for restoring? Id like to just have an image of the system disk that I can burn on the new usb stick if the old one failed and have it just working from that... not possible?

  • I use dd to make an automated daily backup of the OMV system disk via a cron job. I've made more than 2,500 backups this way over the last seven years.

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


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

  • Is there a possibility to backup the system in a somehow easier way for restoring? Id like to just have an image of the system disk that I can burn on the new usb stick if the old one failed and have it just working from that... not possible?

    offline:


    usbimager

    Win32diskimager

    Clonezilla

  • Sure, just dd a larger portion of the beginning of the disk. I think it is normally 2MB but I need to check.

    Hey ryecoaaron, are you planning this change for fsarchiver as well?


    Yesterday I had to restore my system running UEFI and was a nightmare. I lost 3 hours before I figured out the problem was the UEFI partition not being restored from .grubparts and then the actual GRUB/UEFI restore/install process to have the system back up and running again.


    With the UEFI partition backed up would have been a breeze.

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 8GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), Several HDDs (Data) w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • are you planning this change for fsarchiver as well?

    The change you quoted was for gpt partition table and that change was already made - https://github.com/OpenMediaVa…r/usr/sbin/omv-backup#L88. This would also apply to all methods.


    Yesterday I had to restore my system running UEFI and was a nightmare. I lost 3 hours before I figured out the problem was the UEFI partition not being restored from .grubparts and then the actual GRUB/UEFI restore/install process to have the system back up and running again.


    With the UEFI partition backed up would have been a breeze.

    grubparts is only meant to restore grub and partition table info not partitions. The uefi partition is a full partition and would require a separate file (and restore) of its own. I guess I can look at backing that up too.


    In your case, I would've re-installed OMV and then restored your fsarchiver backup over the OS partition.

    omv 6.0.30-1 Shaitan | 64 bit | 5.15 proxmox kernel | plugins :: omvextrasorg 6.0.9 | kvm 6.1.19 | mergerfs 6.1.1 | zfs 6.0.9
    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.
    Please don't PM for support... Too many PMs!

  • grubparts is only meant to restore grub and partition table info not partitions. The uefi partition is a full partition and would require a separate file (and restore) of its own. I guess I can look at backing that up too.

    Allright, thanks for the clarification.


    The UEFI partition is usually 512 MB but Debian/OMV only uses 136KB, so there is virtually no space and time required to back it up. It has a boot flag, so it should be easy for you to build a logic to detect it and back it up.


    This would be a great addition, because means we could restore an entire OMV setup to a new disk with only few commands in systemrescuecd, and not to do other this like reinstalling OMV (to be honest I haven't thought about it).

    OMV BUILD - MY NAS KILLER - OMV 6.x + omvextrasorg (updated automatically every week)

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 8GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker Apps), Several HDDs (Data) w/ SnapRAID - Fractal Design Node 304 - Be quiet! Pure Power 11 350W


    My all-in-one SnapRAID script!

  • It has a boot flag, so it should be easy for you to build a logic to detect it and back it up.

    It also has a different partition type.

    omv 6.0.30-1 Shaitan | 64 bit | 5.15 proxmox kernel | plugins :: omvextrasorg 6.0.9 | kvm 6.1.19 | mergerfs 6.1.1 | zfs 6.0.9
    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.
    Please don't PM for support... Too many PMs!

Participate now!

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