1
1
#! /bin/bash
2
2
3
- version=2.0.6
3
+ version=2.0.7
4
4
5
5
# auto run grub-install if grub detected
6
6
grub_auto=1
969
969
done
970
970
971
971
fs_match=1
972
- root_part_match=1
973
- first_mismatch= " "
972
+ root_part_match=0
973
+ first_part_mismatch=0
974
974
975
975
initialize=$(( force_initialize))
976
976
992
992
then
993
993
tmp_match=1
994
994
fi
995
+ if (( tmp_match && p == root_part_num))
996
+ then
997
+ root_part_match=1
998
+ fi
995
999
if (( ! tmp_match)) && (( src_sync_part[p]))
996
1000
then
997
- if (( ! force_initialize))
998
- then
999
- if (( p <= root_part_num))
1000
- then
1001
- first_mismatch=" - types mismatch"
1002
- root_part_match=0
1003
- else
1004
- first_mismatch=" $p ${src_mounted_dir[p]} - destination missing"
1005
- fi
1006
- fi
1001
+ first_part_mismatch=$p
1007
1002
fs_match=0
1008
1003
break
1009
1004
fi
@@ -1100,28 +1095,22 @@ Use -U for unattended even if initializing.
1100
1095
1101
1096
if (( last_part_sectors < 7812 ))
1102
1097
then
1103
- if [ " $first_mismatch " != " " ]
1098
+ printf " %-22s : %s\n" " ** FATAL **" " destination disk is too small."
1099
+ readable $(( start_sector + 7812 )) " 512" min_size
1100
+ printf " %-22s : %s\n" " " \
1101
+ " Minimum destination disk size is $min_size "
1102
+ if (( root_part_match && first_part_mismatch > root_part_num))
1104
1103
then
1105
- printf " %-22s : %s\n" " Initialize required" \
1106
- " partition $first_mismatch ."
1107
- if (( root_part_match))
1108
- then
1109
- printf " %-22s : %s\n" " " \
1110
- " Unmount source partitions or use -m"
1111
- else
1112
- readable $(( start_sector + 7812 )) " 512" min_size
1113
- printf " %-22s : %s\n" " " \
1114
- " The minimum destination disk size is $min_size "
1115
- printf " %-22s : %s\n" " " \
1116
- " The destination disk is too small."
1117
- if (( n_src_parts > 2 ))
1118
- then
1119
- printf " %-22s : %s\n" " " \
1120
- " You could try a two partition -f2 clone."
1121
- fi
1122
- fi
1123
- printf " %-23s:\n" " -----------------------"
1104
+ printf " %-22s : %s\n" " " \
1105
+ " Try unmounting source partitions or use -m"
1106
+ elif (( n_src_parts > 2 ))
1107
+ then
1108
+ printf " %-22s : %s\n" " " \
1109
+ " You could try a two partition -f2 clone if it"
1110
+ printf " %-22s : %s\n" " " \
1111
+ " is OK not to clone partitions above 2."
1124
1112
fi
1113
+ printf " %-23s:\n" " -----------------------"
1125
1114
exit 1
1126
1115
fi
1127
1116
@@ -1146,8 +1135,8 @@ Use -U for unattended even if initializing.
1146
1135
" is too small to hold source used $used_readable ."
1147
1136
if [ " $n_image_parts " == " $root_part_num " ] && (( ! force_sync))
1148
1137
then
1149
- printf " %-22s : %s\n" " " \
1150
- " This is the root partition, so aborting!"
1138
+ printf " %-22s : %s\n" " ** FATAL ** " \
1139
+ " This is the root partition, so aborting!"
1151
1140
printf " %-22s : %s\n" " " \
1152
1141
" Use -F to override."
1153
1142
abort=1
0 commit comments