Mounted phone memory card shows incorrect disk size.

Johan Grönqvist johan.gronqvist at gmail.com
Thu May 10 06:25:01 UTC 2007


On Wed, 2007-05-09 at 17:37 +0100, Liam Proven wrote:

> I suggest you put your card in a card reader, boot the machine under
> DOS or NT, partition it with one big primary FAT16 partition, format
> that to FAT16, and use it as that alone. Once you have done that, it
> should work on anything.
> 


I have not tried using a card reader, but I have formatted the memory
stick from winXP, both using FAT and FAT32 (those are the options
available). The results are very similar.

Having learnt about "fdisk -l" from Thomas Kaiser, I can now find a
problem, I believe.

GParted still reports the disk as lacking a filesystem, but fdisk says

Disk /dev/sdc: 2031 MB, 2031611904 bytes
255 heads, 63 sectors/track, 246 cylinders, total 3967992 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63     3968054     1983996    b  W95 FAT32


In particular, the number of sectors is the same in sdc1 as in sdc, but
the position is shifted, so sdc1 doesn't start at the beginning of sdc,
and ends AFTER sdc ends.


When automatically mounting, I get the following from dmesg, just before
the problems begin

[   97.376000] SCSI device sdc: 3967992 512-byte hdwr sectors (2032 MB)
[   97.380000] sdc: test WP failed, assume Write Enabled
[   97.380000] sdc: assuming drive cache: write through
[   97.380000] SCSI device sdc: 3967992 512-byte hdwr sectors (2032 MB)
[   97.384000] sdc: test WP failed, assume Write Enabled
[   97.384000] sdc: assuming drive cache: write through
[   97.384000]  sdc: sdc1
[   97.392000]  sdc: p1 exceeds device capacity
[   97.396000] sd 2:0:0:0: Attached scsi removable disk sdc
[   97.396000] sd 2:0:0:0: Attached scsi generic sg2 type 0
[   97.788000] attempt to access beyond end of device
[   97.788000] sdc: rw=0, want=3968055, limit=3967992
[   97.788000] Buffer I/O error on device sdc1, logical block 495998
[   97.788000] attempt to access beyond end of device
[   97.788000] sdc: rw=0, want=3968055, limit=3967992
[   97.788000] Buffer I/O error on device sdc1, logical block 495998


I assume that "sdc: p1 exceeds device capacity" confirms the guess
above.

Thus, the problem remains.
I will try with a card reader later.

My guess is that a solution would be to format the memory card to
filesystem slightly smaller than the memory stick, but I do not know
how.

Thanks

/ johan






More information about the ubuntu-users mailing list