flash drive reporting wrong size, how to fix?

Ian Malone ibmalone at gmail.com
Sun Jan 15 19:45:55 UTC 2012


On 15 January 2012 15:47, Ian Malone <ibmalone at gmail.com> wrote:
> On 15 January 2012 00:47, Patrick O'Callaghan <pocallaghan at gmail.com> wrote:
>> On Sat, 2012-01-14 at 22:52 +0000, Ian Malone wrote:
>>> Hi,
>>>
>>> I've got a 2GB microSD card that I've been using a while (so I'm
>>> confident that at one point it was a 2GB card and isn't a 'fake').
>>> Recently it stopped responding (the last place it was used was in my
>>> phone) and on plugging it into my computer (I've got two separate
>>> adaptors, one a USB-microSD, the other a microSD-SD and have tried it
>>> in two machines) it now shows up as having no partitions and an
>>> unpartitioned capacity of ~48MB. I suspect it's failed somehow and
>>> they're not expensive to replace, but I'd be interested to know if
>>> there are any tools that I could use to try and re-program it to show
>>> the correct size again. Any suggestions?
>>
>> Use fdisk to check the partition table. The drive should have at least
>> one partition.
>>
>> Use mkfs to make a filesystem.
>>
>> If you want device portability, you should probably create a VFAT
>> partition and use the VFAT option to mkfs.
>>
>> However I have had cases where this doesn't work well, especially with a
>> USB flash drive -- not a microSD -- that's been used a lot. I've had to
>> format the drive on a Windows machine, which (so far) has always
>> recovered it.
>>
>
> Well, wasn't not really a case of the filesystem or partitioning (past
> tense will become clear). Earlier in the week fdisk was reporting 48MB
> for the disk size. I tried gparted + gpart on it yesterday just before
> sending my email (the repair partition option in gparted) and that
> didn't seem to make any difference, gparted still showed 48MB.
> Attempted to create a partition too (48MB in size) which didn't seem
> to do anything. However plugging it in again, fdisk is now showing
> this:
>
> Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes

The more observant will notice what I didn't (immediately at least)
/dev/sdb is 1000*GB* and actually my data drive. The SD card takes a
while to show up as a device on this computer (via USB adapter), dmesg
looks like this:
[ 2267.784099] usb 1-7: new high speed USB device number 8 using ehci_hcd
[ 2267.914390] usb 1-7: New USB device found, idVendor=090c, idProduct=6200
[ 2267.914400] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2267.914408] usb 1-7: Product: Generic USB2.0 card
[ 2267.914414] usb 1-7: Manufacturer: Silicon Motion, Inc.
[ 2267.914419] usb 1-7: SerialNumber: 12345678901234567890
[ 2267.916453] scsi8 : usb-storage 1-7:1.0
[ 2283.768414] scsi 8:0:0:0: Direct-Access     Generic  USB  SD Reader
  1.00 PQ: 0 ANSI: 0 CCS
[ 2283.770395] sd 8:0:0:0: Attached scsi generic sg4 type 0
[ 2320.765304] sd 8:0:0:0: [sdc] Attached SCSI removable disk

# fdisk /dev/sdc
fdisk: unable to open /dev/sdc: No medium found

On the other machine (through an SD reader) Fedora can see 48MB space.
The sdcard.org formatter in Windows also sees 48MB, but even after
using this Windows can offer to create a 48MB fs, but after trying to
format reports that it failed. Coincidentally 'No medium found' is
what Windows disk manager (the partition management tool) says about
the card plugged in via microSD-USB. All very odd. The only reason I
haven't got a new one yet is 2GB ones are hard to find these days.

-- 
imalone


More information about the users mailing list