Skip to content

Commit 3c5d373

Browse files
committed
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.
1 parent 7ac4060 commit 3c5d373

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## rpi-clone
2-
Latest version: 2.0.21
2+
Latest version: 2.0.22
33

44
Version 2 is a complete rewrite with improved capability over
55
the original. See the examples below.
@@ -111,6 +111,7 @@ usage: sys-clone sdN {-v|--verbose} {-f|--force-initialize} {-f2}
111111
{-L|--label-partitions label} {-l|--leave-sd-usb-boot}
112112
{-a|--all-sync} {-F|--Force-sync} {-x} {-V|--version}
113113
{--convert-fstab-to-partuuid}
114+
{--exclude=PATTERN} {--exclude-from=FILE}
114115
115116
-v - verbose rsync, list all files as they are copied.
116117
-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}
137138
the custom list will be synced instead of the default of all
138139
mounted directories. The root directory is always synced.
139140
Not for when initializing.
140-
-L lbl - label for ext type partitions. If 'lbl' ends with #, replace
141-
the # with a partition number and label all ext partitions.
141+
-L lbl - label for ext type partitions. If 'lbl' ends with '#', replace
142+
the '#' with a partition number and label all ext partitions.
142143
Otherwise apply label to root partition only.
143144
-l - leave SD card to USB boot alone when cloning to SD card mmcblk0
144145
from a USB boot. This preserves a SD card to USB boot setup

rpi-clone

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# https://github.com/billw2/rpi-clone
99

1010

11-
version=2.0.21
11+
version=2.0.22
1212

1313
# auto run grub-install if grub detected
1414
grub_auto=1
@@ -583,8 +583,8 @@ get_src_disk()
583583

584584
# ==== source (booted) disk info and default mount list
585585
#
586-
src_boot_dev=`findmnt /boot -o source -n`
587-
src_root_dev=`findmnt / -o source -n`
586+
src_boot_dev=`findmnt /boot -o source -n | grep "/dev/"`
587+
src_root_dev=`findmnt / -o source -n | grep "/dev/"`
588588
SD_slot_boot=0
589589
SD_slot_dst=0
590590
src_part_base=""

0 commit comments

Comments
 (0)