@@ -85,18 +85,27 @@ add them to the rpi-clone-setup script.
85
85
$ sudo cp rpi-clone-setup /usr/local/sbin/sys-clone-setup
86
86
```
87
87
88
- If your other OS is a SD card booted system, it will possibly work.
88
+ If your other OS is a SD card booted system, it will possibly work because
89
+ an initialize clone images a first /boot partition.
89
90
However it currently does not work for emmc booted devices.
90
91
91
- rpi-clone does not directly support usage on a desktop OS.
92
- However, I do use it with my Debian desktop because my setup script
93
- handles my /etc/grub.d/ custom menus and fstab, and the script runs
94
- grub_install. rpi-clone does handle editing of
95
- PARTUUID values in /etc/fstab, but a customized setup script for
96
- a desktop might need to handle file system UUID values or device
97
- name editing in /etc/fstab and the bootloader config. If these possible
98
- issues are handled in a setup script, then rpi-clone should work fine
99
- creating clone backup disks for a desktop.
92
+ rpi-clone does not directly support usage on a desktop OS because there
93
+ are different possible bootloaders and while device names or PARTUUID
94
+ are handled for /etc/fstab, UUID is not handled.
95
+ However, it works for me and I use rpi-clone renamed as sys-clone on
96
+ my Debian desktop because I use PARTUUID in my fstab and I use the grub
97
+ bootloader (rpi-clone will run grub-install if it detects it installed
98
+ and there is a /boot/grub directory). Using PARTUUID makes fstab
99
+ editing simple because only a single number identifies the entire disk.
100
+ I do have possible ambiguity in my grub menu setup because I only use
101
+ device names in my menu entries while the fstab uses PARTUUID.
102
+ But what actually happens is that with a root=/dev/sda2 in my grub menu
103
+ default boot line, a USB disk will boot as sda if I have the disk plugged
104
+ in when booting, which is what I want. Device names in fstab are a bad
105
+ idea when doing this because the USB disk root partition could boot and then
106
+ mount my internal drive partitions instead of the USB partitions. But
107
+ I use PARTUUID so there will not be cross mounting. And I have a couple
108
+ of extra grub menu entries with other root variations just in case.
100
109
101
110
## Usage
102
111
To get a usage screen showing available options,
@@ -212,6 +221,8 @@ If it is not, then the clone will have to be to a two partition -f2
212
221
clone or a clone to a manually partitioned destination. So, for a
213
222
multi partition disk, select partition number and sizes with a eye
214
223
towards how you will be cloning back to smaller disks.
224
+ 11 . Desktop demo
225
+
215
226
216
227
#### 1) First clone to a new SD card in USB card reader
217
228
In this example a new SD card in a USB card reader has been plugged in
@@ -621,6 +632,74 @@ Verbose mode : no
621
632
Ok to proceed with the clone? (yes/no):
622
633
```
623
634
635
+ #### 11) Clones from my Debian desktop
636
+ Here are a couple of runs to show how rpi-clone looks handling more complex
637
+ partitioning on my desktop. I have three primary partitions and extra
638
+ extended partitions. I don't have a separate /boot partition but have
639
+ a small first partition in case I want to change that.
640
+ It probably won't work if there is a primary partition
641
+ after an extended partition.
642
+ ```
643
+ ~$ sudo sys-clone sdb
644
+ /usr/sbin/grub-install
645
+
646
+ Booted disk: sda 275.1GB Destination disk: sdb 320.1GB
647
+ ---------------------------------------------------------------------------
648
+ Part Size FS Label Part Size FS Label
649
+ 1 1.0GB ext4 SSD-275-G6-p1 1 320.1GB -- --
650
+ 2 root 52.4GB ext4 SSD-275-G6-p2
651
+ 3 12.6GB swap --
652
+ 4 209.0GB EXT --
653
+ 5 /home 62.9GB ext4 SSD-275-G6-p5
654
+ 6 /mnt/sda 146.1GB ext4 SSD-275-G6-p6
655
+ ---------------------------------------------------------------------------
656
+ == Initialize: IMAGE sda partition table to sdb - FS types mismatch ==
657
+ 1 : IMAGE to sdb1
658
+ 2 root (15.3GB used) : MKFS SYNC to sdb2
659
+ 3 : MKSWAP
660
+ 5 /home (12.9GB used) : MKFS SYNC to sdb5
661
+ 6 /mnt/sda (73.1GB used) : RESIZE(191.1GB) MKFS SYNC to sdb6
662
+ ---------------------------------------------------------------------------
663
+ Run setup script : no
664
+ Run grub : grub-install --root-directory=/mnt/clone /dev/sdb
665
+ Verbose mode : no
666
+ -----------------------:
667
+ ** WARNING ** : All destination disk sdb data will be overwritten!
668
+ : The partition structure will be imaged from sda.
669
+ -----------------------:
670
+
671
+ Initialize and clone to the destination disk sdb? (yes/no):
672
+ ```
673
+ And a subsequent sync to the same disk after I have manually labeled all
674
+ the partitions:
675
+ ```
676
+ ~$ sudo sys-clone sdb
677
+ /usr/sbin/grub-install
678
+
679
+ Booted disk: sda 275.1GB Destination disk: sdb 320.1GB
680
+ ---------------------------------------------------------------------------
681
+ Part Size FS Label Part Size FS Label
682
+ 1 1.0GB ext4 SSD-275-G6-p1 1 1.0GB ext4 Maxone-320A-p1
683
+ 2 root 52.4GB ext4 SSD-275-G6-p2 2 52.4GB ext4 Maxone-320A-p2
684
+ 3 12.6GB swap -- 3 12.6GB swap --
685
+ 4 209.0GB EXT -- 4 254.0GB EXT --
686
+ 5 /home 62.9GB ext4 SSD-275-G6-p5 5 62.9GB ext4 Maxone-320A-p5
687
+ 6 /mnt/sda 146.1GB ext4 SSD-275-G6-p6 6 191.1GB ext4 Maxone-320A-p6
688
+ ---------------------------------------------------------------------------
689
+ == SYNC sda file systems to sdb ==
690
+ / (15.3GB used) : SYNC to sdb2 (52.4GB size)
691
+ /home (12.9GB used) : SYNC to sdb5 (62.9GB size)
692
+ /mnt/sda (73.1GB used) : SYNC to sdb6 (191.1GB size)
693
+ ---------------------------------------------------------------------------
694
+ Run setup script : no
695
+ Run grub : grub-install --root-directory=/mnt/clone /dev/sdb
696
+ Verbose mode : no
697
+ -----------------------:
698
+
699
+ Ok to proceed with the clone? (yes/no):
700
+ ```
701
+
702
+
624
703
## Author
625
704
Bill Wilson
626
705
billw--at--gkrellm.net
0 commit comments