I would like to make manual backups of an SD card as a disk image so that it can be easily recreated when needed. I’d like to keep a few versions in case there is a problem I didn’t know about, it can be rolled back.

How can I do this incrementally, or with de-duplication, so that I don’t have to keep full copies of the complete SD card? It’s very big but most of the content won’t be changing much.

It’s for MiyooCFW ROM which is on FAT 32-formatted micro SD card.

Thanks for your help! Also let me know if I am going about the problem in a wrong way.

  • ouch@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    3 months ago

    I recommend just backing up the files.

    But if you really have to back up the disk image, dd a copy of it, mount the copied image as loopback device, write the loopback filesystem full of /dev/zero, sync, delete the zero file(s), unmount, cp --sparse=always and store the result.

    The reason for using the loopback image step is to prevent wearing out the SD card with writing the free space full of zeros every time you make a backup.

    There may be an existing tool for this, but I don’t remember it.