1
-
2
1
## rpi-clone
3
-
4
2
Version 2 is a complete rewrite with improved capability over
5
3
the original. See the examples below.
6
4
@@ -162,9 +160,64 @@ clone. You will get a readlink stat error from rsync because root can't access
162
160
a users FUSE mount - only the user can.
163
161
164
162
## 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
+
165
216
#### 1) First clone to a new SD card in USB card reader
166
217
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
168
221
disk sda plugged in. Look in /proc/partitions to see where yours is.
169
222
The destination disk does not have partition types matching the booted disk.
170
223
+ The clone will be an initialize because of partition types mismatch.
@@ -175,8 +228,9 @@ so I can keep track of my clones.
175
228
+ If PARTUUID is used in fstab and cmdline.txt, those files will be edited
176
229
to use the PARTUUID of the destination SD card. The SD card will
177
230
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.
180
234
```
181
235
pi@rpi0: $ sudo rpi-clone sdb
182
236
@@ -521,7 +575,7 @@ I'm using PARTUUID in /etc/fstab, but if I weren't, this clone would also
521
575
automatically edit mmcblk0p names into the destination disk fstab.
522
576
523
577
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
525
579
With an initialize clone to the SD card done in example 8, I expect
526
580
subsequent clones to be sync clones. But I run the rpi-clone command and
527
581
I get an error requiring another initialize. This time the
@@ -541,7 +595,8 @@ Initialize required : partition 3 /home/pi/media - destination missing.
541
595
: Unmount source partitions or use -m
542
596
-----------------------:
543
597
```
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.
545
600
If I unmount the third partition, the clone will sync. If I don't want
546
601
to do that, I can tell rpi-clone to sync clone only the /boot partition
547
602
(the root partition is included by default):
0 commit comments