dchapma1
Posts: 16
Joined: Sun Aug 05, 2012 12:54 am
Location: Upstate New York

Clone or backup FULL SD Card

Mon Jan 19, 2015 4:52 pm

All,

I have 2 Model B+ Pis
-
I have been trying to clone the SD card from Pi 1 so I can get my second Pi up and running exactly as my first one.

I used Win32DiskImager as suggested on several Pi forums. I imaged my Pi # 1 SD card, then laid that image onto Card #2. But when I booted Pi # 2 it had errors and would not boot.

I tried this several times to no avail.

Is there a good way to clone the SD card, including all the partitions ? I want to do this for error recovery purposes too.

Thanks Much.

Don

User avatar
DougieLawson
Posts: 40825
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Clone or backup FULL SD Card

Mon Jan 19, 2015 7:23 pm

Use a Raspberry Pi with a USB SDCard reader. You can copy the card you're booted from that way.
sudo dd if=/dev/mmcblk0 of=/dev/sdb bs=30M &

Use a Raspberry Pi with two USB SDCard readers and copy can copy one inactive card to another that way.
sudo dd if=/dev/sdb of=/dev/sdc bs=30M &

If you want to reformat SDCards to blank (as if they are factory fresh), use a camera or an Android tablet.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Clone or backup FULL SD Card

Mon Jan 19, 2015 7:59 pm

Format the card with SDFormatter with the size option. Then use Win32DiskImager to read the first card then write the second card.

I have never had a problem "cloning" a card this way.

Try a different card as the second may be messed up.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

dchapma1
Posts: 16
Joined: Sun Aug 05, 2012 12:54 am
Location: Upstate New York

Re: Clone or backup FULL SD Card

Mon Jan 19, 2015 8:59 pm

Strange. I must have done something wrong.

I ended up using my MAC in the terminal mode using dd

Thanks for the fast replies!

Don

ikke4
Posts: 27
Joined: Thu Jan 02, 2014 4:18 pm

Re: Clone or backup FULL SD Card

Tue Feb 17, 2015 4:47 pm

is this also possible when the original sd-card is 32Gb (only 6GB in use) and the new card is 16Gb..

DirkS
Posts: 10596
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Clone or backup FULL SD Card

Tue Feb 17, 2015 5:02 pm

ikke4 wrote:is this also possible when the original sd-card is 32Gb (only 6GB in use) and the new card is 16Gb..
No, the image will be the size of the original SD card
It is possible to shrink it after creating the image with scripts / programs like Image Shrinker (see http://www.raspberrypi.org/forums/viewt ... p?p=656640)

ikke4
Posts: 27
Joined: Thu Jan 02, 2014 4:18 pm

Re: Clone or backup FULL SD Card

Tue Feb 17, 2015 5:08 pm

thanks, i'll look into it...

User avatar
DougieLawson
Posts: 40825
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Clone or backup FULL SD Card

Tue Feb 17, 2015 7:27 pm

ikke4 wrote:is this also possible when the original sd-card is 32Gb (only 6GB in use) and the new card is 16Gb..
That only works if you skip the even numbered bytes :lol: :lol: :lol: the problem with that is the odd bytes don't work on their own.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

ikke4
Posts: 27
Joined: Thu Jan 02, 2014 4:18 pm

Re: Clone or backup FULL SD Card

Wed Feb 18, 2015 1:32 pm

thanks,

i did what you suggested and throwed away all the "zero's"! it really works great, not only do i have a very small partition, booting speed has increased with a factor 2..

thank you :lol: :lol:

Return to “Beginners”