[Solved] Clone SD card with correct size

Raspberry Pi related support

[Solved] Clone SD card with correct size

Postby tinue » 28 Mar 2015, 12:40

I can easily clone an SD card to a file with "dd" on my Mac. I can also add "count" to limit the number of sectors that are read from the SD card.

What I can't figure out is how to find the exact number of sectors that I have to read, in order to back up the entire file system, but not more. How do you create the image file that is being distributed?
Last edited by tinue on 03 May 2015, 10:02, edited 2 times in total.
tinue
 
Posts: 27
Joined: 01 Jan 2015, 14:08

Re: Clone SD card with correct size

Postby tschinz » 17 Apr 2015, 12:18

You don't....

you make a copy of your SD Card partition. The data can sit anywhere within this partition. You shouldn't just copy a part of the partition you will miss some data or corupt the partition. This means if you SD card has a 16Gb partition your image will be 16Gb. You can compress it afterwards if needed.

To create the img file just dd the SD Card
Code: Select all
dd if=/dev/sdb of=~/myimage.img


Note you probably want to adapt the input location

Cheers
User avatar
tschinz
 
Posts: 16
Joined: 15 Apr 2015, 21:36

Re: Clone SD card with correct size

Postby tinue » 23 Apr 2015, 18:39

I have some SD card images downloaded to my disk: Runeaudio, Raspbian, Cupcade, Hifiberry Testimage, OpenElec, ...

None of these images seem to have the exact size of an SD card, be it 2, 4 or 8GB. So I wonder how all of these images have been made. A simple "dd" from the SD card would result in a dump of exactly card size.

Also it looks like the images are from the entire card, and nor just from one partition: When the image file is "dd"ed back to an SD card, it usually results in more than one partition.

It does look like there are additional tricks available ;)
tinue
 
Posts: 27
Joined: 01 Jan 2015, 14:08

Re: Clone SD card with correct size

Postby hamdi » 28 Apr 2015, 14:00

you can use Disk Utility is the best way to cone the SD card with correct size
hamdi
 
Posts: 1
Joined: 28 Apr 2015, 13:55

Re: Clone SD card with correct size

Postby tinue » 02 May 2015, 20:06

The MacOS Disk Utility? It does not know about the ext3 filesystem, and thus can't tell me anything about the partition.
The attached picture is from a Raspbian SD card, but Runeaudio also uses ext3, so I don't think it looks much different there.

Or am I misunderstanding you?

Thanks! Martin

Bildschirmfoto 2015-05-02 um 21.08.58.png
Bildschirmfoto 2015-05-02 um 21.08.58.png (62.11 KiB) Viewed 4040 times
tinue
 
Posts: 27
Joined: 01 Jan 2015, 14:08

Re: Clone SD card with correct size

Postby hondagx35 » 02 May 2015, 23:07

Hi Martin,

None of these images seem to have the exact size of an SD card, be it 2, 4 or 8GB. So I wonder how all of these images have been made.

The problem is, that there are NO two SD cards with the same size, unless they come from the same manufacturer, same brand and from the same production batch and are brand new.
So as a distributor you always have to make the images a bit smaller to guarantee that they fit on all brands of sd cards.

How do you create the image file that is being distributed?

I make the images on my Linux (Ubuntu) machine using GParted, fdisk and truncate as described here.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Clone SD card with correct size

Postby tinue » 03 May 2015, 10:00

Hello Frank

Thank you very much for the link. This is exactly the information that I was looking for.

Regards, Martin
tinue
 
Posts: 27
Joined: 01 Jan 2015, 14:08

Re: [Solved] Clone SD card with correct size

Postby preetyjess01 » 04 Dec 2017, 06:02

Hey Buddy,

Look this, clone raspberry pi sd card. Here is, you get the best solutions about the SD card clone. I also had similar problem regarding how to clone a raspberry pi sd card, but after this, I solved my all problems. You should to try this once. surely you get best solution from this. And it helps you a lot. I tried this. Thanks.
preetyjess01
 
Posts: 4
Joined: 22 Apr 2016, 07:25
Location: US

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 19 guests