Skip to content

Commit fb2c8cf

Browse files
authored
Merge pull request #54 from framps/RPi5Addon
Remount missing mounts of /boot and /
2 parents d2f8296 + dd5aeab commit fb2c8cf

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

rpi-clone

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
# This updated code is located in a fork of Bill Wilson's git repository
1111
# at https://github.com/geerlingguy/rpi-clone
1212

13-
version=2.0.24
13+
version=2.0.25
14+
15+
# prefix debug statements with line numbers when -x is used
16+
declare -r PS4='|${LINENO}> \011${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
1417

1518
# setup trusted paths for dependancies (like rsync, grub, fdisk, etc)
1619
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
@@ -294,6 +297,19 @@ rsync_file_system()
294297

295298
qprintf " => rsync $1 $2 $3 ..."
296299

300+
# make sure the partition is mounted
301+
# sometimes it happens on RPi5 /boot is no longer mounted and then
302+
# the cloned boot partition will be empty
303+
if ! findmnt "$src_dir" &>/dev/null; then
304+
if ! mount "$src_dir"; then
305+
echo "??? Remount failure of $1."
306+
echo "Aborting!"
307+
exit 1
308+
else
309+
qecho " Remounting $1"
310+
fi
311+
fi
312+
297313
if [ "$3" == "with-root-excludes" ]
298314
then
299315
rsync $rsync_options --delete \

0 commit comments

Comments
 (0)