Ubuntu 14.04 LTS corrupt microSD - manual recovery?

0

i have a corrupt microSD card from a colleague. He asked me to save his data if possible. I use a recent usb-multi-cardreader. The microSD is a high capacity card with 32gb of space. I suspect it to have a corrupt partition table or something similar...

I tried to use testdisk but the device is not detected because it shuts down obviously (see dmesg log). However when i insert the microSD and start testdisk fast enough (immediately after inserting), the card is detected but it gets unavailable and testdisk cant find it anymore after 2 seconds. (/dev/sdd is not available anymore)

My question is how can i prevent the system to unload the device? Is this regulated by the cardreader, the driver or by the linux system? Is there anything i can do manually? Or do you think the card is fried and i should put it in the trash?

When i insert the card there is the following output via dmesg:

[ 2681.737700] sd 6:0:0:2: [sdd] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
[ 2685.791546] sd 6:0:0:2: [sdd] Device not ready
[ 2685.791551] sd 6:0:0:2: [sdd]  
[ 2685.791552] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.791554] sd 6:0:0:2: [sdd]  
[ 2685.791556] Sense Key : Not Ready [current] 
[ 2685.791559] sd 6:0:0:2: [sdd]  
[ 2685.791561] Add. Sense: Medium not present
[ 2685.791563] sd 6:0:0:2: [sdd] CDB: 
[ 2685.791565] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.791571] blk_update_request: 7 callbacks suppressed
[ 2685.791573] end_request: I/O error, dev sdd, sector 0
[ 2685.791577] Buffer I/O error on device sdd, logical block 0
[ 2685.792878] sd 6:0:0:2: [sdd] Device not ready
[ 2685.792881] sd 6:0:0:2: [sdd]  
[ 2685.792883] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.792884] sd 6:0:0:2: [sdd]  
[ 2685.792885] Sense Key : Not Ready [current] 
[ 2685.792887] sd 6:0:0:2: [sdd]  
[ 2685.792888] Add. Sense: Medium not present
[ 2685.792890] sd 6:0:0:2: [sdd] CDB: 
[ 2685.792891] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.792895] end_request: I/O error, dev sdd, sector 0
[ 2685.792897] Buffer I/O error on device sdd, logical block 0
[ 2685.794126] sd 6:0:0:2: [sdd] Device not ready
[ 2685.794129] sd 6:0:0:2: [sdd]  
[ 2685.794131] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.794133] sd 6:0:0:2: [sdd]  
[ 2685.794134] Sense Key : Not Ready [current] 
[ 2685.794137] sd 6:0:0:2: [sdd]  
[ 2685.794147] Add. Sense: Medium not present
[ 2685.794149] sd 6:0:0:2: [sdd] CDB: 
[ 2685.794150] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.794156] end_request: I/O error, dev sdd, sector 0
[ 2685.794159] Buffer I/O error on device sdd, logical block 0
[ 2685.795665] sd 6:0:0:2: [sdd] Device not ready
[ 2685.795670] sd 6:0:0:2: [sdd]  
[ 2685.795672] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.795674] sd 6:0:0:2: [sdd]  
[ 2685.795675] Sense Key : Not Ready [current] 
[ 2685.795679] sd 6:0:0:2: [sdd]  
[ 2685.795682] Add. Sense: Medium not present
[ 2685.795684] sd 6:0:0:2: [sdd] CDB: 
[ 2685.795686] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.795694] end_request: I/O error, dev sdd, sector 0
[ 2685.795697] Buffer I/O error on device sdd, logical block 0
[ 2685.797005] sd 6:0:0:2: [sdd] Device not ready
[ 2685.797010] sd 6:0:0:2: [sdd]  
[ 2685.797012] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.797014] sd 6:0:0:2: [sdd]  
[ 2685.797015] Sense Key : Not Ready [current] 
[ 2685.797019] sd 6:0:0:2: [sdd]  
[ 2685.797021] Add. Sense: Medium not present
[ 2685.797024] sd 6:0:0:2: [sdd] CDB: 
[ 2685.797025] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.797033] end_request: I/O error, dev sdd, sector 0
[ 2685.797036] Buffer I/O error on device sdd, logical block 0
[ 2685.798384] sd 6:0:0:2: [sdd] Device not ready
[ 2685.798387] sd 6:0:0:2: [sdd]  
[ 2685.798389] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.798391] sd 6:0:0:2: [sdd]  
[ 2685.798392] Sense Key : Not Ready [current] 
[ 2685.798395] sd 6:0:0:2: [sdd]  
[ 2685.798397] Add. Sense: Medium not present
[ 2685.798399] sd 6:0:0:2: [sdd] CDB: 
[ 2685.798400] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.798407] end_request: I/O error, dev sdd, sector 0
[ 2685.798409] Buffer I/O error on device sdd, logical block 0
[ 2685.799623] sd 6:0:0:2: [sdd] Device not ready
[ 2685.799625] sd 6:0:0:2: [sdd]  
[ 2685.799626] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.799628] sd 6:0:0:2: [sdd]  
[ 2685.799630] Sense Key : Not Ready [current] 
[ 2685.799632] sd 6:0:0:2: [sdd]  
[ 2685.799634] Add. Sense: Medium not present
[ 2685.799637] sd 6:0:0:2: [sdd] CDB: 
[ 2685.799646] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.799652] end_request: I/O error, dev sdd, sector 0
[ 2685.799653] Buffer I/O error on device sdd, logical block 0
[ 2685.800870] sd 6:0:0:2: [sdd] Device not ready
[ 2685.800872] sd 6:0:0:2: [sdd]  
[ 2685.800873] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.800874] sd 6:0:0:2: [sdd]  
[ 2685.800875] Sense Key : Not Ready [current] 
[ 2685.800877] sd 6:0:0:2: [sdd]  
[ 2685.800879] Add. Sense: Medium not present
[ 2685.800880] sd 6:0:0:2: [sdd] CDB: 
[ 2685.800881] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.800887] end_request: I/O error, dev sdd, sector 0
[ 2685.800888] Buffer I/O error on device sdd, logical block 0
[ 2685.800922] ldm_validate_partition_table(): Disk read failed.
[ 2685.802152] sd 6:0:0:2: [sdd] Device not ready
[ 2685.802157] sd 6:0:0:2: [sdd]  
[ 2685.802159] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.802162] sd 6:0:0:2: [sdd]  
[ 2685.802163] Sense Key : Not Ready [current] 
[ 2685.802167] sd 6:0:0:2: [sdd]  
[ 2685.802170] Add. Sense: Medium not present
[ 2685.802172] sd 6:0:0:2: [sdd] CDB: 
[ 2685.802174] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.802194] end_request: I/O error, dev sdd, sector 0
[ 2685.802198] Buffer I/O error on device sdd, logical block 0
[ 2685.803514] sd 6:0:0:2: [sdd] Device not ready
[ 2685.803517] sd 6:0:0:2: [sdd]  
[ 2685.803518] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.803520] sd 6:0:0:2: [sdd]  
[ 2685.803522] Sense Key : Not Ready [current] 
[ 2685.803524] sd 6:0:0:2: [sdd]  
[ 2685.803526] Add. Sense: Medium not present
[ 2685.803529] sd 6:0:0:2: [sdd] CDB: 
[ 2685.803530] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.803543] end_request: I/O error, dev sdd, sector 0
[ 2685.803545] Buffer I/O error on device sdd, logical block 0
[ 2685.804743] sd 6:0:0:2: [sdd] Device not ready
[ 2685.804745] sd 6:0:0:2: [sdd]  
[ 2685.804746] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.804747] sd 6:0:0:2: [sdd]  
[ 2685.804748] Sense Key : Not Ready [current] 
[ 2685.804750] sd 6:0:0:2: [sdd]  
[ 2685.804751] Add. Sense: Medium not present
[ 2685.804752] sd 6:0:0:2: [sdd] CDB: 
[ 2685.804753] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.805997] sd 6:0:0:2: [sdd] Device not ready
[ 2685.805999] sd 6:0:0:2: [sdd]  
[ 2685.806001] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.806003] sd 6:0:0:2: [sdd]  
[ 2685.806004] Sense Key : Not Ready [current] 
[ 2685.806007] sd 6:0:0:2: [sdd]  
[ 2685.806008] Add. Sense: Medium not present
[ 2685.806011] sd 6:0:0:2: [sdd] CDB: 
[ 2685.806012] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.806033] Dev sdd: unable to read RDB block 0
[ 2685.807249] sd 6:0:0:2: [sdd] Device not ready
[ 2685.807252] sd 6:0:0:2: [sdd]  
[ 2685.807254] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.807256] sd 6:0:0:2: [sdd]  
[ 2685.807257] Sense Key : Not Ready [current] 
[ 2685.807260] sd 6:0:0:2: [sdd]  
[ 2685.807262] Add. Sense: Medium not present
[ 2685.807264] sd 6:0:0:2: [sdd] CDB: 
[ 2685.807265] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.808496] sd 6:0:0:2: [sdd] Device not ready
[ 2685.808499] sd 6:0:0:2: [sdd]  
[ 2685.808500] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.808502] sd 6:0:0:2: [sdd]  
[ 2685.808504] Sense Key : Not Ready [current] 
[ 2685.808506] sd 6:0:0:2: [sdd]  
[ 2685.808508] Add. Sense: Medium not present
[ 2685.808510] sd 6:0:0:2: [sdd] CDB: 
[ 2685.808511] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.809747] sd 6:0:0:2: [sdd] Device not ready
[ 2685.809749] sd 6:0:0:2: [sdd]  
[ 2685.809751] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.809752] sd 6:0:0:2: [sdd]  
[ 2685.809754] Sense Key : Not Ready [current] 
[ 2685.809756] sd 6:0:0:2: [sdd]  
[ 2685.809758] Add. Sense: Medium not present
[ 2685.809760] sd 6:0:0:2: [sdd] CDB: 
[ 2685.809762] Read(10): 28 00 00 00 00 18 00 00 08 00
[ 2685.811137] sd 6:0:0:2: [sdd] Device not ready
[ 2685.811139] sd 6:0:0:2: [sdd]  
[ 2685.811141] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.811143] sd 6:0:0:2: [sdd]  
[ 2685.811144] Sense Key : Not Ready [current] 
[ 2685.811146] sd 6:0:0:2: [sdd]  
[ 2685.811148] Add. Sense: Medium not present
[ 2685.811151] sd 6:0:0:2: [sdd] CDB: 
[ 2685.811152] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.812375] sd 6:0:0:2: [sdd] Device not ready
[ 2685.812377] sd 6:0:0:2: [sdd]  
[ 2685.812379] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.812381] sd 6:0:0:2: [sdd]  
[ 2685.812382] Sense Key : Not Ready [current] 
[ 2685.812384] sd 6:0:0:2: [sdd]  
[ 2685.812386] Add. Sense: Medium not present
[ 2685.812389] sd 6:0:0:2: [sdd] CDB: 
[ 2685.812390] Read(10): 28 00 00 00 00 00 00 00 08 00
[ 2685.812404]  sdd: unable to read partition table
[ 2685.813745] sd 6:0:0:2: [sdd] Device not ready
[ 2685.813748] sd 6:0:0:2: [sdd]  
[ 2685.813749] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.813751] sd 6:0:0:2: [sdd]  
[ 2685.813752] Sense Key : Not Ready [current] 
[ 2685.813755] sd 6:0:0:2: [sdd]  
[ 2685.813757] Add. Sense: Medium not present
[ 2685.813759] sd 6:0:0:2: [sdd] CDB: 
[ 2685.813760] Read(10): 28 00 03 b7 23 80 00 00 08 00
[ 2685.815011] sd 6:0:0:2: [sdd] Device not ready
[ 2685.815014] sd 6:0:0:2: [sdd]  
[ 2685.815015] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2685.815017] sd 6:0:0:2: [sdd]  
[ 2685.815018] Sense Key : Not Ready [current] 
[ 2685.815021] sd 6:0:0:2: [sdd]  
[ 2685.815023] Add. Sense: Medium not present
[ 2685.815033] sd 6:0:0:2: [sdd] CDB: 
[ 2685.815034] Read(10): 28 00 03 b7 23 80 00 00 08 00
[ 2685.817253] sdd: detected capacity change from 31914983424 to 0

Max Mustermann

Posted 2015-05-20T07:47:11.107

Reputation: 1

Assuming the SD card reader works fine, it seems to me that the SD card is physically defective (not the partition table, this would not remove the device). The approach taken here http://www.planbnet.org/blog/2013-02-06-recovering-data-from-a-broken-sd-card/ (while true; do rsync -rziavP --append --inplace /media/<device> /<backup>/<dir>; done) works if you have considerably more time before the device gets removed (2min, not 2 sec). You could also try to disable all automounts, if this makes the device more persistent, you can try dd.

– 0range – 2015-05-21T22:28:40.743

thx for the info. disabling automount didn't help. the manual in the link didn't work either because the device is not mounted. no partition could be found (sdd: unable to read partition table). i'll try to switch the usb port to usb 1.0 like the author in the link has described, maybe this extends the time – Max Mustermann – 2015-05-22T09:13:21.180

No answers