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

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

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

      My hardware setup is

      - CPU x64
      - RAID6 with 7 disks (yes, I will change to snapraid)
      - SSD with operating system OMV4 connected to SATA port
      - backup flash USB option (if SSD does not work, I plug in usb and restart)
      - The BIOS boot order should be setup so that it boots firstly from the USB slot and secondly from the normal OMV disk. That way, if no USB is connected, the system will boot the normal operating system. But with USB connected it will boot the emergency option first. This comes in handy if booting from normal disk fails and you don't want to open the case or connect a headless server with a keyboard and monitor to choose boot options.

      My software setup is

      - OMV 4.1.17
      - OMV-Extras
      - I made a backup with the backup-plugin from the Web-GUi.
      - Backup setting: fsarchiver (no password)
      - Backup destination: The easiest way to do the backup was to my RAID-array.


      This might not be the best solution. Or, if you backup to the array, then you probably should copy it from there to some other destitination which you should be able to access even if your RAID array is not accessible. The same goes for Snapraid-array and other filesystems.

      Now, what to do to restore this backup:

      In my case my operating system was broken. So I could not boot from the installed SSD.

      Please be carefull with the commands here. I put YOUSHOULDKNOW everywhere you should recognise that if you don't know what to do or write here you probably should not do it anyway.

      1 - Plugin emergency OS (USB), reboot
      2 - Start OMV Web-GUI
      3 - I had to install SystemRescueCD to the OMV. Normally, this should already be part you your backup OMV. To install it go to OMV-Extras/Kernel.
      4 - Tell OMV on this page to boot from SystemRescueCD once.
      5 - Reboot.
      6 - Login via SSH (Putty) to the command line of SystemRescueCD. Username: root, Password: openmediavault.

      Now, you have to find the backup files. In my case they are on my RAID array and I have to mount it to access it. In your case you will have to adjust this but probably mounting a device will be necessary.

      7 - Check your RAID array: mdadm -D /dev/YOUSHOULDKNOW
      8 - My array was running fine.
      9 - Make a mountpoint in /mnt: mkdir /mnt/YOUSHOULDKNOW
      10 - Mount array to mountpoint: mount /dev/YOUSHOULDKNOW /mnt/YOUSHOULDKNOW
      11 - Move to backup directory on array
      12 - Check your backup: fsarchiver archinfo backup.fsa

      (Find out source partition, in my case the backup did not include the swap-partition, so I was pretty sure to backup just TO the first partition of my system disk)

      13 - Find out what device name the disk has you want to install the files from the backup on: blkid
      14 - This I did not do, but is recommended: If you are restoring to a new disk, write the backup of grub and the partition table (.grubparts file) to the disk before the fsarchiver restfs step with:

      dd if=/mnt/YOUSHOULDKNOW/backup.grubparts of=/dev/YOUSHOULDKNOW

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

      16 - reboot with: reboot

      EDIT: I had a problem with "A start Job is running" on startup. I solved this by deleting an old filesystem via Web-GUI of a USB-harddisk that I disconnected, and by commenting a line in /etc/fstab that was referring to a wrong swap-partition. Boot time is now 11 seconds. :)

      Thanks a lot to ryecoaaron for writing this plugin.

      Further information regarding the files the plugin is saving:

      backup-omv-18-Jan-2019_14-12-01.blkid :: This is the output of blkid put in a file for informational purposes.
      backup-omv-18-Jan-2019_14-12-01.fdisk :: This is the output of fdisk -l put in a file for informational purposes.
      backup-omv-18-Jan-2019_14-12-01.fsa :: This is the fsarchiver file.
      backup-omv-18-Jan-2019_14-12-01.grub :: This is the first 446 bytes of the disk where grub is installed
      backup-omv-18-Jan-2019_14-12-01.grubparts :: This is the first 512 bytes of the disk where grub is installed and the partition table.
      backup-omv-18-Jan-2019_14-12-01.packages :: This is the output of dpkg -l | grep openmediavault put in a file for informational purposes.

      The post was edited 11 times, last by bvrulez ().

    • Nice guide. I would only add that if you are restoring to a new disk, write the backup of grub and the partition table (.grubparts file) to the disk before the fsarchiver restfs step with:

      dd if=/mnt/YOUSHOULDKNOW/backup-omv-15-Jan-2019_14-12-01.grubparts of=/dev/YOUSHOULDKNOW
      omv 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • backup-omv-18-Jan-2019_14-12-01.blkid :: This is the output of blkid put in a file for informational purposes.
      backup-omv-18-Jan-2019_14-12-01.fdisk :: This is the output of fdisk -l put in a file for informational purposes.
      backup-omv-18-Jan-2019_14-12-01.fsa :: This is the fsarchiver file.
      backup-omv-18-Jan-2019_14-12-01.grub :: This is the first 446 bytes of the disk where grub is installed
      backup-omv-18-Jan-2019_14-12-01.grubparts :: This is the first 512 bytes of the disk where grub is installed and the partition table.
      backup-omv-18-Jan-2019_14-12-01.packages :: This is the output of dpkg -l | grep openmediavault put in a file for informational purposes.
      omv 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • bvrulez wrote:

      If you would like to elaborate more on the seperate files and their purpose I would be glad to also include it into the guide.
      There is a guide for making guides.
      So it might become a guide in the guide section

      General Information, Templates & Guidelines for Guides
      Odroid HC2 - armbian - Seagate ST4000DM004 - OMV4.x
      Asrock Q1900DC-ITX - 16GB - 2x Seagate ST3000VN000 - Intenso SSD 120GB - OMV4.x
      :!: Backup - Solutions to common problems - OMV setup videos - OMV4 Documentation - user guide :!:
    • Hey, guys,
      The explanation is great.
      Unfortunately I did not understand a small thing.
      If my system disk or USB stick is broken.
      I take a new disk.
      Do I have to install the OMV before?
      Or is it enough to install dd if=/mnt/YOUSHOULDKNOW/backup.grubparts of=/dev/YOUSHOULDKNOW?
      and then fsarchiver restfs backup.fsa id=0,dest=/dev/YOUSHOULDKNOW.


      Thank you very much for the answer.
      Many greetings
      gelo
    • First, thanks for the guide.

      OMV will be my backup repository (among other things) so my ability to restore IT was critical to test early. Using this guide I was able to get to Step 15 before encountering a problem due to my root fs being btrfs. I was additionally required to use fdisk to delete the old partition, create a new partition (with the same parameters, I was asked to keep/remove the existing signature; select remove and the mkfs.btrfs will now succeed).
      So:
      ‣ fdisk /dev/sda
      ‣ delete partition 1 (my root)
      ‣ create new partition 1 with defaults (same as old partition)
      ‣ remove old signature
      ‣ fsarchiver restfs -v -o backup-omv-22-Jan-2019_22-31-09.fsa id=0,dest=/dev/sda1 NOW works

      [*] Note: I tried to manually "mkfs.btrfs -f /dev/sda1 -L 'khione-ssd-r' -U '7ea79897-dbb0-4698-b5ce-a17430edcd96' -s 4096" after the fdisk which worked, but fsarchiver then still failed. Deleting the partition again and running fsarchiver worked. The takeaway seems to be that mkfs.btrfs won't overwrite an existing partition and it is called by fsarchiver restfs.
    • Users Online 1

      1 Guest