Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.