LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   1 on 1 copy of a sd card, different sizes? (https://www.linuxquestions.org/questions/linux-software-2/1-on-1-copy-of-a-sd-card-different-sizes-912039/)

EnemyNL 11-05-2011 12:06 PM

1 on 1 copy of a sd card, different sizes?
 
So im having a bit of a problem here, situation is this:

I have a sd card that contains two partition. The sd card hold linux along with some tools.

Now i need to make a lot of copies of this sd card, so i created a image file from the source sd card.

Writing back this file to a sd card of the exact same size works fine, however i have a few different types of sd card, all with different sizes (it only differs a few kb's). When i try to copy the source image to a sd card of a different size i get a error that the destination is to small to contain the image.

How can i copy the sd card, including the partition setup and all the files to the other sd cards that vary in size a bit?

Any help would be appreciated.

Thanks in advance!

jefro 11-05-2011 02:03 PM

An sd card is a hard drive. In your case some part of it knows the geometry. Consider other tool like cat, tar or cpio or such to copy off based on file by file maybe.

Might even try clonezilla or partimage or such.

I used to make a qemu virtual machine out of dd images to then work with into other formats. It sometimes is easier to run them like that. You have the ability to make a hdb image that can match the format of the card in some cases.

Elv13 11-05-2011 02:46 PM

Just use "cp -a" or use a tar with "-p" to create the image (if you really -need- an image). Sometime, good old copy is just more flexible than ghost images. This is one of these time.

EnemyNL 11-05-2011 03:41 PM

but will that also copy the partition layout of the sd card and the mbr and such? i don't think it will or should i copy the unmounted /dev/sdb somewhere and then copy that back to the other sd card?

Elv13 11-06-2011 01:38 AM

No, it wont copy the FS, after all, you don't want it to copy the FS, it is the cause of your problem. Do a script that call parted, mkfs and cp. It's just 3-4 lines.


All times are GMT -5. The time now is 03:44 AM.