I have found that during the backup, I sometimes the following error in the logs:
Taking a raw partition copy, be prepared this may take long such as 20-30 minutes for a 16 GB SD card
FAILED (set random UUID)
mount: /storage/syncmount: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error.
sed: can't read /storage/syncmount/etc/fstab: No such file or directory
umount: /storage/syncmount: not mounted.
OK (dirty bit on fsck /dev/sda2 is normal)
When this happens, I am not able to boot from the backup micro-SD card.
However, I am still able to mount the created partitions after executing the backup script on my Pi. I then see that the partUUIDs are incorrect:
The partUUID of the partitions is not correctly set in /etc/fstab and /boot/cmdline.txt. Which makes sense, because looking at the backup script here in function mirror_SD(), the mounting is necessary to do the string-replace to set the partUUID.
However, I find it strange that I am able to mount the partitions after running the script, but mounting fails during execution of the backup-script. Is there an explanation for this?
Also, the micro-SD card boots without issues, when the above error does not occur …