Restoring FAT32 filesystem after accidentally formatting it

How to use TestDisk to recover lost partition
Post Reply
Message
Author
andoru
Posts: 3
Joined: 16 Jul 2016, 02:06

Restoring FAT32 filesystem after accidentally formatting it

#1 Post by andoru » 16 Jul 2016, 02:11

As a background to what happened: I installed a custom recovery on my Android phone, and I wanted to restore the phone's state from a backup after I experimented with something. Before restoring a backup, I usually do a factory reset, and that's what I also did this time, but this time I accidentally set it to wipe the SD card and the Phone's internal memory too...

Luckly it didn't do a secure wipe, as it took less than 4 secs to format everything, however it did make a new (blank) partition. I tried so far to recover the partition with testdisk, but all it would do is to recover the blank partition. Also I tried recovering the files with photorec, and while I did get most of the data back, the filenames and folder structure wasn't retained, so all the files were dumped in a single folder with (what I assume to be) inode reference number as filenames.

Is there any way to recover the data and restore it intact, the way it was on the SD card before wiping it? Or at least to be able to recover the files the photorec way with the proper filenames and directory structure.

I didn't do any modifications to the filesystem itself so far, left it intact as it was previously. Also did a backup with dd of the whole SD card.

Sponsored links

User avatar
cgrenier
Site Admin
Posts: 3562
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Restoring FAT32 filesystem after accidentally formatting it

#2 Post by cgrenier » 16 Jul 2016, 08:35

Run PhotoRec, in Options, enable the expert mode, start a recovery, answer Yes when asked if you want to try to unformat the partition, use the default values otherwise.
It may be able to recover the original filenames.

andoru
Posts: 3
Joined: 16 Jul 2016, 02:06

Re: Restoring FAT32 filesystem after accidentally formatting it

#3 Post by andoru » 16 Jul 2016, 22:48

Okay, I did that now, and it managed to recover some files with their original filenames, but what I forgot to mention last time was that PhotoRec doesn't recover all the files, and some of the files it does recover end up being incomplete or corrupted...
Is there really no way to entirely recover the deleted partition with testdisk?

andoru
Posts: 3
Joined: 16 Jul 2016, 02:06

Re: Restoring FAT32 filesystem after accidentally formatting it

#4 Post by andoru » 21 Jul 2016, 23:40

Anyone...?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest