Making a copy of the SD Card

  • I have my install all working (Pi2) and setup how I want it. I want to image the SD card for my other Pi and to make a backup. The issue is it shows as 2 different drives in Windows. I think one is Fat32 and the other is EXT4. Using OpenElec I just used Win32 Disk Imager to make an image of the one drive that showed up and then wrote that. Thanks

    • Official Post

    Use the backup and restore functions in the LE settings add-on to clone the small amount of data on the card instead of cloning the entire card. It will be faster and doesn't hit issues when the sector count on one card is different to the other.

  • I tried to make an image of the sd card in my Wetek Play2 using Win32 but when i came to put that onto a new card i got the sector count error.

    is there any other way to get an exact copy of the setup.

    • Official Post

    As @chewitt mentioned, the LE method is quicker and easier. The reason being is that SD cards of the "same" size may not actually have the same number of sectors - even if they are the same brand. So win32diskimager may, or may not work.

    There is a new tool in Raspbian that will do what you want "PiClone" see The latest update to Raspbian - Raspberry Pi.

    I haven't used it but should do what you want.

  • Read post #2. It will not be an exact copy of the card, but you only need the data on the card, not an image of the card. I never understand why people waste time creating an 8GB or 16GB image of their card when you can have a 1GB (max, it's often a lot less) backup file. Ho hum.

    It doesn't really 'waste time' unless you sit watching it. I don't do that with the libreelec backup, and I don't do it if imaging in windows.

    Restoring is quicker and easier from an image, unless you have an already running pi.

    Burn image > boot pi vs install libreelec > boot pi > transfer backup to card > restore backup

    The sector count would be a lot less of an issue if libreelec left a little gap at the end of the storage partition on install - as it is I do that manually. You can burn an image from usbit and it will ignore a size discrepancy; as long as the last partition fits it all works.

    Mostly I use the built-in backup, but it's not always better.

  • Use the backup and restore functions in the LE settings add-on to clone the small amount of data on the card instead of cloning the entire card. It will be faster and doesn't hit issues when the sector count on one card is different to the other.

    Thanks. I didn't see that option when I looked for it originally. It is deeper under the system menu.

    Is the .tar file an image? Can that only be restored to a system with LibreElec already on it or can it be written to a blank SD card? I believe it has to be restored to a functioning system and then it becomes a 2 step process (image LibreElect to SD card and then do the restore).

    Edited 3 times, last by michaeljc70 (June 7, 2017 at 3:00 PM).

  • I'm having problems with this technique (backing up and restoring to a different Pi). Is the backup device dependent? They are all running Libreelec 8.25, but one is a P3B+, one is a Pi2 and one is a P3B. It seems to freeze/error out during the restore (not sure if I can look for an error somewhere without watching it for the whole time).

    Edited once, last by michaeljc70 (July 26, 2018 at 12:49 AM).

    • Official Post

    Kodi backups are always hardware dependent, but Pi 2B, 3B and 3B+ are hardware compatible (using the same OS image) so whatever the issue is, that's not the problem. The important thing to remember is that restoring data between devices is simply about stopping Kodi (systemctl stop kodi) then moving a small number of key files back to the right places, then starting Kodi again (systemctl start kodi). The tar file can be unpacked and you can move files back manually if required.

    • Official Post

    Probably not. Note that you will need approx. 2.5x the size of the backup file as free space on the SD card to restore successfully as the tar file and unpacked tart file will coexist at the same time; plus some working space. If that's not the case you can unpack on something else with more free space and then stop kodi and move files back to where they need to be. Doing things manually isn't so hard.

  • Having a similar issue. I have my KODI database all set up just the way I want it. I have a Rpi for each tv in my house that I want to duplicate the entire configuration (Sort order, etc.) from the "Master" pi to other locations without having to spend hours setting it up. I tried to image the SD card and put it in another pi but that didn't go well. Is there a single file that I can transfer from one pi to another that contains the KODI config? I can just re-install LibreElec on another pi and move the configuration files over?

  • Take a look at PiShrink.

    First make a copy of the SD card using DD and then run PiShrink. It srinks the image so you can put it on a new SD. First boot it will expand to the full SD card. It will also compress the image file if you want.