Openmediavault-backup - Command DD - Restore backup

  • Hello,


    Before i used script to backup my OMV using DD command.
    Here my commande used via my script :


    Backup backupcopy :
    dd if=/dev/sdb of=/mnt/backupcopy.iso bs=4MB
    REstore backupcopy
    dd if=/mnt/backupcopy.iso of=/dev/sdc bs=4MB


    It was very simple.


    I test the plugin openmediavault-backup.


    Here configuration of the plugin :
    - Method : DD
    - Root device : /dev/sdb


    The command execution is successfull and create multple files : .gz ; .blkid ; .fdisk ; .grub ; .package ; .grubparts
    The file .gz containt my dd file.
    When i restore the file with my command (dd if=/mnt/xxxx.dd of=/dev/sdc bs=4MB), i dont find any partition on my usb key.


    Can yu explain me how to restore with this plugin and multiple files are created when the plugin use DD command.


    Thx a lot

    • Offizieller Beitrag

    Can yu explain me how to restore with this plugin and multiple files are created when the plugin use DD command.

    There a couple of differences with what the plugin does. It doesn't image the entire drive. It just images the OS partition and the partition table in separate files. So, you need to dd the grubparts file to the beginning of the drive with something like:
    dd if=/mnt/xxxx.grubparts of=/dev/sdc bs=512 count=1
    This will create the grub setup in the mbr and the partitions. Then write the OS partition with
    gunzip -c /mnt/xxxx.gz | dd of=/dev/sdc1 bs=1M


    You can see how the plugin creates the backup here - https://github.com/OpenMediaVa…iavault/mkconf/backup#L86

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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!

  • Hi there. I have a question about the dd backup. I tried to read the documentation, but the link is dead. https://github.com/OpenMediaVa…iavault/mkconf/backup#L86


    As I understand:


    .blkid, .fdisk, packages = information files and not needed to restore backup.


    I have a grub AND a grubparts file. Are both needed for the restore? e.g. dd if=/mnt/xxxx.grubparts of=/dev/sdc bs=512 count=1


    I also have a backup-omv_bootxxxxx.dd.gz as well as the backup-omv-xxxxx.dd.gz. In your previous response you said to write the OS partition with this:


    gunzip -c /mnt/xxxx.gz | dd of=/dev/sdc1 bs=1M


    Must I also write that boot partition separately and if so, with something similar?


    Thanks

    • Offizieller Beitrag

    but the link is dead.

    https://github.com/OpenMediaVa…aster/usr/sbin/omv-backup


    Must I also write that boot partition separately and if so, with something similar?

    If you have a boot part and you chose the dd method, it will need to be written back in a second command.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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

    Do I have to also restore the grub file or just the grubparts?

    If it is a new storage device, grubparts has grub + partitions. So, you would need grubparts. If it was the original install, you may not need to use either.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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!

  • Hello,


    after I did a lot of research i found this thread and I'm very thankful. Nevertheless I still have a Problem and would be very thankful if you try to help me.


    I'm using OMV on a RaspberryPi 4, I did a dd-Backup with the Plugin. After I crashed the system with an update, i tried to Restore the system with the Backup. I did the following:


    1.) I deleted all Partitions on the SD-Card with fdisk

    2.) Used this to restore Partitions: sudo dd if=/xxxx/xxxx.grubparts of=/dev/mmcblk0 bs=512 count=1

    3.) Unmounted the two new Partitions

    4.) Wrote Boot: sudo gunzip -c /xxxx/xxxx.gz | pv | sudo  dd of=/dev/mmcblk0p1 bs=1M

    5.) Wrote OS: sudo gunzip -c /xxxx/xxxx.gz | pv | sudo dd of=/dev/mmcblk0p2 bs=1M


    But I still get the message "Kernel Panic: VFS : Unable to mount root fs on unknown-block (179,2)"


    I tried a few things none of them worked. Is it a raspberry-specific problem an doesn't belong here, please don't blame me and delete this. Otherwise I trust in your experience.


    Thankful,


    Jonas

    • Offizieller Beitrag

    Maybe 512 bytes isn't enough for an RPi for the partition table and boot stuff. I need to look. You could try writing a new image and then just write the images over the partitions.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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

    The grub+parts isn't enough for an RPi. It would have to be 8192 bytes. dd full is really the best option for an RPi.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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!

  • Maybe 512 bytes isn't enough for an RPi for the partition table and boot stuff. I need to look. You could try writing a new image and then just write the images over the partitions.

    You mean writing a complete new Image, so the RPi would start and after that writing the OS partition of my Backup over the new Partition?

    If you mean that, I tried, and i get the exact same exception.


    The grub+parts isn't enough for an RPi. It would have to be 8192 bytes. dd full is really the best option for an RPi.

    So you think I could try: sudo dd if=/xxxx/xxxx.grubparts of=/dev/mmcblk0 bs=512 count=16

    Or am I getting that wrong? Because I like to understand this: Is it, that RPi needs 8192 bytes for grub+parts and I only restored 512 bytes of that?


    And I'm totally going to use dd fully till now. ;)


    Thank you very much for answering.

    • Offizieller Beitrag

    You mean writing a complete new Image, so the RPi would start and after that writing the OS partition of my Backup over the new Partition?

    If you mean that, I tried, and i get the exact same exception.

    Yes, write a complete new image but then write the backup of the OS and Boot partitions over the newly written image


    So you think I could try: sudo dd if=/xxxx/xxxx.grubparts of=/dev/mmcblk0 bs=512 count=16

    Or am I getting that wrong? Because I like to understand this: Is it, that RPi needs 8192 bytes for grub+parts and I only restored 512 bytes of that?

    If the backup command would have saved 8192 bytes, that would work. But since it didn't, there is nothing we can do to fix that.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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!

  • Hey together,

    unfortunately nothing worked, the exception is always the same. What I learned is: Always try to restore a backup at least once before you trust the algorithm which creates your backup. But the good thing is, I learned a lot.

    Thank you for your help.


    Best Regards

    Jonas

    • Offizieller Beitrag

    unfortunately nothing worked, the exception is always the same

    I will have to try it. Maybe I can come up with something.

    What I learned is: Always try to restore a backup at least once before you trust the algorithm which creates your backup. But the good thing is, I learned a lot.

    The backup still has your config.xml in it. So, you can look at that file and should be able to re-create anything in your new image. Even if you had data on the os disk, it is there. I understand the restore is not easy but I have always said that about this plugin. This is also why I recommend clonezilla over the plugin.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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!

  • Thank you, I'm going to try that:

    Zitat

    The backup still has your config.xml in it. So, you can look at that file and should be able to re-create anything in your new image. Even if you had data on the os disk, it is there. I understand the restore is not easy but I have always said that about this plugin. This is also why I recommend clonezilla over the plugin..

Jetzt mitmachen!

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