вторник, 4 декември 2012 г.

How (not) to rescue information from a broken memory stick

Ok, this wasn't a success story, or at least not for now, but I'm gonna paste here what I've done so far, just in case it might come handy one day.
The problem: my memory stick broke down. An 8GB Transcend. Needless to say how much I hate it. Anyway, from it, I need desperately to recover 1 file, but to no avail for the moment. There are my futile actions:
1. Use testdisk to recover the data. I have used testdisk to recover files from a messed up partition of my hard drive, so I know it works. The problem is that on the USB-stick it won't work - it lists only 10 or so files and among them is not the one I need. I used it, however to create an image of the drive. Well, it won't mount.
2. I had some doubts that maybe the geometry of the disk is wrong (after testdisk complained about it), so I wondered how to check it. Well, I used another Transcend stick, formatted similarly (fat 32, so that the car's stereo can read it) and I used the following commands:
$fdisk -l /dev/sdc
This displays the start and end blocks.
$sfdisk -g /dev/sdc
This shows the geometry of your device (cylinders, sector size and so on).
If you want to change the geometry without testdisk, you can use:
$sfdisk -C 21648 -H 19 -S 19 /dev/sdb
(source)
Just don't forget this is a dangerous operation so don't do it unless you're sure you need it.
3. Then I tried ddrescue. It's on entropy, so the installation is not a problem. The question was how to use it. I used this two site: site1, site2 to learn more.
In the end I did:
$ddrescue -r 3 /dev/sdc /some/folder/disk.img logfile
to copy the device.
(I didn't do "$fsck -y /dev/sda2/backup.img" to check if the image is healthy, but you could if you want)
Then I wanted to open the image:
$mount -o loop –t ntfs /some/folder/disk.img /mnt/folder2
It didn't work. Gave me an error in /dev/loop0 .
You could do
$dd if=/mnt/folder1/disk.img of=/dev/sdxn
to copy the image to another device, but I didn't have any at hand.
So this is my struggle for the moment. Any advice would be appreciated. 

Няма коментари:

Публикуване на коментар