I just bought a PNY secure digital SD card. It's supposed to be 2 GB. I have a USB card reader from Lexar. My laptop (falkor) is a thinkpad running Fedora 7 (32 bit), and it's up to date as of 9am on 10/26.
When I insert the card, I get zillions of errors in /var/log/messages like this:
Oct 26 08:56:53 falkor kernel: attempt to access beyond end of device
Oct 26 08:56:53 falkor kernel: sdd: rw=0, want=4022271, limit=2011136
and
Oct 26 08:56:52 falkor kernel: Buffer I/O error on device sdd1, logical block 40
22200
I can mount the card and put files on it, but files start getting truncated, and I get I/O errors.
The problem seems to be that the card's size is incorrectly detected. Up above those errors, I get this bunch of messages:
Oct 26 08:56:35 falkor kernel: sd 2:0:0:2: [sdd] 2011136 512-byte hardware sectors (1030 MB)
Oct 26 08:56:35 falkor kernel: sd 2:0:0:2: [sdd] Write Protect is off
Oct 26 08:56:35 falkor kernel: sd 2:0:0:2: [sdd] Assuming drive cache: write through
Oct 26 08:56:35 falkor kernel: sd 2:0:0:2: [sdd] 2011136 512-byte hardware sectors (1030 MB)
Oct 26 08:56:35 falkor kernel: sd 2:0:0:2: [sdd] Write Protect is off
Oct 26 08:56:35 falkor kernel: sd 2:0:0:2: [sdd] Assuming drive cache: write through
Oct 26 08:56:35 falkor kernel: sdd: sdd1
Oct 26 08:56:35 falkor kernel: sdd: p1 exceeds device capacity
So it seems to be seeing only the first half of the card for some reason. The 2011136 isn't all the sectors that are supposed to be there.
I tried this on my laptop:
sdparm --command=capacity /dev/sdd
and it finds:
/dev/sdd: Lexar Media Inc. SD/MS 009E
blocks: 2011136
block_length: 512
capacity_mib: 982.0
If I put the same SD card into the card reader built into my workstation (grograman), which runs Fedora 6 (64 bit), the size of 4022272 sectors is correctly detected in /var/log/messages:
Oct 25 09:30:36 grograman kernel: sd 1:0:0:3: [sdf] 4022272 512-byte hardware sectors (2059 MB)
Oct 25 09:30:36 grograman kernel: sd 1:0:0:3: [sdf] Write Protect is off
Oct 25 09:30:36 grograman kernel: sd 1:0:0:3: [sdf] Assuming drive cache: write through
Oct 25 09:30:36 grograman kernel: sdf: sdf1
Oct 25 09:30:38 grograman kernel: sd 1:0:0:3: [sdf] 4022272 512-byte hardware sectors (2059 MB)
Oct 25 09:30:38 grograman kernel: sd 1:0:0:3: [sdf] Write Protect is off
Oct 25 09:30:38 grograman kernel: sd 1:0:0:3: [sdf] Assuming drive cache: write through
Oct 25 09:30:38 grograman kernel: sdf: sdf1
Oct 25 09:30:42 grograman hald: mounted /dev/sdf1 on behalf of uid 500
Oct 25 09:31:27 grograman hald: mounted /dev/sdf1 on behalf of uid 500
and the card seems to work just fine on my workstation.
I'm pretty sure this is not a problem with the SD card. I took it back and got a new one, and the same problem occurs. This card works properly in my workstation, in my palm TX, and in my laptop under Windows XP. The card reader works fine in my laptop under linux when I put in a 16 MB SD card by Cannon, and a 1 GB SD card by San Disk. And the 2 GB card works on my laptop under linux if I repartition it to have only about a 1 GB partition.
I suppose that it might be a problem with the USB card reader that somehow doesn't bother windows. I'll test the reader on my workstation later.
But it might be a problem somewhere in SCSI land or USB land in linux. Has anyone seen this problem? Any suggestions?