DIY advice

  • Would something like this run as a scheduled task do the job

    Code
    dd if=/dev/sda of=/dev/sdb bs=1M

    Or do you recommend any other dd options other than block size?

    The idea of a live nightly backup appeals to me.

    I can still do an offline backup once a week/month to another ssd

    I would never use disk device identifiers such as /dev/sda, especially for the destination target. Those assignments are not guaranteed to be static. If they change for any reason, /dev/sdb could be one of your data disks and dd is destructive on write. All the data on your /dev/sdb would be replaced with the backup data.


    See the script I posted above for a suggestions. It writes to a file with a unique name.

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


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

  • Code
    dd if=/dev/sda of=/dev/sdb bs=1M

    Am I correct in thinking that this approach would lead to two drives with the same UUID therefore possibly confusing the system? And that it would be OK to clone the OS drive but the copy would have to be removed before a reboot to avoid this?

    Inwin MS04 case with 315 W PSU

    ASUS Prime H310i-Plus R2.0 board

    Two port PCI-E SATA card

    16GB Kingston DDR4

    Intel Pentium Coffee Lake G5400 CPU

    Samsung Evo M.2 256GB OS drive

    4x4TB WD Red NAS drives + 1x4TB + 1x5TB Seagate drives - MergerFS pool

    Seagate 5TB USB drives - SnapRAID parity x 2

  • That is mostly correct. Both disks would have the same filesystem UUID and since that is the identifier in fstab that specifies which disk to boot there would be an ambiguity. Which disk actually boots could change from boot to boot or it could stay the same.


    I ran into this problem when I upgraded from OMV 4 to OMV 5. I cloned the OMV 4 disk and upgraded the clone to OMV 5. I left both disks in the machine thinking I could select which one to boot by using the BIOS boot menu. I forget which one always booted, but no matter which I chose from the menu one of them could never be booted. I was able to solve it by changing the filesystem UUID on one of the disks to a random value. Eventually I was satisfied with OMV 5 and didn't need to have OMV 4 available as a boot choice, so I removed that disk and set it aside.


    I also changed fstab to identify the single boot disk by label instead of UUID for clarity.

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


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

    Einmal editiert, zuletzt von gderf ()

  • Would this work as a scheduled nightly task to clone without confusing the system ?


    dd if=/dev-disk-by-label-OMV_MASTER of=/dev-disk-by-label-OMV_COPY bs=1M


    Then if master goes bad you could boot from the copy and do a once off to restore the master


    dd if=/dev-disk-by-label-OMV_COPY of=/dev-disk-by-label-OMV_MASTER bs=1M


    How would you label the master disk? OS drive is sda


    root@openmediavault6:/# lsblk -o name,mountpoint,label,size

    NAME MOUNTPOINT LABEL SIZE

    sda 119.2G

    ├─sda1 /boot/efi 512M

    ├─sda2 / 8G

    ├─sda3 [SWAP] 977M

    └─sda4 /srv/dev-disk-by-uuid-879f1672-ba5f-42a4-b966-c4c5e2bf680d 109.8G


    If you label sda2 the OS partition and use DD with dev-disk-by-label would it clone all 4 partitions?

  • I don't think this will work as intended. I think that at a minimum the boot sector would not be copied. I've never used dd with disk-by-label sources and targets so I could be wrong.

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


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

    • Offizieller Beitrag

    I can think of a way to protect against errors in the system or its manipulation. It could be to "reproduce" the existing configuration on a clean OMV system in an automated way:


    1. Regularly keep a backup of all system configuration. Including file systems, custom settings in the GUI, installed plugins, docker, etc.

    2. In case of disaster recreate the saved system (using a script?). The clean version of OMV is installed and the saved settings are applied to the clean system.


    I assume that the accuracy of the rebuild would depend on the accuracy and quantity of settings saved in the backup.


    Does something similar exist or has there been?

  • AFAIK, currently there is no such thing, not has there been.

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


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

  • Managed to get a backup system working through scheduled jobs


    At 2am daily the system will be imaged to a backup folder on my media drive. Takes about 12 mins for the 128GB image SSD to HDD


    dd if=/dev/disk/by-id/usb-SPCC_Sol_id_State_Dis_30041266761-0:0 of=/srv/dev-disk-by-uuid-89a60400-d732-45a9-8576-715d5e4f42b6/BACKUP/OMVbackup.img bs=1M status=progress




    At 3am daily the system will be cloned from the master SSD to the backup SSD using by-id to hopefully remove the chance of the system booting from the wrong SSD. Takes about 6.5 mins for the 128GB clone SSD to SSD


    dd if=/dev/disk/by-id/usb-SPCC_Sol_id_State_Dis_30041266761-0:0 of=/dev/disk/by-id/usb-ATA_SPCC_Solid_State_0123456789ABCDE-0:0 bs=1M status=progress


    Have booted from the cloned SSD and it seems to work fine. Might alter the image scheduled task to weekly and just have the clone daily


    Bit of a novice at this so not sure how to setup scripts using web interface.

Jetzt mitmachen!

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