Is there any chance to recover some files that are on a SD card which doesn't boot anymore? Seems the last power-cut affected some files on the card and the Raspberry Pi is not able to boot anymore.
2 Answers
First, why it doesn't boot? What do the lights show? Debug it with this wiki
The problem might be in the FAT partition, that can be easily recovered by reformating and put back the files (Using either your image or one downloaded from the web.)
If it's the Linux filesystem, loading it on a Linux (even a liveCD) and running fsck
might be enough to recover it.
So attach the SD card, open a console and do dmesg
to view the label of the last disk (example sdb
) discovered, do fdisk -l /dev/sdb
to see what partitions exist. The Linux one should be called Linux (example sdb2
). finally do fsck /dev/sdb2
to scan and fix the filesystem.
If all fails, maybe the SD has gone bad, I would do a dd if=/dev/sdb of=file.img
(of even better dd_rescue /dev/sdb file.img
if you have dd_rescue
installed) to backup the SD to a file and trying to recover things from there, by transforming the image on a device with losetup --find --show file.img
work on it.

- 289
- 1
- 3
- 13

- 684
- 5
- 6
-
Thanks man, at least I was able to recover some of my code by fsck command. – Priyank Bolia Sep 02 '13 at 13:40
If the filesystem isn't corrupted badly, it's possible to mount it on another system and copy the files off.
On another Linux system, type sudo mount -o ro /dev/mmcblk0p2 /mnt
into a terminal. This mounts the SD card (assuming it's at mmcblk0
) read-only at /mnt
.
From there you can browse into the directory structure with a file manager and copy any needed files.

- 1,378
- 1
- 13
- 25