billw2 / rpi-clone

A shell script to clone a booted disk.
BSD 3-Clause "New" or "Revised" License
2.49k stars 327 forks source link

Simple way for a traditional raspbian installation (which option to use?) #115

Open Barabba11 opened 3 years ago

Barabba11 commented 3 years ago

Hi Billw2, thank you for this wonderful program, it has so many functions that I?m got confused.. I mean to be sure to have a reliable result that will work when I'll need 100%. In my case, and I think in most of cases, I have a standard Raspbian installation and I just need a spare copy of my SD, in case of failure. I woud have this copy on USB stick. using parted I have this:

`Model: SD SB32G (sd/mmc) Disk /dev/mmcblk0: 31.9GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:

Number Start End Size Type File system Flags 1 4194kB 50.2MB 46.0MB primary fat32 lba 2 50.3MB 31.9GB 31.9GB primary ext4 ` Now, which solution I've to use to produce an exact copy? (if the USB will be sda) rpi-clone sda with or without -f?

As I understood -l will set the next boot on USB (even if the SD will still insterted?) or, if I clone back to a new SD (placed inside RB, mmcblk0) it keeps the boot on USB. So if I omit the -l it will boot from mmcblk0. DO I understood it all right?

If the USB will differ a bit in size from SD (both 32GB but wit some byte of different allocable space, but I'm using only 5GB of space), will the program recalculate automatically the partitions? On both directions? (smaller to bigger and viceversa). Thsi is a huge problem when using Win32DiskImager for example.

If I have a cloned copy on USB and my SD will fail in future, put the USB will be enough to boot it back? Should I remove the defective SD? (if corrupted I suppose to). So if I undersood right the result USB copy is always bootable, depends what is write into cmdline.txt (readed on mmcblk0 only) the RB decide where to boot. So in the earliest boot process the RB tried to boot on SD, if it finds it it reads cmdline.txt and decide where from boot, if it doesn't find SD it will try automatically on USB? Thank you a lot for clear such questions!