I picked out the relevant lines in image-backup, and found the following:On a non-encrypted system this looks like:I haven't looked at the code closely, but it appears that image-backup would need to be slightly encrypted rootfs-aware, recognizing that the rootfs was "/dev/mapper/something", and looking in /etc/crypttab to get the device name of the physical rootfs (dev/sda2 in my example above), and use that appropriately in the partition type test.
It looks like a relatively straightforward fix that I'll leave as an exercise to the reader, er, RonR. If he's interested in fixing it, of course.
Code:
#!/bin/bashROOT_PART="$(mount | sed -n 's|^\(/dev/.*\) on / .*|\1|p')"echo "ROOT_PART: $ROOT_PART"ROOT_DEV_P="$(sed 's/[0-9]\+$//' <<< "${ROOT_PART}")"echo "ROOT_DEV_P: $ROOT_DEV_P"ROOT_DEV="${ROOT_DEV_P}"echo "ROOT_DEV: $ROOT_DEV"if [ "${ROOT_DEV}" = "/dev/mmcblk0p" ]; then ROOT_DEV="${ROOT_DEV:0:(${#ROOT_DEV} - 1)}"fiROOT_TYPE=$(blkid "${ROOT_PART}" | sed -n 's|^.*TYPE="\(\S\+\)".*|\1|p')echo "ROOT_TYPE: $ROOT_TYPE"PTTYPE="$(blkid "${ROOT_DEV}" | sed -n 's|^.*PTTYPE="\(\S\+\)".*|\1|p')"echo "PTTYPE: $PTTYPE"exitpt/usr/local/bin$ sudo image-backup ROOT_PART: /dev/mapper/cryptrootROOT_DEV_P: /dev/mapper/cryptrootROOT_DEV: /dev/mapper/cryptrootROOT_TYPE: ext4PTTYPE: pt/usr/local/bin$ sudo blkid /dev/mapper/cryptroot /dev/mapper/cryptroot: LABEL="rootfs" UUID="7909438b-2884-423e-aa05-577fdea75c97" BLOCK_SIZE="4096" TYPE="ext4"Code:
pw/ssdy/work$ sudo image-backup ROOT_PART: /dev/sda2ROOT_DEV_P: /dev/sdaROOT_DEV: /dev/sdaROOT_TYPE: ext4PTTYPE: dospw/ssdy/work$ sudo blkid /dev/sda2/dev/sda2: LABEL="rootfs" UUID="7909438b-2884-423e-aa05-577fdea75c97" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d78da623-02"It looks like a relatively straightforward fix that I'll leave as an exercise to the reader, er, RonR. If he's interested in fixing it, of course.
Statistics: Posted by bls — Tue Jan 23, 2024 8:50 pm