phone SD recovery attempts

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read
Posts: 1
Joined: 20 Apr 2013, 15:32

phone SD recovery attempts

#1 Post by tigerknight »

I rebooted my phone earlier and it came back up asking if I wanted to format my SD because it was blank. This confused me so I did some digging, which led me to this tool (seriously, every other post I saw referred to testdisk). I went through the steps for fat32 recovery, and tried to do a rebuild of the boot sector - which is appears what went belly up - but it never fixes it. It will run through the 'rebuild bs' check, then dumps me back to a screen where it says both the boot and backup are bad, and identical, and that's it. I'm stuck.

I'd really like to NOT lose this data, I've got pictures from my sister's wedding, data and etc of my own that I need, and more. I ran the photorec option which finds a ton of stuff so I'm sure it's still all there, I just need to repair the tables.

Attached is a screenshot showing what happens after having run 'Rebuild BS' - if I do a Dump, there's nothing but a solid screen of 'ffffffff' for both sides (primary and backup boot sectors).


I've been trying to do some work on it still. When I plug it into my linux system via USB SD card slot, it detects the drive and the partition, but I get the following messages:

Code: Select all

2121379.250027] usb 1-2: new high speed USB device using ehci_hcd and address 4
[2121379.407981] usb 1-2: configuration #1 chosen from 1 choice
[2121379.431707] Initializing USB Mass Storage driver...
[2121379.431901] scsi7 : SCSI emulation for USB Mass Storage devices
[2121379.432055] usbcore: registered new interface driver usb-storage
[2121379.432058] USB Mass Storage support registered.
[2121379.432252] usb-storage: device found at 4
[2121379.432254] usb-storage: waiting for device to settle before scanning
[2121384.430246] usb-storage: device scan complete
[2121384.431082] scsi 7:0:0:0: Direct-Access     Generic  USB  SD Reader   1.00 PQ: 0 ANSI: 0 CCS
[2121384.431991] sd 7:0:0:0: Attached scsi generic sg3 type 0
[2121384.434572] sd 7:0:0:0: [sdc] 30904320 512-byte logical blocks: (15.8 GB/14.7 GiB)
[2121384.435060] sd 7:0:0:0: [sdc] Write Protect is off
[2121384.435063] sd 7:0:0:0: [sdc] Mode Sense: 4b 00 00 08
[2121384.435066] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[2121384.437810] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[2121384.437833]  sdc: sdc1
[2121384.441557] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[2121384.441579] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[2121477.998419] FAT: bogus logical sector size 65535
[2121477.998439] VFS: Can't find a valid FAT filesystem on dev sdc1.
and with various attempts at mounting it I also got:

Code: Select all

[2125995.559782] FAT: bogus number of reserved sectors
[2125995.559802] VFS: Can't find a valid FAT filesystem on dev sdc1.
I've taken a dd image of the drive, and as mentioned before run photorec against it and pulled out lots of data. Is it possible perhaps to format it cleanly, then do a dd back from my image but only get the actual data parts and skip the initial/corrupt blocks of data? Where does that bit end and the rest of it start though?


More digging, still trying to find how far to go but I think at least I've got the options needed for dd to go to where I need to get the data into a valid partition (if the idea works):

Code: Select all

              skip BLOCKS obs-sized blocks at start of output

              skip BLOCKS ibs-sized blocks at start of input
Use 'skip' to read in my dd image past the messed up boot sector part, use 'seek' to go the same amount and load data behind the good boot sector of a freshly formatted SD card. Still digging for how much that would be though.

Given 64 heads, 32 sectors per track, sector size of 512, and the boot sector dump showing 05F8 (which turns into 1528 in decimal) chunks.. annnnnd I'm lost now.
testdisk-rebuildbs.jpg (63.55 KiB) Viewed 1964 times