Multi-partition SD card only partly copied.

Bug #1330125 reported by Jon Pryce on 2014-06-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Image Writer
High
Tobin Davis

Bug Description

I am using Win32DiskImager version 0.9.5, on a Dell Vostro laptop with a built in SD card reader (not USB).
I have a 4GB SD card that was formatted in Ubuntu with 2 partitions:

1. A 74MB or so boot partition (type FAT32)
2. The remainder of the 4GB as a linux partition (type EXT3).

Which is a fairly standard configuration for a bootable linux SD card. When I copy an image of the card to a file Win32DiskImager only seems to read the data for the first partition. I thought this was meant to be a raw copy? How do I make it just copy all sectors of the drive?

BTW "HDD Raw Copy" has exactly the same problem. If you Google something like "sd card copy only copies first partition" you can find other reports of the same thing happening with Win32DiskImager, and one reporter blames Dell Laptops with built in SD drives, saying that using an external drive might fix the problem! Can this really be true?

Tobin Davis (gruemaster) wrote :

I'll look into this as soon as possible, but know that I don't have that specific hardware. This could indeed be an issue with the SD Reader drivers. I have seen similar issues in the past under Windows XP (which btw is no longer supported as of v0.9.5).

If you have access to a USB SD reader, can you try it as well? I have not seen this issue on multi-partitioned USB drives using test images of similar partitioning (FreeNAS, Ubuntu, etc). I will try on my HP Laptop's SD reader under Windows 7.

Changed in win32-image-writer:
importance: Undecided → High
Jon Pryce (jpryce) wrote :

I don't have a USB reader but I did ask someone else who has one to copy the same card with Win32ImageWriter. It works fine! So I guess I will have to fork out for an external reader :-(, which seems a shame as I have this nice built-in one! BTW I am using Windows 7 and the SD card driver is the latest.

Presumably what is happening is that the driver returns the size of the 1st partition when you ask it for the total capacity of the disk? I could look at the code but I'm too idle :-). Might there be another way to read the total capacity that this driver might support better? Then you could do something like:

size = read_size(THE_OLD_WAY);
size2 = read_size(ALTERNATIVE_WAY);
if (size < size2)
  size = size2;

But if not I guess you can close the bug.

Tobin Davis (gruemaster) wrote :

Marking as triaged. Will hopefully get some free time soon to actually attempt to reproduce/debug this issue soon.

Changed in win32-image-writer:
status: New → Triaged
Jon Pryce (jpryce) wrote :

I have now got a new Dell Latitude E5540 laptop with a built-in SD card reader and this works OK with Win32DiskImager. So since I am the only one who has reported this problem I think you can forget about it :-)

Tobin Davis (gruemaster) wrote :

I have changed the way the program determines the physical device from the logical volume. This still needs more testing, but if you have the time and capabilities, please try the latest source. Otherwise this will be in the 1.0 release and you can try it then (assuming you still have the old laptop of course).

Changed in win32-image-writer:
status: Triaged → Fix Committed
assignee: nobody → Tobin Davis (gruemaster)
milestone: none → 1.0
Tobin Davis (gruemaster) on 2017-03-08
Changed in win32-image-writer:
status: Fix Committed → Fix Released
Jon Pryce (jpryce) wrote :

I tried 1.0. If I don't select the "Read Only Allocated Partitions" checkbox I get the same behaviour: only the first partition is copied. If I do select the checkbox it does seem read the second partition too. However...

1. I can not use the "Verify Only" button because it says that the image is larger than the device because it thinks the device is only the size of the first partition.

2. If I try to write to an SD card that is preformatted with the same two partitions it says that more space required that is available since it has calculated the SD card size from the first partition.

Good try though :-)

Tobin Davis (gruemaster) on 2017-03-08
Changed in win32-image-writer:
status: Fix Released → In Progress
Tobin Davis (gruemaster) wrote :

Sigh. Ok, reopening. I have been doing a LOT of testing on this release, but there is only so much I can do. I'll have to look at the code to see how it determines sizes. Being an Ubuntu developer, I can easily recreate the SD image, just not sure if it is going to be another SD Reader issue (yes, there are a lot of issues with those).

And with any luck, the next release cycle won't be two years this time. :P

Thanks for testing 1.0. if you find any other issues, please don't hesitate to file bugs on them.

Jon Pryce (jpryce) wrote :

My Vostro system is pretty ancient technology now and it seems that Dell have fixed the problem with their later SD hardware / driver, at least based on my tiny sample size of 1 Latitude system. So you have my permission to ignore or close this bug!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers