RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Clone SD card

Sat Jan 24, 2015 8:56 am

I have setup my PiBot to be a WiFi Hotspot so that I can remote in to the headless beast. Given this is no easy task for me (poor typing skills, old eyes) the setup process is prone to errors when I do it.

With that in mind I would like to clone the SD card so I have a backup. I tried to use the process set out in the Pi Weekly issue 82; however, success eludes me.

This process uses a Pi Hub and the following steps to clone multiple SD cards at once:

install dcfldd < sudo apt-get install dcfldd >

sudo dcfldd if=ImageFileToBeCopied.img of=/dev/sda of=/dev/sdb of=/devsdc of=/dev/sdd

Given I only want to clone the SD card running the PiBot using a read write adapter plugged into the Pi Hub I am guessing that I would modify the code as follows:

dcfldd if=ImageFileToBeCopied.img of=/dev/sda

However, my guess did not work -- any suggestions to allow me to clone the PiBot SD card would be greatly appreciated.
Thanks

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Clone SD card

Sat Jan 24, 2015 2:58 pm

RussellPiBot wrote: Given I only want to clone the SD card running the PiBot using a read write adapter plugged into the Pi Hub I am guessing that I would modify the code as follows:

dcfldd if=ImageFileToBeCopied.img of=/dev/sda

However, my guess did not work -- any suggestions to allow me to clone the PiBot SD card would be greatly appreciated.
Thanks
What exactly didn't work about it? Did you get an error? Did it write stuff to the card but won't boot? It's very hard to troubleshoot without knowing the details of the problem.

How was the image made? Since you said you're looking to clone the SD card, I would assume that you did something like:
dcfldd if=/dev/sda of=backup.img #where sda is a working SD card and backup.img is a backup of it.
copy backup.img imagefiletobecopied.img #just so our filenames match, but I can use a name above that makes sense in context.

If not, the img file might not be the right format for that program, so it's important to know where it came from.

thegnnu
Posts: 157
Joined: Thu Oct 18, 2012 7:07 pm
Location: Bristol

Re: Clone SD card

Sat Jan 24, 2015 9:02 pm

Russell have a look at this program rpi-clone
it will clone the running sd card to a sd in a usb adapter
I use it all the time
https://github.com/billw2/rpi-clone

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: Clone SD card

Sun Jan 25, 2015 2:12 pm

Tarcus & Thegnnu

Thank you both for your responses, I will respond to both in the order received.

Tarcus, with regard to your questions about how the code failed - there were no error messages; there appeared to be no response to the command line instructions I made:

< dcfldd if=ImageFileToBeCopied.img of=/dev/sda >

I now believe my assumption that nothing was happening was in error - simply a lack of patience on my part. The Pi was processing the command.

Now to my poorly written post - my question, which was not clear, was whether or not the modification I made to the code (above) that appeared in issue 82 of the Pi Weekly was correct. My apologies.

/////////////////////////////////////////////////////
Thegnnu - thank you for the link to < https://github.com/billw2/rpi-clone > I went to the site and read the material several times; however, I simply could not follow the info well and will need more time to put it to use.

Now the good news I found information on how to clone a Pi SD card using the OS X Terminal command line. It was a straightforward process that worked the first time I tried it. Here is the link:

http://computers.tutsplus.com/articles/ ... -mac-59911

I now have a backup file of my PiBot SD card on my Mac laptop and a cloned SD card ready to go if needed. Next up, build power supplies for PiBot motors and the the Pi A+ that will run the bot.

Thanks again.
Cheers

Return to “Automation, sensing and robotics”