OMV Backup plugin w/ Borg method - can't restore

  • Hi,


    I am testing borgbackup as backup method in openmediavault-backup plugin. I've been using fsarchiver but I wanted something more efficient.


    Using a VM, I deleted the OMV system disk and created a new one, then booted with systemrescue 7.0. I am simulating the scenario where my real Flash dies and I need to swap it for a new one.


    I think am doing wrong two things:

    - grub restore command

    - borg restore command


    I mount the backup filesystem

    I restore grub with the following command:

    dd if=/mnt/backup/omvbackup/backup-omv-11-Nov-2020_23-32-27.grubparts of=/dev/sde bs=512 count=1


    I can see partitions in GParted, but there's a warning for /dev/sde1 which is the main partition:



    Then I attempt to restore the system with borg, am I running the right command? Taken from here

    borg extract --stdout /mnt/backup/omvbackup/borgbackup::backup-omv-11-Nov-2020_23-32-27 | dd of=/dev/sde1 bs=1M


    However nothing boots. Am I missing something?

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

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB 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!

    • Offizieller Beitrag

    I restore grub with the following command:

    dd if=/mnt/backup/omvbackup/backup-omv-11-Nov-2020_23-32-27.grubparts of=/dev/sde bs=512 count=1


    I can see partitions in GParted, but there's a warning for /dev/sde1 which is the main partition:

    Is your system uefi?


    hen I attempt to restore the system with borg, am I running the right command? Taken from here

    borg extract --stdout /mnt/backup/omvbackup/borgbackup::backup-omv-11-Nov-2020_23-32-27 | dd of=/dev/sde1 bs=1M

    borg extract is extracting files. dd is trying to write the filesystem at the block level. Then won't work. You will need to format the filesystem that should be available now since you wrote the partition table and then mount the filesystem. After all that, you can borg extract the files to the new mount point. I actually think it is easier to reinstall OMV then use your backup to overwrite the different files.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    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!

  • Both my real system and this VM are MBR, but just by mistake.

    In the future I will redo everything in UEFI.


    So, here are the steps:

    • Mount the filesystem where backup is located
    • Restore partition table with the following command:

    dd if=/mnt/backup/omvbackup/backup-omv-11-Nov-2020_23-32-27.grubparts of=/dev/sde bs=512 count=1

    • Format the main partition to ext4
    • Mount it
    • cd to the new mount point
    • borg extract --stdout /mnt/backup/omvbackup/borgbackup::backup-omv-xxxxxxx 
    • Checked files got restored
    • Reboot

    Does Grub actually get restored as well with .grubparts?
    Because at this point, nothing boots, just got a screen with a blinking command, but can't enter anything.



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

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB 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!

    • Offizieller Beitrag

    Does Grub actually get restored as well with .grubparts?
    Because at this point, nothing boots, just got a screen with a blinking command, but can't enter anything.

    It should but grub is tricky to restore with just dd. I would boot the debian install iso and repair the install. It allows you to fix grub.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    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!

  • It should but grub is tricky to restore with just dd. I would boot the debian install iso and repair the install. It allows you to fix grub.

    Thanks.

    I discovered that

    • grubparts does not restore correctly if I replace the virtual disk with an identical one
    • grubparts restores correctly if I just format the disk/override partition table.

    I don't know if this could be limited to the VM environment.


    So I took the illetterate approach:

    - format the new disk to ext4

    - restore the backup

    - run Debian ISO and reinstall Grub


    It worked when using fsarchiver method but not borg. With the latter, Debian installer fails with a generic error:

    Code
    Unable to install GRUB in /dev/sda
    Executing `grub-install /dev/sda` failed.
    This is a fatal error.

    Applies to all partitions.


    That's strange. I'll keep looking into it.

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

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB 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!

  • I am using omv on a rpie. The system is installed on a SD

    I decided to try out borg. Simulating a scenario where my SD card dies.

    My boot is a separate partition and it seems that borg doesn't back up those files. I was wondering if it is the same for you?

    Code
    borg list borgbackup/::backup-omv-08-Nov-2020_00-59-19 boot

    When I tried to list the files in the boot dir it shows no files. Don't I need them to restore my /boot?


    Seeing that you are running a VM I saw some info in borg documentation check it. Dunno how relevant that is.


    I will try fsarchiever and maybe use that.

  • Borg/the plugin backs up the root file system, which you can specify if not detected automatically.

    I also believe the logic that picks up this file system is built in the plugin itself, in fact fsarchiver works fine.


    To restore, you need to mount the new empty partition and restore the borg backup: when this is done, you'll see system files and folders if was successful.


    Try to mount the backup done by the plugin when the system is running and check if folders of the root fs are there.


    At the moment I will stick with fsarchiver because I've already spent too much time on trying this scenario, but let me know if you find out more.


    The VM case from Borg docs does not apply here, I'm using a VM just to test this scenario without actually crashing my real server :)


    Fsarchiver is great in this case because it is actually made to backup a file system to a compressed archive.

    Borg is designed for normal file backup and I love it (I just wrote a guide about the borgbackup plugin) so probably is a bit borderline for this usecase.

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

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB 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!

    Einmal editiert, zuletzt von auanasgheps ()

  • Fsarchiver is great in this case because it is actually made to backup a file system to a compressed archive.

    Borg is designed for normal file backup


    For SD-cards, it's easier to simply clone them

    Well I will looking into that. I will test making a full disk image with borg. If it works it could be added as a back up option.


    BTW I did test fsarchiever and it works perfectly. I will use it if borg doesn't pin out. Thank you ryecoaaron for making it so easy to back up and restore.

  • Yup making a live system clone with borgupdates is too advanced for me. For some reason it doesn't work their documentation says this should be the command

    Code
    borg create --read-special repo::hostname-disk $DISK -e "/dev"

    Where $DISK is I suppose my physical device lets say /dev/sda . I did try /dev/sda1 which where / is mounted with similar result. I exclude at least /dev because documentation says we might get into infinite loop if we try to back up /dev/zero with --read-special.


    I will just stick to fsarchive for auto live back up. And from time to time I will make manual off-line back up using USBimager.


    PS.

    Borg/the plugin backs up the root file system, which you can specify if not detected automatically

    FYI I did check out the source code and omv-backup plugin with option borg has the root hard coded in it. It will always back up only / directory. It will not care even if someone manually sets root dir form the plugin web interface.

  • Yup making a live system clone with borgupdates is too advanced for me. For some reason it doesn't work their documentation says this should be the command

    I guess we should stick with fsarchiver, both of us confirmed works very well. Borg isn't really made for this purpose.

    My goal was to save on bandwidth - I upload OMV backups every night to Google Drive using Rclone, but it's not a big deal.


    FYI I did check out the source code and omv-backup plugin with option borg has the root hard coded in it. It will always back up only / directory. It will not care even if someone manually sets root dir form the plugin web interface.

    Thanks for checking it out, makes sense: Borg backs up files, so it's correct to hard code the / directory. Other methods do backup the partition instead.

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

    NAS Specs: Core i3-8300 - ASRock H370M-ITX/ac - 16GB 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!

    • Offizieller Beitrag

    sets root dir form the plugin web interface.

    You can't set the root directory. You can set the root device. So, yes the plugin will always backup the files in / but if the root device is wrong, it will incorrectly backup the mbr with dd.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    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!