You are not logged in.

#1 2016-04-24 13:57:38

nrms
Member
Registered: 2014-12-24
Posts: 6

Lost file system on SD card

Hello
I am in trouble with the SD card that hosted my system on my Raspberry Pi. No filesystem is found.

$ fdisk /dev/mmcblk0 
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xc48c3aeb.

Command (m for help): p
Disk /dev/mmcblk0: 3.8 GiB, 4008706048 bytes, 7829504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc48c3aeb

I tried to restore files with PhotoRec but nothing comes up.

It's been dead since the Raspi was plugged&unplugged a couple of times with no care.

Any chance I get my system back ?

Thanks

Offline

#2 2016-04-24 14:37:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,771

Re: Lost file system on SD card

Did you commit those changes using the 'w' command in fdisk?
It definitely won't help recover files, but it might recover the SD.

If that does not work, be careful and carefully try the dd command carefully. Be careful.
sudo dd if=/dev/zero of=/dev/mmblk0
Be careful, if you use this command, type it carefully.  Before you hit return, read what you carefully typed.  Twice.
If you are not careful and you get the of (output file) parameter wrong, dd will gleefully destroy whatever it is it points to.

Then, repartition and reformat.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2016-04-24 15:12:33

nrms
Member
Registered: 2014-12-24
Posts: 6

Re: Lost file system on SD card

Nope I didn't commit. Actually I didn't try to write anything new because my main concern was to recover my system, before writing a new one. If possible, I'd like to know what happened before I try to write new stuff, do you have any idea about what might have happened ? Is it possible it died because of savage unplugging ? Thanks

Last edited by nrms (2016-04-24 15:12:52)

Offline

#4 2016-04-24 15:18:06

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: Lost file system on SD card

I dont have a Raspi myself but heard several times it can cause damage to SD card on power loss. So shutdown first before you unplug it.

Make an image of the card (ddrescue) and then testdisk/photorec/...

If there's nothing then bad luck, not much else you can do. It wasn't encrypted, was it?

Offline

#5 2016-04-24 15:32:30

nrms
Member
Registered: 2014-12-24
Posts: 6

Re: Lost file system on SD card

frostschutz wrote:

I dont have a Raspi myself but heard several times it can cause damage to SD card on power loss. So shutdown first before you unplug it.

Make an image of the card (ddrescue) and then testdisk/photorec/...

If there's nothing then bad luck, not much else you can do. It wasn't encrypted, was it?

I meant unplug the power supply from the Raspi itself, not unplugging the SD from the Raspi. Forgot about testdisk, only ran PhotoRec so far. It's not encrypted.

Here is what I get from Testdisk analysis :

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/mmcblk0 - 4008 MB / 3823 MiB - CHS 122336 4 16

Warning: the current number of heads per cylinder is 4
but the correct value may be 128.
You can use the Geometry menu to change this value.
It's something to try if
- some partitions are not found by TestDisk
- or the partition table can not be written because partitions overlaps.

then

Disk /dev/mmcblk0 - 4008 MB / 3823 MiB - CHS 122336 4 16
     Partition               Start        End    Size in sectors
>* FAT16 LBA               32   0  1  3039   3 16     192512

it seems small, maybe a boot partition ?

Last edited by nrms (2016-04-24 15:44:29)

Offline

#6 2016-04-24 15:49:34

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Lost file system on SD card

Make an image of the sd card first, then you can experiment.

That said, you should have some idea of how you partitioned the sd card, you shouldn't lose anything by just trying different partition schemes.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB