Page 1 of 1

Recover random 4kb binary file

Posted: 09 May 2017, 12:07
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?

Re: Recover random 4kb binary file

Posted: 10 May 2017, 06:12
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.

Re: Recover random 4kb binary file

Posted: 10 May 2017, 08:48
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.