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.
This commit is contained in:
Bill Wilson
2019-08-26 17:30:06 -05:00
parent 7ac40602cd
commit 3c5d373022
2 changed files with 7 additions and 6 deletions

View File

@@ -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

View File

@@ -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=""