rpi-clone is a shell script for cloning a running Raspberry Pi booted source disk (SD card or USB disk) to a destination disk which will be bootable.
Destinations include:
Install rpi-clone:
curl https://raw.githubusercontent.com/geerlingguy/rpi-clone/master/install | sudo bash
If booting off an internal microSD card, clone to an external USB drive:
sudo rpi-clone sda
If booting off an external USB drive, clone to the internal microSD card:
sudo rpi-clone mmcblk0
If booting off an internal microSD card, clone to a PCIe NVMe SSD (note: you may need to change EEPROM settings to boot off NVMe SSDs):
sudo rpi-clone nvme0n1
For an exhaustive list of options and usage scenarios, read this project’s README.
Assuming you used the install script with the curl | sudo bash installation method, the following command will remove both files that were downloaded:
sudo rm -rf /usr/local/sbin/rpi-clone*
Code and License The code for rpi-clone is maintained on GitHub:
https://github.com/geerlingguy/rpi-clone.
The code is licensed under the BSD 3-Clause License.
Author This project was originally authored by @billw2, and is now maintained by @geerlingguy, based on many patches by @framp.