Adjusted some error messages and fixed README typos
This commit is contained in:
12
README.md
12
README.md
@@ -103,7 +103,7 @@ creating clone backup disks for a desktop.
|
||||
To get a usage screen showing available options,
|
||||
run rpi-clone without any arguments:
|
||||
```
|
||||
pi@rpi0: $ sudo ./rpi-clone
|
||||
pi@rpi0: $ sudo rpi-clone
|
||||
No destination disk given.
|
||||
|
||||
usage: rpi-clone sdN {-v|--verbose} {-f|--force-initialize} {-f2}
|
||||
@@ -155,6 +155,10 @@ names to PARTUUID. This is a helper if you wish to convert to PARTUUID as
|
||||
is standard in recent Raspbian distributions. After running, PARTUUID
|
||||
usage will propagate to subsequent clones. This changes the booted fstab
|
||||
and cmdline.txt, so have a backup first.
|
||||
+ FUSE mounts (ssh mounts) should be unmounted before cloning or else the
|
||||
directory mounted on will not stat and the directory will not be made on the
|
||||
clone. You will get a readlink stat error from rsync because root can't access
|
||||
a users FUSE mount - only the user can.
|
||||
|
||||
## rpi-clone Example Runs
|
||||
#### 1) First clone to a new SD card in USB card reader
|
||||
@@ -173,7 +177,7 @@ bootable when plugged in to the SD card slot.
|
||||
+ If fstab and cmdline.txt use device names (mmcblk0), then no edits are
|
||||
necessary and the card will be bootable when plugged into a SD card slot.
|
||||
```
|
||||
pi@rpi0: $ sudo ./rpi-clone sdb
|
||||
pi@rpi0: $ sudo rpi-clone sdb
|
||||
|
||||
Booted disk: mmcblk0 16.0GB Destination disk: sdb 8.0GB
|
||||
---------------------------------------------------------------------------
|
||||
@@ -206,7 +210,7 @@ different destination disk hostname.
|
||||
+ The setup script will set the hostnames in the destination disk files
|
||||
/etc/hostname and /etc/hosts to what I give with -s, in this case rpi2.
|
||||
```
|
||||
pi@rpi0: $ sudo ./rpi-clone sdb -s rpi2
|
||||
pi@rpi0: $ sudo rpi-clone sdb -s rpi2
|
||||
|
||||
Booted disk: mmcblk0 16.0GB Destination disk: sdb 8.0GB
|
||||
---------------------------------------------------------------------------
|
||||
@@ -561,7 +565,7 @@ partition I might use later and an extended partition with two logical
|
||||
partitions. I run rpi-clone from a SD card boot and it will sync only
|
||||
the first two partitions:
|
||||
```
|
||||
pi@rpi0: $ sudo ./rpi-clone sdc
|
||||
pi@rpi0: $ sudo rpi-clone sdc
|
||||
|
||||
Booted disk: mmcblk0 16.0GB Destination disk: sdc 160.0GB
|
||||
---------------------------------------------------------------------------
|
||||
|
59
rpi-clone
59
rpi-clone
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
version=2.0.6
|
||||
version=2.0.7
|
||||
|
||||
# auto run grub-install if grub detected
|
||||
grub_auto=1
|
||||
@@ -969,8 +969,8 @@ do
|
||||
done
|
||||
|
||||
fs_match=1
|
||||
root_part_match=1
|
||||
first_mismatch=""
|
||||
root_part_match=0
|
||||
first_part_mismatch=0
|
||||
|
||||
initialize=$((force_initialize))
|
||||
|
||||
@@ -992,18 +992,13 @@ do
|
||||
then
|
||||
tmp_match=1
|
||||
fi
|
||||
if ((tmp_match && p == root_part_num))
|
||||
then
|
||||
root_part_match=1
|
||||
fi
|
||||
if ((!tmp_match)) && ((src_sync_part[p]))
|
||||
then
|
||||
if ((!force_initialize))
|
||||
then
|
||||
if ((p <= root_part_num))
|
||||
then
|
||||
first_mismatch="- types mismatch"
|
||||
root_part_match=0
|
||||
else
|
||||
first_mismatch="$p ${src_mounted_dir[p]} - destination missing"
|
||||
fi
|
||||
fi
|
||||
first_part_mismatch=$p
|
||||
fs_match=0
|
||||
break
|
||||
fi
|
||||
@@ -1100,28 +1095,22 @@ Use -U for unattended even if initializing.
|
||||
|
||||
if ((last_part_sectors < 7812))
|
||||
then
|
||||
if [ "$first_mismatch" != "" ]
|
||||
printf "%-22s : %s\n" "** FATAL **" "destination disk is too small."
|
||||
readable $((start_sector + 7812)) "512" min_size
|
||||
printf "%-22s : %s\n" " " \
|
||||
" Minimum destination disk size is $min_size"
|
||||
if ((root_part_match && first_part_mismatch > root_part_num))
|
||||
then
|
||||
printf "%-22s : %s\n" "Initialize required" \
|
||||
"partition $first_mismatch."
|
||||
if ((root_part_match))
|
||||
then
|
||||
printf "%-22s : %s\n" " " \
|
||||
" Unmount source partitions or use -m"
|
||||
else
|
||||
readable $((start_sector + 7812)) "512" min_size
|
||||
printf "%-22s : %s\n" " " \
|
||||
" The minimum destination disk size is $min_size"
|
||||
printf "%-22s : %s\n" " " \
|
||||
" The destination disk is too small."
|
||||
if ((n_src_parts > 2))
|
||||
then
|
||||
printf "%-22s : %s\n" " " \
|
||||
" You could try a two partition -f2 clone."
|
||||
fi
|
||||
fi
|
||||
printf "%-23s:\n" "-----------------------"
|
||||
printf "%-22s : %s\n" " " \
|
||||
" Try unmounting source partitions or use -m"
|
||||
elif ((n_src_parts > 2))
|
||||
then
|
||||
printf "%-22s : %s\n" " " \
|
||||
" You could try a two partition -f2 clone if it"
|
||||
printf "%-22s : %s\n" " " \
|
||||
" is OK not to clone partitions above 2."
|
||||
fi
|
||||
printf "%-23s:\n" "-----------------------"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1146,8 +1135,8 @@ Use -U for unattended even if initializing.
|
||||
" is too small to hold source used $used_readable."
|
||||
if [ "$n_image_parts" == "$root_part_num" ] && ((!force_sync))
|
||||
then
|
||||
printf "%-22s : %s\n" "" \
|
||||
" This is the root partition, so aborting!"
|
||||
printf "%-22s : %s\n" "** FATAL **" \
|
||||
"This is the root partition, so aborting!"
|
||||
printf "%-22s : %s\n" "" \
|
||||
" Use -F to override."
|
||||
abort=1
|
||||
|
Reference in New Issue
Block a user