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

    • OMV 4.x
    • 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

      Source Code

      1. 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: 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.
    • 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/>
      OMV 4, 7 x ODROID HC2, 1 x ODROID HC1, 5 x 12TB, 1 x 8TB, 1 x 2TB SSHD, 1 x 500GB SSD, GbE, WiFi mesh

      The post was edited 2 times, last by Adoby ().

    • Adoby wrote:

      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?
    • Adoby wrote:

      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.
    • gt4020 wrote:

      what is the best way to clone sdcard using a w10
      Acronis True Image


      tkaiser wrote:

      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.
    • tkaiser wrote:

      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 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!
    • gt4020 wrote:

      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.)
    • crashtest wrote:

      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): 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).
    • 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.**

      The post was edited 3 times, last by crashtest: edit ().

    • Users Online 1

      1 Guest