Page 1 of 1

Cool script to clone SD card for raspberry

Posted: Friday 15 April 2016 14:25
by nigels0
Hi,

I wanted to clone my SD card, but SD cards of the publicised size aren't exactly the same - so trying to clone a 8GB Lexar SD card into Sandisk 8Gb card didn't work as the Sandisk card is slightly smaller.

I found the following script which not only saves you from having to pull the SD card out of the raspberry to clone, but also can clone to another SD card of a different size.

Check out: https://github.com/billw2/rpi-clone

Note that I had to edit the script to fix a mounting issue by adding -t vfat on line 388

..
echo "=> Mounting $DST_BOOT_PARTITION on $CLONE/boot"
if ! mount -t vfat $DST_BOOT_PARTITION $CLONE/boot
then
,,,

Otherwise a great and useful script!

Re: Cool script to clone SD card for raspberry

Posted: Wednesday 20 April 2016 22:04
by starfish001
looks interesting will give it try later

Re: Cool script to clone SD card for raspberry

Posted: Friday 22 April 2016 22:14
by starfish001
great script works really well

git clone https://github.com/billw2/rpi-clone.git
cd rpi-clone
cp rpi-clone /home/pi/domoticz/scripts
cd /home/pi/domoticz/scripts
sudo chmod +x rpi-clone

could be sda or sdb or sdc check!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sudo /home/pi/domoticz/scripts/rpi-clone sdb -f -v