# USB card reader problem

## nickk

I have usb multi card reader and 16gb micro sd card (transcend) from my mp3 player. As i insert it into the reader it got successfully recognized as /dev/sde with one partition on it (which has fat32 fs on it previously created my mkfs.vfat)

```

[11639.068902] sd 2:0:0:0: [sde] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)

[11639.069776] sd 2:0:0:0: [sde] Assuming drive cache: write through

```

Then i start copying (with mc) a set of directories with files in it to that card and sometimes get copying errors with the following messages in dmesg:

```

[12325.645791] sd 2:0:0:0: [sde] Media Changed

[12325.645794] sd 2:0:0:0: [sde] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE

[12325.645797] sd 2:0:0:0: [sde] Sense Key : Unit Attention [current] 

[12325.645800] Info fld=0x0

[12325.645802] sd 2:0:0:0: [sde] Add. Sense: Not ready to ready change, medium may have changed

[12325.645806] end_request: I/O error, dev sde, sector 18897

[12325.645809] Buffer I/O error on device sde1, logical block 10705

[12325.645811] lost page write due to I/O error on sde1

[12325.645814] Buffer I/O error on device sde1, logical block 10706

[12325.645816] lost page write due to I/O error on sde1

[12325.645818] Buffer I/O error on device sde1, logical block 10707

[12325.645819] lost page write due to I/O error on sde1

[12325.645822] Buffer I/O error on device sde1, logical block 10708

```

following by fs errors like

```

[ 9305.278449] FAT: Directory bread(block 17498686) failed

[ 9305.278503] FAT: FAT read failed (blocknr 8649)

[ 9306.263543] FAT: unable to read inode block for updating (i_pos 271530233)

```

Then i may press 'Retry' in mc error dialog and it successfully continues copying till next 'Media changed' event in a couple of minutes.

After unmounting, ejecting, inserting and remounting this card the fat apears to be partly damaged. 

My reader is

```

Bus 001 Device 002: ID 058f:6362 Alcor Micro Corp. Hi-Speed 21-in-1 Flash Card Reader/Writer (Internal/External)

```

I mount /dev/sde1 with 'flush' option to avoid kernel caching. 

I tried another micro sd card (Kingston 8gb) and another sd card reader (from myson) - the same.

What to do ?

----------

## erik258

Hmm, it's possible the sd cards are worn out.  They do seem to do that with time.  Or else, they're obviously SDHC cards; I don't think the regular SDs get that big.  Does your drive support sdhc?  If it doesn't it shouldn't even see the partitions, but just a thought.

----------

## Mad Merlin

I'd bank on the wearing out idea. Are the blocks listed always the same ones for a particular card, or is there a pattern the the block numbers maybe?

----------

## nickk

Yes, they are sdhc cards and are supported. The blocks numbers are different each time.

The both cards are quite new.

----------

## erik258

You know, the other day I plugged an 8G sdhc card into my newish acer aspire one netbook, and it started spitting out ATA errors in dmesg.  My friend (coincidentally, he also has an aspire one, albeit an older version with, he tells me, a pci express sdhc reader rather than a usb-connected reader like in my case) stuck it in his netbook and it worked fine.  I then stuck it back in mine, and wouldn't you know, I never got errors from it again (although I didn't use it much, just grabbed some pictures off it).  

The other option is that the card's just bad.  Not worn out, just from a bad batch.  If you got both the cards in the same place they might both have been from the same batch.  It's really bizarre that the block numbers aren't consistent.  There's no reason they should be jumping around, not that I can think of at least.  Is there any way you can test them in another device - like a windows computer or a different linux box, a camera or something?

----------

## DirtyHairy

Have you tried switching cables? If have already had multiple occasions of strange transfer failures which turned out to be due to poor quality cables.

----------

