From 3c5d373022b6dbed6c07c2085a59294abef02745 Mon Sep 17 00:00:00 2001 From: Bill Wilson Date: Mon, 26 Aug 2019 17:30:06 -0500 Subject: [PATCH] Check for /dev/ in findmnt results for source /boot and root There can be multiple findmnt lines (eg systemd and /dev/...) for /boot on some systems and the device /dev entry is the one needed. So grep for /dev/ on those findmnt results. --- README.md | 7 ++++--- rpi-clone | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bf73cf2..c608a83 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## rpi-clone -Latest version: 2.0.21 +Latest version: 2.0.22 Version 2 is a complete rewrite with improved capability over the original. See the examples below. @@ -111,6 +111,7 @@ usage: sys-clone sdN {-v|--verbose} {-f|--force-initialize} {-f2} {-L|--label-partitions label} {-l|--leave-sd-usb-boot} {-a|--all-sync} {-F|--Force-sync} {-x} {-V|--version} {--convert-fstab-to-partuuid} + {--exclude=PATTERN} {--exclude-from=FILE} -v - verbose rsync, list all files as they are copied. -f - force initialize the destination disk by imaging the booted disk @@ -137,8 +138,8 @@ usage: sys-clone sdN {-v|--verbose} {-f|--force-initialize} {-f2} the custom list will be synced instead of the default of all mounted directories. The root directory is always synced. Not for when initializing. - -L lbl - label for ext type partitions. If 'lbl' ends with #, replace - the # with a partition number and label all ext partitions. + -L lbl - label for ext type partitions. If 'lbl' ends with '#', replace + the '#' with a partition number and label all ext partitions. Otherwise apply label to root partition only. -l - leave SD card to USB boot alone when cloning to SD card mmcblk0 from a USB boot. This preserves a SD card to USB boot setup diff --git a/rpi-clone b/rpi-clone index e14543b..98f3c94 100755 --- a/rpi-clone +++ b/rpi-clone @@ -8,7 +8,7 @@ # https://github.com/billw2/rpi-clone -version=2.0.21 +version=2.0.22 # auto run grub-install if grub detected grub_auto=1 @@ -583,8 +583,8 @@ get_src_disk() # ==== source (booted) disk info and default mount list # -src_boot_dev=`findmnt /boot -o source -n` -src_root_dev=`findmnt / -o source -n` +src_boot_dev=`findmnt /boot -o source -n | grep "/dev/"` +src_root_dev=`findmnt / -o source -n | grep "/dev/"` SD_slot_boot=0 SD_slot_dst=0 src_part_base=""