Unable to restore my backup

To improve my backups of OSMC I did save both partitions from a working environment onto my SSD using rsync -avxHAXU (formerly I did a dd).

Now the critical situation has arosen, after reboot my original SD card is completely dead. I could recreate a fresh SD card from my SSD backup - but it fails to boot.

In the very beginning of the boot process it fails to mount /dev/mmcblk0p2

I did initialize my SD card from my linux desktop (including partitioning/formatting). OSMC complains during boot on some unkown e2fsck features (e.g. C12). But of course the newly created SD card is clean, i.e. no fsck necesaary at all.

BTW, my original SD card seems to be completely broken. It worked fine till my reboot in the morning. But when powering up again all data was lost - the SD card cannot be formatted at all.

Howto “convince” my pi4 to accept my backup?

You might be better off doing a fresh install and then rsyncing everything back.

I do have an older copy on a spare SD card, and that is already working again. [BTW: Even my hardware changes were successful - the root cause of my boot.]

But of course I’d like to fix somehow my broken backup. It contains many changes, and my backup strategy should work. What might be missing/wrong?

See here a list of commands that I used from my linux laptop to setup the new SD card:

sudo parted /dev/sdc --script -- mklabel gpt
sudo parted /dev/sdc --script -- \
   mkpart boot fat32 8192s 647168s
sudo parted /dev/sdc --script -- \
    mkpart usr ext4 655360s 100%
sudo mkfs.vfat /dev/sdc1
sudo mkfs.ext4 /dev/sdc2
sudo mount /dev/sdc1 /mnt
sudo rsync -avxHAXU \
   ${backupdir}/${timestamp}/boot/ /mnt
sudo umount /mnt
sudo mount /dev/sdc2 /mnt
sudo rsync -avxHAXU \
   ${backupdir}/${timestamp}/usr/ /mnt

parted version 3.6 (no parted on osmc by default)
mkfs.ext4 version 1.47.0 (osmc uses 1.46.2)
mkfs.vfat (no version information)

Or might rsync corrupt somehow e.g. the initram file?

Regards, Michael

Unless you specifically customised the kernel or firmware, I don’t think you need to touch /boot at all.

Within /boot I only did change config-user.txt (e.g. today I enabled i2c). Thus it might be safer to backup /boot, too.

I do have a secondary backup possibility. Based upon my SSD backup I can (automatically) redo all my changes (like mounting, apt installation, configuration files) running my big bash script fullsetup.sh on top of any fresh SD card being loaded with some default image (e.g. osmc). That is probabely my best chance to recreate my setup (and would test that script in real life:-).

Do you think that different tool versions for parted/mkfs might trigger my problem?

No – should not be the case.

What about missing LABEL information? My cloned SD card does not have LABEL resp. LABEL_FATBOOT? I could set them by
fatlabel /dev/sdc1 OSMCInstall
Instead (just for my pleasure) I did set a PARTLABEL. Might it disturb?

BTW, I’ve discovered many people having problems with rsync’ed SD cards. Mostly due to mismatch of UUIDs. But they are neither used within /etc/fstab nor within /boot/cmdline.txt. But maybe within kernel.img?

There ARE differences between user IDs (e.g. daemon) between osmc and tumbleweed linux. But rsync seems to retain all file attributes as far as I can tell.

For now that is only used so a user can identify the OSMC media when it’s inserted. We do plan to use label based partitioning in the future however.

Heureka - I could resolve my problem!

There is really an incompatibility between different versions of ext4. And to be honest - that was the error displayed during my failing boots: Unsupported feature C12 - use a more recent e2fsck. Today I googled for that error and found [BUG]: e2fsck has unsupported feature(s): FEATURE_C12 · Issue #229450 · NixOS/nixpkgs · GitHub

Following that hint I could revive my most recent backup (from yesterday).

But this feature C12 is really annoying. To recreate a fresh SD card I did plug my raspi SSD onto my linux laptop. And by miracle it got feature C12, too - simply by mounting!

Thus I’d highly recommend/wish to update e2fsck within osmc to become version 1.47.0 (now 1.46.2 is provided by current installation of osmc). I’ll check if I might do that on my own (using apt).

Independently I encountered problems due to renaming of /dev/sd? when I plug/unplug USB disks. Each time when I plugin my card reader my SSD changed its sd letter from sda to sdb. I guess that’s a kind of feature. I’d like to disable that kind of automounting.

Regards, Michael

Addendum from above link: To disable feature C12 use

tune2fs -O ^orphan_file /dev/mydevice
e2fsck -f /dev/mydevice

We track the Debian version. So it will be updated when we update Debian.