Recover random 4kb binary file

Using PhotoRec to recover lost data
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
sob42
Posts: 2
Joined: 09 May 2017, 08:43

Recover random 4kb binary file

#1 Post by sob42 »

Hello all,

I had encrypted by key+passphrase drive (FreeBSD Geli). For key i generated 4kb random binary file (dd if=/dev/urandom of=file.key bs=4096 count=1) I added it as a keyfile for my storage. Unfortunately I deleted by mistake partition table (EFI ZFS partition table)from that drive with no backup of this keyfile :(. I've tried to use photorec for recovery of this drive, but as my key is random binary (in my opinion) photorec did not find this file. I've tried to recovery the parition table of hdd but with no luck. Does anyone can help me with my case - how can I find this and recovery this file?

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

Re: Recover random 4kb binary file

#2 Post by cgrenier »

photorec will not work with your random data file.
testdisk may be able to find the location of your zfs partition but not its size.
You will have to manually add ('a' key) a partition with the same location and ending before the next partition or the end of the disk.

sob42
Posts: 2
Joined: 09 May 2017, 08:43

Re: Recover random 4kb binary file

#3 Post by sob42 »

Thank you for your replay and clarification. Could you extend your sentence (or give me some howTo source) of
You will have to manually add ('a' key) a partition with the same location and ending before the next partition or the end of the disk.

Locked