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

Wrong partition names chosen when dst_disk ends with digit #96

Open alexsee75 opened 4 years ago

alexsee75 commented 4 years ago

AFAIK Linux adds a "p" when the original device name ends with a digit. This happened to me when using rpi-clone with a network block device /dev/nbd0 (using nbd-client and nbd-server on a different machine). I patched it manually, however it should be enough to move the dst_part_base=${dst_disk}p line four lines up before the if [[ $dist_dist == *"mmcblk"* ]]