Restore accidentally formatted partition

How to use TestDisk to recover lost partition
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 https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
Nostradamus
Posts: 1
Joined: 17 Aug 2016, 20:22

Restore accidentally formatted partition

#1 Post by Nostradamus »

I am trying to restore an accidentally formatted flash drive.
The drive was previously formatted on Mac, probably HFS+
It is now formatted in Windows as exFat.

What I have done already:
1. Started TestDisk and selected the correct media
2. Selected [EFI GPT] partition table type, which was detected automatically. (I have also tried Intel and Mac to no avail)
3. Selected [Advanced] and changed the type to Mac HFS -> HFS +
4. Selected [Superblock] (seemed like the only reasonable option, the other option being [Image Creation])
5. After selecting [Superblock] it reproted:
Volume header
Bad

Backup volume header
HFS+ OK

Sectors are not identical.
6. Tried [Backup BS] which reported:
Write error: Can't overwrite HFS/HFS+ main volume header

--------------------------------------------------------------------------------
I have also tried analyzing the media:
[Quick search] brings me:
P MS Data Start 64 End 250068991 Size in sectors 250068928

[Deeper search] brings an MS Data pertiotns and lost of Mac HFS ones with HFS+ blocksize=4096 and NO Backup

--------------------------------------------------------------------------------

The log file is attached.

Any advice is highly appreciated.

Thanks in advance.
Attachments
testdisk.zip
(6.03 KiB) Downloaded 248 times

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

Re: Restore accidentally formatted partition

#2 Post by cgrenier »

TestDisk can't overwrite the superblock because the partition is actually mounted.
Start a Terminal, run "mount", you should see the reformated partition listed, run "umount /dev/XXX" (replace XXX by the correct value)
Once it's done, run TestDisk again, the disk should not be identified as RO (Read Only) this time. Try again to rewrite the superblock.

Locked