Skip to content

Commit 5294c9b

Browse files
Create mount directories earlier
The `$clone` directory is already used when figuring out disk space for unmounted partitions, so this could fail on the first run.
1 parent f431909 commit 5294c9b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

rpi-clone

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,15 @@ then
993993
exit 0
994994
fi
995995

996+
if [ ! -d $clone ]
997+
then
998+
mkdir $clone
999+
fi
1000+
if [ ! -d $clone_src ]
1001+
then
1002+
mkdir $clone_src
1003+
fi
1004+
9961005
# dst_mount_flag enumerations:
9971006
live=1
9981007
temp=2
@@ -1248,16 +1257,6 @@ unmount_or_abort "$mounted_dev" \
12481257
mounted_dev=$(findmnt /mnt -o source -n)
12491258
unmount_or_abort "$mounted_dev" "$mounted_dev is currently mounted on /mnt."
12501259

1251-
1252-
if [ ! -d $clone ]
1253-
then
1254-
mkdir $clone
1255-
fi
1256-
if [ ! -d $clone_src ]
1257-
then
1258-
mkdir $clone_src
1259-
fi
1260-
12611260
# Do not include a dhpys swapfile in rsync. It regenerates at boot.
12621261
#
12631262
if [ -f /etc/dphys-swapfile ]

0 commit comments

Comments
 (0)