Recover failed SD card
freebsd at edvax.de
Sun Feb 24 04:53:27 UTC 2019
On Sat, 23 Feb 2019 17:50:27 +0100, Andrea Venturoli wrote:
> A customer of mine gave me an SD card which is quite surely failing.
>From what you're describing, it _has_ failed already. ;-)
> I'm trying to recover what I can.
Did you ask your customer to recover from his backups?
Yes, of course you did. :-)
Okay, let's see:
> I first tried using an USB based reader: altough the SD card should be
> 4GB in size, dd just copies 121MB. So does recoverdisk.
This will probably apply to _any_ copying tool. For things
where dd fails, I often try dd_rescue and ddrescue (two
different programs). They can lower the block size and
perform several retries, but that won't help as the device
reports "end of medium" at 121 MB. And you cannot read
beyond the end of medium. That particular information is
provided by the medium itself.
> "camcontrol readcap /dev/da3" gives:
> > Last Block: 248319, Block Length: 512 bytes
> which agains means about 121MB.
This is "correct" according to what the card identifies as.
> I put the card in another box and i get:
> > mmcsd0: 127MB <SD 0.0 SN 00000000 MFG 00/0000 by 0x0000>
> > at mmc0 0.4MHz/4bit/65535-block
Above assumption is confirmed.
> Is there any way I can get beyond this 121-127MB limit and read what I
> can of the rest?
> I looked into camcontrol's man page, but came up with no idea.
That's probably not directly possible. The media controller
(the "computer" on the SD card) has decided to turn itself
into a 127 MB card, for whatever reason. A _possible_ reason
is that the card is worn out, causing malfunctions. The same
happens to SSDs, but those usually turn into "read-only media"
to preserve the existing information. But for the price of
an SD card, you cannot expect this.
> The card should hold pictures, so I could go ahead with photorec once I
> got an even partial image.
That is the recommended approach. Maybe you can already recover
a fraction of the images stored on the card.
There is another possibility, but it's actually _very_ hard
to do, and it's not guaranteed to work:
Obtain an identical SD card. It has to be "as identical as
possible": same control unit, same memory unit, same firmware
revision (yes, there's "a whole computer with hard- and software"
on that thing!). Transplant the old memory chip to the new
card, removing its new memory chip (empty) beforehand. Then
try another identification.
If it's a micro-SD card, don't inhale the chip. ;-)
As I mentioned, this is quite problematic, because the new
controlller might see a worn-out memory chip and act the same
as the old one. The firmware is closed source, so you don't
have a chance to _know_ how it will act.
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions