Skip to content

Commit bffda28

Browse files
committed
Change some error messages and README examples.
1 parent 7087dae commit bffda28

File tree

2 files changed

+19
-90
lines changed

2 files changed

+19
-90
lines changed

README.md

Lines changed: 10 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
## rpi-clone
23

34
Version 2 is a complete rewrite with improved capability over
@@ -457,6 +458,15 @@ Verbose mode : no
457458
458459
Initialize and clone to the destination disk sdb? (yes/no):
459460
```
461+
Note that if I had partitioned the 64GB disk with more than three
462+
partitions it would have been more difficult to clone down to the
463+
32GB card. If there had been 4 partitions, then a smaller disk has
464+
to be large enough to image the sizes of the first three source partitions.
465+
If the disk is too small for that, then an initilize clone would be
466+
limited to a two partition clone as the next example shows. The other
467+
alternative would be a manual partition. The take away is that you need
468+
to consider how you would be cloning to smaller disks when you partition
469+
a larger disk for a Pi.
460470

461471
#### 9) Clone 64GB USB disk with extra partitions to new 16GB SD card
462472
With a USB boot, the SD card slot is available for use, so I plugged in
@@ -556,86 +566,6 @@ Verbose mode : no
556566
Ok to proceed with the clone? (yes/no):
557567
```
558568

559-
560-
561-
#### 10) Cloning to manually partitioned hard drive with swap and extended partitions
562-
This is an additional demonstration of flexibility in partition structure
563-
when partitions are manually created. The manual partition included a swap
564-
partition I might use later and an extended partition with two logical
565-
partitions. I run rpi-clone from a SD card boot and it will sync only
566-
the first two partitions:
567-
```
568-
pi@rpi0: $ sudo rpi-clone sdc
569-
570-
Booted disk: mmcblk0 16.0GB Destination disk: sdc 160.0GB
571-
---------------------------------------------------------------------------
572-
Part Size FS Label Part Size FS Label
573-
1 /boot 58.4MB fat16 -- 1 104.4MB fat16 --
574-
2 root 16.0GB ext4 SD-RPI-s1 2 34.4GB ext4 --
575-
3 10.7GB swap --
576-
4 114.8GB EXT --
577-
5 53.7GB ext4 --
578-
6 61.1GB ext4 --
579-
---------------------------------------------------------------------------
580-
== SYNC mmcblk0 file systems to sdc ==
581-
/boot (22.5MB used) : SYNC to sdc1 (104.4MB size)
582-
/ (6.0GB used) : SYNC to sdc2 (34.4GB size)
583-
---------------------------------------------------------------------------
584-
Run setup script : no
585-
Verbose mode : no
586-
-----------------------:
587-
588-
Ok to proceed with the clone? (yes/no):
589-
```
590-
After running this command, I powered down the Pi, removed the SD card
591-
and powered back on into a hard drive boot. I had previously boot
592-
enabled the Pi3.
593-
594-
595-
596-
#### 11) USB disk clone to large USB disk
597-
A final example shows a clone from the hard drive set up
598-
in example 11 to another hard drive. For this example I'm
599-
plugging in a drive I happen to use for backing up my desktop,
600-
so the partition types won't match and rpi-clone will want to do an
601-
initialize. rpi-clone duplicates the partition structure and makes
602-
the swap partition. This example gives a clue
603-
how rpi-clone would work if run on a Linux desktop.
604-
```
605-
pi@rpi0: ~$ sudo rpi-clone sda
606-
607-
Booted disk: sdb 160.0GB Destination disk: sda 320.1GB
608-
---------------------------------------------------------------------------
609-
Part Size FS Label Part Size FS Label
610-
1 /boot 104.4MB fat16 -- 1 52.4GB ext4 --
611-
2 root 34.4GB ext4 -- 2 52.4GB ext4 gkrellm6-p2
612-
3 10.7GB swap -- 3 12.6GB swap --
613-
4 114.8GB EXT -- 4 202.6GB EXT --
614-
5 /mnt/mnt 53.7GB ext4 -- 5 167.8GB ext4 gkrellm6-p5
615-
6 61.1GB ext4 -- 6 34.9GB ext4 --
616-
---------------------------------------------------------------------------
617-
== Initialize: IMAGE sdb partition table to sda - FS types mismatch ==
618-
1 /boot (21.5MB used) : IMAGE to sda1 FSCK
619-
2 root (6.0GB used) : MKFS SYNC to sda2
620-
3 : MKSWAP
621-
4 :
622-
5 /mnt/mnt (54.3MB used) : MKFS SYNC to sda5
623-
6 (1.9GB used) : RESIZE(221.2GB) MKFS SYNC to sda6
624-
---------------------------------------------------------------------------
625-
Run setup script : no
626-
Verbose mode : no
627-
-----------------------:
628-
** WARNING ** : All destination disk sda data will be overwritten!
629-
: The partition structure will be imaged from sdb.
630-
-----------------------:
631-
632-
Initialize and clone to the destination disk sda? (yes/no):
633-
```
634-
If I do this initialize clone then the next time I clone to the disk
635-
it will be a sync clone and will only want to sync whatever partitions
636-
happen to be mounted. But there is a "-a" option to rpi-clone that
637-
will make it clone all partitions even if unmounted.
638-
639569
## Author
640570
Bill Wilson
641571
billw--at--gkrellm.net

rpi-clone

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,20 +1095,19 @@ Use -U for unattended even if initializing.
10951095

10961096
if ((last_part_sectors < 7812))
10971097
then
1098-
printf "%-22s : %s\n" "** FATAL **" "destination disk is too small."
1098+
printf "%-22s : %s\n" "** FATAL **" \
1099+
"Initialize required - $reason."
1100+
printf "%-22s : %s\n" "" \
1101+
" But destination is too small. To image partition"
10991102
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))
1103-
then
1104-
printf "%-22s : %s\n" " " \
1105-
" Try unmounting source partitions or use -m"
1106-
elif ((n_src_parts > 2))
1103+
printf "%-22s : %s\n" "" \
1104+
" source sizes, minimum destination size is $min_size."
1105+
if ((n_src_parts > 2))
11071106
then
11081107
printf "%-22s : %s\n" " " \
1109-
" You could try a two partition -f2 clone if it"
1108+
" Options: try a two partition clone with -f2, or"
11101109
printf "%-22s : %s\n" " " \
1111-
" is OK not to clone partitions above 2."
1110+
" manually create custom partitions that can work."
11121111
fi
11131112
printf "%-23s:\n" "-----------------------"
11141113
exit 1

0 commit comments

Comments
 (0)