Skip to content

Commit dd5e4d6

Browse files
committed
Add quick guide to examples in README.md
1 parent 5882f69 commit dd5e4d6

File tree

1 file changed

+62
-7
lines changed

1 file changed

+62
-7
lines changed

README.md

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
21
## rpi-clone
3-
42
Version 2 is a complete rewrite with improved capability over
53
the original. See the examples below.
64

@@ -162,9 +160,64 @@ clone. You will get a readlink stat error from rsync because root can't access
162160
a users FUSE mount - only the user can.
163161

164162
## rpi-clone Example Runs
163+
#### 0) Examples review - a quick guide to what the examples cover in detail.
164+
1. Typical two partition clones - SD card or USB disk to USB disk:
165+
```
166+
$ rpi-clone sda
167+
```
168+
2. USB boot - clone back to SD card slot:
169+
```
170+
$ rpi-clone mmcblk0
171+
```
172+
3. Clone to USB disk intended for use as a standalone Pi3 bootable
173+
disk. No special rpi-clone args are required.
174+
4. SD card to USB disk clone to create a SD card to USB boot setup:
175+
```
176+
If fstab uses PARTUUID:
177+
$ rpi-clone -l sda
178+
If fstab uses device names:
179+
$ rpi-clone -l sda -e sda
180+
```
181+
5. USB boot clone back to SD card slot that preserves SD card to USB boot setup:
182+
```
183+
$ rpi-clone -l mmcblk0
184+
```
185+
6. Attempted clone to a disk that is too small.
186+
7. Manually partition a disk with three partitions so it can
187+
be cloned to from a two partition boot.
188+
8. Clone from three partition disk to smaller disk large enough
189+
to hold the source three partitions.
190+
```
191+
$ rpi-clone sdb
192+
```
193+
9. Clone from three partition disk to smaller disk (sdN or mmcblk0)
194+
not large enough to hold the source three partitions.
195+
A first initialize clone forces a clone of only the first two partitions:
196+
```
197+
$ rpi-clone sdb -f2
198+
```
199+
10. Subsequent sync clones from three partition disk to two partition
200+
disk (sdN or mmcblk0):
201+
```
202+
If the source third partition is not mounted:
203+
$ rpi-clone sdb
204+
If the source third partition is mounted, select partitions to clone:
205+
$ rpi-clone sdb -m /boot
206+
```
207+
**Note** - if a larger USB disk is manually partitioned to create more than
208+
three partitions as in example 7, a smaller disk can be initialize
209+
cloned to only if it is large enough to hold at least part of the last
210+
source partition.
211+
If it is not, then the clone will have to be to a two partition -f2
212+
clone or a clone to a manually partitioned destination. So, for a
213+
multi partition disk, select partition number and sizes with a eye
214+
towards how you will be cloning back to smaller disks.
215+
165216
#### 1) First clone to a new SD card in USB card reader
166217
In this example a new SD card in a USB card reader has been plugged in
167-
that I want to clone to. It shows up as sdb because I have another USB
218+
that I want to clone to, but it could also be to a USB disk or from a
219+
USB disk back to the SD card slot.
220+
In this case, the disk showed up as sdb because I have another USB
168221
disk sda plugged in. Look in /proc/partitions to see where yours is.
169222
The destination disk does not have partition types matching the booted disk.
170223
+ The clone will be an initialize because of partition types mismatch.
@@ -175,8 +228,9 @@ so I can keep track of my clones.
175228
+ If PARTUUID is used in fstab and cmdline.txt, those files will be edited
176229
to use the PARTUUID of the destination SD card. The SD card will
177230
bootable when plugged in to the SD card slot.
178-
+ If fstab and cmdline.txt use device names (mmcblk0), then no edits are
179-
necessary and the card will be bootable when plugged into a SD card slot.
231+
+ If fstab and cmdline.txt use device names (mmcblk0), then rpi-clone
232+
does need to edit and the card will be bootable when plugged
233+
into a SD card slot.
180234
```
181235
pi@rpi0: $ sudo rpi-clone sdb
182236
@@ -521,7 +575,7 @@ I'm using PARTUUID in /etc/fstab, but if I weren't, this clone would also
521575
automatically edit mmcblk0p names into the destination disk fstab.
522576

523577

524-
#### 9) Sync Clone 64GB USB disk with extra partitions to 16GB SD card
578+
#### 10) Sync Clone 64GB USB disk with extra partitions to 16GB SD card
525579
With an initialize clone to the SD card done in example 8, I expect
526580
subsequent clones to be sync clones. But I run the rpi-clone command and
527581
I get an error requiring another initialize. This time the
@@ -541,7 +595,8 @@ Initialize required : partition 3 /home/pi/media - destination missing.
541595
: Unmount source partitions or use -m
542596
-----------------------:
543597
```
544-
But I want to sync and not do a long initialize, so there are two choices.
598+
But I want to sync and not do another long -f2 initialize,
599+
so there are two choices.
545600
If I unmount the third partition, the clone will sync. If I don't want
546601
to do that, I can tell rpi-clone to sync clone only the /boot partition
547602
(the root partition is included by default):

0 commit comments

Comments
 (0)