salka
Posts: 18
Joined: Fri May 10, 2013 8:55 am

Win32 Disk Imager write to smaller SD memory card

Thu Aug 07, 2014 11:57 am

Hello,
I prepared instalation which is useable for me and then I created with Win32 Disk Imager like backup/clone img file.
It was used for next same application (new raspberry Pi´s) but now I had a problem with write it to new SD memory card (same vendor, type and serial number). New memory card capacity is smaller like old one (you can see in attached picture).
How can be possible write existing img file to new smaller memory card?

Thank you.
Attachments
Disk_Imager.jpg
Disk_Imager.jpg (23.36 KiB) Viewed 22688 times

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4766
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Win32 Disk Imager write to smaller SD memory card

Thu Aug 07, 2014 12:01 pm

Either partition it manually and then rsync the files across or resize the partition on the sd card and cut off the free space when you dd it across. In any case, you'll need to use linux and have an understanding of how partition tables work and how they relate to the filesystems on the partitions.

Or maybe someone knows a simpler way.

User avatar
rpdom
Posts: 11971
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Win32 Disk Imager write to smaller SD memory card

Thu Aug 07, 2014 12:09 pm

ShiftPlusOne wrote:Or maybe someone knows a simpler way.
Not on Windows, but someone (sorry, I can't remember who) has written a Linux script that will resize the saved image file to make it as small as possible. Then you can use disk imager to write it to the smaller card and raspi-config to expand it to fit.

Personally I prefer to partition the new card manually and create tar files of the old partitions on my Linux laptop before restoring them to the new card.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4766
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Win32 Disk Imager write to smaller SD memory card

Thu Aug 07, 2014 12:50 pm

rpdom wrote:
ShiftPlusOne wrote:Or maybe someone knows a simpler way.
Not on Windows, but someone (sorry, I can't remember who) has written a Linux script that will resize the saved image file to make it as small as possible.
That would be asb's shrink_image, which is a part of spindle.
https://github.com/asb/spindle/blob/master/shrink_image

It's a little messy though and may require a small tweak or two to get it to work. I've used it a fair few times and have my own script which takes an image, creates another one of a defined size and then rsyncs the files from one to the other.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Thu Aug 07, 2014 11:00 pm

After doing a bit of searching, I suspect rpdom actually meant rpi-wiggle ?
Never used it myself though, so can't comment on if or how well it works...

User avatar
rpdom
Posts: 11971
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 5:46 am

I think the one I meant was here http://www.raspberrypi.org/forums/viewt ... 91&t=58069

It only works with a plain Rasbian install, not NOOBS or any other.

If I find some spare time, I may have a go at writing something myself that might work with NOOBS, but first I need to wait until I can get a couple of SD cards to test it with. I'd probably just end up shrinking the last partition to fit the smaller card.

Actually, that gives me an idea...

User avatar
stevejferry
Posts: 52
Joined: Tue Mar 11, 2014 6:57 pm
Location: Seaham, UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 10:19 am

Hi Guys,

I have the same problem. I have my OS on a standard 8Gb SD card but have bought an 8Gb micro SD and adapter for the Pi. I can't write the image from the old card to the new one because Win32 Disk Imager says its too small. And here's me thinking all 8Gb cards were 8Gb!

If somebody can post an easy solution to this (without needing Linux), they'd be a god(ess) in my eyes!

Regards, Steve.
There are 10 types of people. Those who understand binary and those who don't.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4766
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 10:41 am

stevejferry wrote:Hi Guys,

I have the same problem. I have my OS on a standard 8Gb SD card but have bought an 8Gb micro SD and adapter for the Pi. I can't write the image from the old card to the new one because Win32 Disk Imager says its too small. And here's me thinking all 8Gb cards were 8Gb!

If somebody can post an easy solution to this (without needing Linux), they'd be a god(ess) in my eyes!

Regards, Steve.
Use a gparted livecd or a VM with a usb sd card reader. Once you get to that point, you can either dd (there's a windows version) or snip the end off the file and use win32diskimager.

But there's no easy way to do it from windows. Windows is just not made to do these things.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 12:36 pm

stevejferry wrote:And here's me thinking all 8Gb cards were 8Gb!
Nah, unfortunately not, which catches out a lot of people!
From my own testing, I've found cards which are 'nominally' labelled as the same size can actually be several hundred megabytes different :!: My current smallest '8GB' card is 7384MB and my current largest card '8GB' card is 7695MB - and I'm sure there's no doubt larger and smaller '8GB' cards in the wild. And obviously the larger the nominal capacity of the card, the larger these discrepancies become...

User avatar
pluggy
Posts: 3636
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 4:37 pm

Considering how flash memory works, its not surprising they vary in size.

In easy terms, flash is difficult to make 'perfect' so they make it as it comes, imperfections and all, attach a small microprocessor to manage it and isolate the rough bits and hey presto they can sell almost all of the flash they make. Its how fake cards are made, they reprogram the microprocessor to report a false size and they use what they have available working normally, when the card runs out of actual flash, the data disappears into the ether, the card pleads ignorance and the owner is left scratching his head.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 5:02 pm

Yeah, that's what I used to think, which would suggest that every SD card has a different size, based on how many bad sectors its flash happens to have. And yet whenever I've bulk-bought a batch of identical SD cards (same manufacturer/make/model/etc.) they all have exactly the same size? :?

User avatar
rpdom
Posts: 11971
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 5:47 pm

AndrewS wrote:Yeah, that's what I used to think, which would suggest that every SD card has a different size, based on how many bad sectors its flash happens to have. And yet whenever I've bulk-bought a batch of identical SD cards (same manufacturer/make/model/etc.) they all have exactly the same size? :?
Possibly they do a quick test on a batch and bulk program them all to match the lowest working capacity (minus a bit to allow for recovery blocks), rather than having to take time to program each card individually? I'm just theorising. I don't actually know how they do it.

User avatar
paulcaseyjr
Posts: 28
Joined: Wed Jun 04, 2014 1:23 pm
Location: New Hampshire
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 5:50 pm

There's a script at https://github.com/billw2/rpi-clone that I've used in the past.

The other way I tried was to use dd command and if the image fits onto the smaller SD card, then I ignored the error because the way my original card was formatted meant that it had all the "good stuff" onto the smaller card and I didn't need it to copy the unused sectors.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 5:53 pm

Or they could just have a manufacturing process that is guaranteed to produce at least, say, 8G of usable space. Say that it is random and could produce anywhere from 8 to 16 Gb.

The sensible thing to do would be to program the microprocessor to always say that it is exactly 8G.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
pluggy
Posts: 3636
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 6:37 pm

I'd go the live disk route. Ubuntu will do it. Before you create the image, run gparted and shrink the main partition to say 6GB for an 8GB card. Then create the image. Burn the image to the new card and ignore the errors. and because the non written bit doesn't contain anything useful the written bit will work. You could then resize the partition to fill the new card using raspi-config on the running Pi.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
pluggy
Posts: 3636
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 7:04 pm

Joe Schmoe wrote: The sensible thing to do would be to program the microprocessor to always say that it is exactly 8G.
Providing the amount of working flash in the card is greater than what it says.

I had a look at two Sandisk 8GB MicroSDs I bought together and they are indeed the same size. I'm confident they are genuine, bought from a reputable dealer and they check out with f3write and f3read. They are quite a way short of what I'd call a real 8GB though and short of the decimal GB beloved of hard drive manufacturers. ( 7939817472 bytes ).

Probably little point in faking 8GB cards since they aren't very expensive to start with. Far more lucrative to fake 32GB and up.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
rpdom
Posts: 11971
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 7:19 pm

pluggy wrote:I had a look at two Sandisk 8GB MicroSDs I bought together and they are indeed the same size. I'm confident they are genuine, bought from a reputable dealer and they check out with f3write and f3read. They are quite a way short of what I'd call a real 8GB though and short of the decimal GB beloved of hard drive manufacturers. ( 7939817472 bytes ).
Are you sure the figures aren't produced by ISPs with their "Up to xMB" connection speeds? ;)

User avatar
pluggy
Posts: 3636
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 7:49 pm

I've been quite un cynical about broadband speeds of late, mine is faster than its ever been after BT OR doctored my phone line last month. 16.4 Mb/s isn't bad in a little town miles away from anything resembling a city.

Reading the fine print (really fine print) on the back of the SD card packet it does specify that Sandisk's GB is the smaller decimal GB, but nothing on why its only 7.939 GB.......
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

drgeoff
Posts: 7499
Joined: Wed Jan 25, 2012 6:39 pm

Re: Win32 Disk Imager write to smaller SD memory card

Fri Aug 08, 2014 8:49 pm

Formatting overhead?

salka
Posts: 18
Joined: Fri May 10, 2013 8:55 am

Re: Win32 Disk Imager write to smaller SD memory card

Tue Aug 12, 2014 5:50 am

Hello all,
---------------------------------------------------------------------
about thema "not equal capacity" when is used memory card from same Vendor wiht same type/size/serial number.
Answer from Kingston:
Please note that Kingston Technology does not manufacture and subsequently test its range of flash card products to be used as micro hard drives in industrial or embedded applications.

Our products are made for the purpose of being used as removable storage media in popular electronic equipment such as digital cameras, MP3 players, satellite navigation devices, PDAs and mobile phones.

As we build our flash cards with a number of different components, we cannot guarantee their suitability for the use you intend.

As you have seen, the results may vary from one card or batch to the next, depending on the type of components used during the manufacturing process.

Build 31724-003.A00LF (December 2013) is no longer in production, so we are uable to provide you with a suitable replacement.

If you you do not have an alternative use for the cards, we suggest that you return them to your supplier as there is no further support that we can offer.

We apologise for any inconvenienmce which this may cause.
--------------------------------------------------------------------------------------------------
I had only Raspberry Pi Linux system (no other Linux system accessible and no experience with use script useablility). And question is how can I know resize img file to smaller with use Windows application (which and how must be used)?
Thank you.

salka
Posts: 18
Joined: Fri May 10, 2013 8:55 am

Re: Win32 Disk Imager write to smaller SD memory card

Tue Aug 12, 2014 6:13 am

Hello,

or different Idea (please add your comment about possibility):

Prerequisities: Raspberry Pi type B, 8GB SDHC class 4, Raspbian

Is possible?:
1. Insert USB memory stick (2GB or 4GB) to USB slot on Raspberry and make running copy from 8GB to this (smaller) USB stick?
That means after create img file with DiskImage from USB memory stick and write this img file to new SDHC memory card system will be running (like old one) from new memory SD media?
2. If point 1. is possible, how can be made smaller copy of existing system to USB stick.

Thanks.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Wed Aug 13, 2014 11:07 pm

I still think http://www.raspberrypi.org/forums/viewt ... 47#p594947 sounds like your best option.

Bfmersion
Posts: 6
Joined: Wed Aug 07, 2013 7:35 pm

Re: Win32 Disk Imager write to smaller SD memory card

Mon Sep 01, 2014 2:51 pm

Well, I have been wrestling with this problem for weeks and have read most of the above refs. They probably work, but the steps tax me and I was looking for something simpler. I have discovered an extremely easy solution that might work for others. To be specific my problem was that I had a 32Gb backup file that would not write to a new 32Gb microSD. I got the same error as the OP. What I finally tried was to use Windows Copy to copy my 32Gb back to a new file (I did this so I could experiment with the complex methods). The original filesize was 31,166,976 Kb but the copy was 19,892,224Kb. I thought this was a Copy error so I did it again. Same result. So this morning I tried a Win32DiskImager write to my 32Gb sd card and it went ahead and did it. Still skeptical, I put the newly written SD into the RPi and it booted up fine. Just to complete the picture, Filemanager indicated 9Gb free on the SD. After raspi-config expansion, Filemanager indicates 22.9 Gb free. My OS is Win8.1.

Later: I tried the above on other backups that I had and found different results: ie the copy ended up the same size as the original. So hard to understand the previous result. Certainly saved me a lot of trouble but your results may vary. Would be interested if others found different sizes too. Maybe it would lead to understanding.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Win32 Disk Imager write to smaller SD memory card

Tue Sep 02, 2014 12:01 am

Bfmersion wrote:What I finally tried was to use Windows Copy to copy my 32Gb back to a new file (I did this so I could experiment with the complex methods). The original filesize was 31,166,976 Kb but the copy was 19,892,224Kb. I thought this was a Copy error so I did it again. Same result.
Got no idea what was going on there :shock: A file copy should always produce an indentical copy, i.e. end up with the same filesize :?

Glad to hear you managed to get around your problem though :)

Double-G
Posts: 1
Joined: Sun Mar 27, 2016 7:49 am

Re: Win32 Disk Imager write to smaller SD memory card

Sun Mar 27, 2016 7:52 am

I use an old version of win32diskimager-RELEASE-0.1-r15-win32 to read te img, it creates an image of 4gb even from a 8gb sd card an then write the img with te latest version of win32diskimager. because the old one will skip every error.

Return to “Troubleshooting”

Who is online

Users browsing this forum: bertlea, hyntleman and 35 guests