can't boot after using "dd" cmd to copy from another sd card

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

can't boot after using "dd" cmd to copy from another sd card

Postby doubleshik » Tue Oct 20, 2015 4:52 pm

Hi everyone

I am using raspberry pi to build a cluster. Now I success to install arch and some softwares on one of the SD card. But I want to clone this SD card to other SD cards.

I tried:
Code: Select all
dd bs=4M if=/dev/mmcblk0 of=arch.iso
which clone the origin SD card to local filesystem
Code: Select all
dd bs=4M if=arch.iso of=/dev/mmcblk0
Then I clone the iso file to new SD card.

but this not work for me, I can't boot from this new SD Card.


Then I tried:
Code: Select all
dd bs=4M if=/dev/mmcblk0p1 of=boot.iso
and
Code: Select all
dd bs=4M if=/dev/mmcblk0p2 of=root.iso

because I follow the instruction to divided the sd card into /boot and /root

But this not work for me,too.

Does anyone have ideas about how to copy the whole SD card to others?

Thanks a lot!
doubleshik
 
Posts: 3
Joined: Tue Oct 20, 2015 4:37 pm

Re: can't boot after using "dd" cmd to copy from another sd

Postby WarheadsSE » Tue Oct 20, 2015 7:51 pm

You aren't cloning from a running image, are you?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6799
Joined: Mon Oct 18, 2010 2:12 pm

Re: can't boot after using "dd" cmd to copy from another sd

Postby doubleshik » Wed Oct 21, 2015 3:09 am

I didn't clone the system when raspberry pi power on. I use another Linux host to copy the SD card.
doubleshik
 
Posts: 3
Joined: Tue Oct 20, 2015 4:37 pm

Re: can't boot after using "dd" cmd to copy from another sd

Postby sdjf » Wed Oct 21, 2015 6:37 pm

You need to dd the whole card onto the second card. run "cat /proc/partitions" to see what your other linux machine has called the SD card that you want to clone. It most likely is calling it /dev/sda, /dev/sdb, or similar, with boot and root being, on the first /dev/sda1 and /dev/sda2, for example. So you would be dding the whole SD card instead. I have not ever had trouble doing it, except if I was trying to copy the card to one that was smaller.

So your command to create the image by dd'ing the whole card would be some variation of

Code: Select all
 dd if=/dev/sda of=alarm.img


I also question if 4MB is a good block size, you might play it safe with more like BS=1M

And after you create the image of the whole card, you use /proc/partitions to make sure you know the correct device to dd it back on to.

EDIT: two other ways to find out the device name of external media is to examine dmesg output after inserting the media, or to look at /var/log/everything.log if that exists on the system, after insertion.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: Google [Bot] and 4 guests