[Backup Plugin] create a single img backup image for use with win32 disk imager / etcher, etc.

  • Hi,


    I'm running OMV5 on a Raspberry Pi4. The easiest way to make backups is to clone the sd card with win32 disk imager and to restore with etcher.

    However, my system is physically stored away somewhere... i need to climb a latter to physically access the pi.


    I therefore was looking into the backup plugin. The plugin's gui reads that "dd - use dd to clone the entire drive to a compressed image file". I therefore expected one single img file, however, the backup created several files (gz, blkid, fdisk, grub, grubparts, packages). since dd is capable of writing sigle img files, it would be very handy if there would be a parameter for this. This would be very handy to single-board computer users like myself, because one needs just etcher or something similar to restore the image to a SD card.


    Is this doable?


    Best, M

  • Is this doable?

    Sure. I just avoid it because too many people were using their OS drive for data as well and this would make the backup very large. The idea was that you would restore a current RPi image with etcher (use usbimager instead - https://gitlab.com/bztsrc/usbimager) and the just dd the partition over that.

    omv 5.5.1 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • ... one other thing I noticed in the plugin:


    the settings under "scheduled backup" appear to revert to their default settings. I changed the time interval to "weekly" and ticked "send email". I then clicked on apply. However, i'm seeing the defaults "daily" and "no email" when I'm opening the dialogue again.


    M

  • Is this doable from within the backup plugin? Or do I need another plugin? (sorry, I'm fairly new to OMV).

    By doable, I meant the plugin could be changed to do this. Otherwise, you can always do it from the command line and a cron job.


    .. one other thing I noticed in the plugin:


    the settings under "scheduled backup" appear to revert to their default settings. I changed the time interval to "weekly" and ticked "send email". I then clicked on apply. However, i'm seeing the defaults "daily" and "no email" when I'm opening the dialogue again.

    Did you click schedule backup again in the plugin?

    omv 5.5.1 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • By doable, I meant the plugin could be changed to do this. Otherwise, you can always do it from the command line and a cron job.

    This would be great. Being able to do this from within the plugin also implies that older backups are removed, etc. in other words this would imply a script and not just one command line.


    Did you click schedule backup again in the plugin?

    Yes, I did. Clicking on "scheduled backup" brings up the dialogue.


    M

  • Yes, I did. Clicking on "scheduled backup" brings up the dialogue.

    That is why the job is reset. You should only do this once. If you want to edit the job, do that from scheduled jobs tab.

    omv 5.5.1 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • I do complete SD card backup manually via SSH like:


    Code
    pv /dev/mmcblk0 | gzip > /media/backup/OMV_Backup_$(date "+%d.%m.%Y").gz

    or over SMB


    Code
    pv /dev/mmcblk0 | gzip > /home/pi/Sambashare/my_backup_folder/OMV_Backu_$(date "+%d.%m.%Y").gz

    I repeat this procedure about twice a month.

    [LibreELEC @ 2x RPi3, CoreELEC @ S12 Octa Core]

    [ NAS OMV 5.xx (Usul) @ NanoPI M4 ]

    [ Nextcloud 18.0.4 @ ODROID C2 ]

    [ Motioneye @ RPi4]

  • do complete SD card backup manually via SSH like:

    Have you restored it? pipe view doesn't understand everything that dd does and I would think you might corrupt some things that pipe view doesn't understand.

    omv 5.5.1 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Have you restored it? pipe view doesn't understand everything that dd does and I would think you might corrupt some things that pipe view doesn't understand.

    Yes, had been restored several times :-)

    [LibreELEC @ 2x RPi3, CoreELEC @ S12 Octa Core]

    [ NAS OMV 5.xx (Usul) @ NanoPI M4 ]

    [ Nextcloud 18.0.4 @ ODROID C2 ]

    [ Motioneye @ RPi4]

  • I added full disk dd option to the plugin. 5.2 in the repos now. I didn't test but usbimager or etcher should be able to write this image without decompressing it.

    omv 5.5.1 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • ctrl-shift-R or clear your browser cache.

    Thank you, that worked.


    I now can see several files in the shared folder:

    Code
    backup-omv_boot-31-Mar-2020_15-31-48.dd.gz
    backup-omv-31-Mar-2020_16-59-33.ddfull.gz
    backup-omv-31-Mar-2020_16-59-33.blkid
    backup-omv-31-Mar-2020_16-59-33.fdisk
    backup-omv-31-Mar-2020_16-59-33.grub
    backup-omv-31-Mar-2020_16-59-33.grubparts
    backup-omv-31-Mar-2020_16-59-33.packages

    Which file would I have to select to write the full disk image to an SD card in Etcher?

    • Selecting backup-omv_boot-31-Mar-2020_15-31-48.dd.gz would write the boot partition to the drive, and
    • selecting backup-omv-31-Mar-2020_16-59-33.ddfull.gz would write the root partition,

    But I cannot write both partitions to an SD card, correct? Do I have to put all these files in one container (zip?)?


    I'm a bit confused. would it be possible to write the backup into one single .img file (i think dd is capable of doing this)?


    Thanks, M

  • Which file would I have to select to write the full disk image to an SD card in Etcher?

    The ddfull file.

    selecting backup-omv-31-Mar-2020_16-59-33.ddfull.gz would write the root partition,

    No, it writes the whole image of the device.


    But I cannot write both partitions to an SD card, correct? Do I have to put all these files in one container (zip?)?

    Just write the ddfull image to the device not a partition.


    would it be possible to write the backup into one single .img file (i think dd is capable of doing this)?

    Uh, that is what I did.

    omv 5.5.1 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Which file would I have to select to write the full disk image to an SD card in Etcher?

    Selecting backup-omv_boot-31-Mar-2020_15-31-48.dd.gz would write the boot partition to the drive, and
    selecting backup-omv-31-Mar-2020_16-59-33.ddfull.gz would write the root partition,

    But I cannot write both partitions to an SD card, correct? Do I have to put all these files in one container (zip?)?


    I'm a bit confused. would it be possible to write the backup into one single .img file (i think dd is capable of doing this)?


    Thanks, M

    Arrgh, sorry. backup-omv_boot-31-Mar-2020_15-31-48.dd.gz is from an older backup. The image file backup-omv-31-Mar-2020_16-59-33.ddfull.gz is the bit-to-bit image of the entire drive, correct? So, in case of emergency, I only have to select backup-omv-31-Mar-2020_16-59-33.ddfull.gz in Etcher to write back the bit-to-bit image of the full drive to another SD card, correct.


    M

  • The image file backup-omv-31-Mar-2020_16-59-33.ddfull.gz is the bit-to-bit image of the entire drive, correct? So, in case of emergency, I only have to select backup-omv-31-Mar-2020_16-59-33.ddfull.gz in Etcher to write back the bit-to-bit image of the full drive to another SD card, correct.

    If the file has ddfull in the filename, it is a gzip'd image of the entire device. I don't remember if etcher can automatically extract gzip or not but I think it can. You should use usbimager anyway and I know it can. You really should test the scenario and write to a secondary SD card so you know what to do instead of trying to figure it out when something fails in a panic.

    omv 5.5.1 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.3
    omv-extras.org plugins source code and issue tracker - github


    Please 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!