How to keep two SD Cards cloned, in case one fails?

  • My Odroid HC2 has just arrived, along with the two identical 32GB SD cards, that I intend to use for the OMV.


    What is the best way to keep them cloned so that if one suddenly fails, I can quickly slip in the replacement?


    Should I physically remove the card (say, once a week), clone it with the second via a laptop and then replace it or is there a way to automatically update the card to my backup server?

  • In general: while various users will tell you that it's possible to clone a running system my take on this is: nope (I helped companies multiple times recovering from such 'cloning went wrong' stunts so when being paid per hour dealing with this concept can be quite nice... but that's paid consultancy and does not apply to the situation here).


    This command will list all open files on your system

    Code
    lsof / | awk 'NR==1 || $4~/[0-9][uw]/' | grep -v "^COMMAND"

    The more you have the more likely live cloning will result in an inconsistent clone. You would need filesystem features (snapshots) and special mechanisms for applications to ensure their data has been consistently written to disk. A good example is Windows and how Microsoft implemented it there: https://en.wikipedia.org/wiki/Shadow_Copy


    That said: If you start with my 'official' OMV4 image for your HC2 you could benefit from snapshots since we ship with btrfs for the rootfs. By creating a snapshot prior to cloning and by eliminating/reducing open files you could even send the latest created snapshot incrementally to the 2nd SD card sitting in a card reader in the USB2 port. But all of this requires some knowledge and strict testing. And most probably not just hours but days of your life.


    TL;DR: Shut the NAS down from time to time (and/or prior to major updates) and do an offline clone on another machine.

    • Offizieller Beitrag

    I also only use offline backups of my SD cards.


    I practice I use my Linux laptop with a SD card reader and some scripts to read or write cards.


    I talk about it in this thread: New to OMV and Linux


    There are many other tools and methods. But you need a SD card reader and the ability to clone the card. Either as a whole or in parts.


    I also use a Brother label printer to make labels I stick to the SD cards and to the HC2s to keep track of what card goes to what HC2, ctrl, nas1-nas4. You can imagine how I figured out that labeling was necessary. <facepalm/>

  • Hi, what is the best way to clone sdcard using a w10 laptop?

  • I assume there are plenty of nice windows sd card cloning software

    Unfortunately not since they skip the most important part: verify. So you don't know whether the image you created is a 1:1 copy of the device or just some garbage in between.


    Balena Etcher folks wanted to look into a way to create good clones (verify included) but I guess that's a feature they now save for their professional Etcher Pro offers :(


    On Linux and macOS I always used ddrescue but am about to evaluate dcfldd.

  • what is the best way to clone sdcard using a w10

    Acronis True Image



    Unfortunately not since they skip the most important part: verify. So you don't know whether the image you created is a 1:1 copy of the device or just some garbage in between.

    I use "Acronis True Image" on Windows machines. It has verification of the backup copy just after its execution. The copy itself is done sector by sector it takes a bit, but ... It even needs to be re-verified at the time of restore.

    • Offizieller Beitrag

    but am about to evaluate dcfldd.

    It works very unless the source has a bad sector. So, you will waste your time in a lot of cases if you want to make an image of a dvd or cd. Never tried dc3dd to see if it suffers from the same problem - may be worth testing.

    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

    Hi, what is the best way to clone sdcard using a w10 laptop?

    Win32Diskimager will "read" an SD-card to an image file, and "write" that image file to another SD-card. Just remember when the read operation is done verify the image file. Then write the image file to another card and verify it. Verification is a separate step that should be done with each operation. If verification fails in either the read or the write, the 2nd card is not a clone of the 1rst.


    (Note that the verified image file, itself, could be saved for backup.)

  • Win32Diskimager ... If verification fails in either the read or the write, the 2nd card is not a clone of the 1rst.

    And this is to be expected on Windows 10 for these reasons (Windows' own handling of partitions it has write access to): https://sourceforge.net/p/win32diskimager/tickets/50/#9da6


    As a side note: It's also explained there why Win32Diskimager can't clone OS installs on any of the ARM installations other than RPi (where a FAT partition needs to be present and as such this anachronistic Windows joke called 'drive letter' gets assigned).

    • Offizieller Beitrag

    That's an unverified comment, from a single user, in a still unverified bug report. All software packages have unverified issues and comments that, in themselves, don't mean anything. Apparently Etcher has 134 outstanding "issues" as well.
    And the side note regarding Windows drive letters is not the friendliest way to welcome a new user. It's not a secret that the vast majority of OMV's users have Windows clients.
    __________________________________________________________________


    @gt4020 There's no such thing as "perfect software" - there will always be a use case exception. I've used Win32diskimager dozens of times to clone USB thumbdrives and SD-cards, as many users and contributors have on this forum, and it worked flawlessly


    When it comes to verification, I've even tested Win32diskimager for the possibility of false verification "passed" outcomes. It worked as expected. When cloning SD-cards or USB thumbdrives, it's enough to state that verification of both the read and write operations is important. If verification passes, the source and destination are identical.


    If verification fails, that's another matter altogether that you need not worry about until it happens.
    **I've had one verification failure which, after it was tested, was found to be due to a dying SD-card. In that the verification process found this problem, this was a good thing.**

Jetzt mitmachen!

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