Help a newbie recover encrypted partitions from USB stick after accidental format.

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
pavlidis
Posts: 4
Joined: 06 Oct 2020, 15:52

Help a newbie recover encrypted partitions from USB stick after accidental format.

#1 Post by pavlidis »

Hello everyone. I have a dual boot laptop with Windows 10 and Manjaro Linux. On Manjaro Linux I used the GNOME Disks tool to encrypt a Sandisk 128 gb USB stick. I accidentally formatted this USB stick on Windows 10 (while trying to clean the keyboard).

I installed TestDisk on Manjaro and tried PhotoRec first as most of the files I want to recover are pictures. I specified the recovery path on my home/desktop and not on the USB stick. It didn't work. I only recovered a "report.xml" file a ".luks" file and a ".swf" file.

I tried TestDisk next which is kinda overwhelming. I am not very tech savvy and English is not my main language. The steps I did were:

1. Run

Code: Select all

sudo teskdisk[/code ] from terminal and gave my password.
2. Selected [code]create
and pressed enter.
3. Selected the SanDisk usb stick and pressed proceed.
4. Selected

Code: Select all

Intel Partition
as hinted and then enter.
5. Selected

Code: Select all

Analyse
and hit enter.
6. Selected

Code: Select all

Quick Search
and hit enter. I waited for a few mins for the utility to analyze the cylinders as shown in the above picture: Image[/img].
7. When the process was done it found a Primary bootable Linux partition. I presssed enter to continue. Image[/img].
8. I did a deeper search and waited. Image[/img].
9. When the deeper search ended I was presented with 2 deleted partitions. A Linux one which I am guessing its the partition containing the encryption(password) and a HPFS - NTFS partition which I assume contains the actual pictures. Image[/img].

How do I proceed from here guys? I am kinda stuck as I dont understand what to do next.

Sorry for the long post and thanks in advance for your help.
Last edited by pavlidis on 06 Oct 2020, 20:35, edited 2 times in total.

recuperation
Posts: 2735
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Help a newbie recover encrypted partitions from USB stick after accidental format.

#2 Post by recuperation »

You have to decrypt your stick first. Recovery software including Testdisk and Photorec can only work on readible media.

pavlidis
Posts: 4
Joined: 06 Oct 2020, 15:52

Re: Help a newbie recover encrypted partitions from USB stick after accidental format.

#3 Post by pavlidis »

How can I decrypt the USB stick? Its empty. It was formatted. I can open it without asking for a password or something.

recuperation
Posts: 2735
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Help a newbie recover encrypted partitions from USB stick after accidental format.

#4 Post by recuperation »

Do you have a LUKS header-backup?

Your header might have been destroyed by the format operation.

viewtopic.php?p=30640#p30640

pavlidis
Posts: 4
Joined: 06 Oct 2020, 15:52

Re: Help a newbie recover encrypted partitions from USB stick after accidental format.

#5 Post by pavlidis »

Unfortunately I don't have a LUKS header-backup.

recuperation
Posts: 2735
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Help a newbie recover encrypted partitions from USB stick after accidental format.

#6 Post by recuperation »

What did you encrypt?
The whole stick or the partition on the stick (assuming there was not more than one partition)?

pavlidis
Posts: 4
Joined: 06 Oct 2020, 15:52

Re: Help a newbie recover encrypted partitions from USB stick after accidental format.

#7 Post by pavlidis »

Its been years but I think I encrypted the whole USB stick.

recuperation
Posts: 2735
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Help a newbie recover encrypted partitions from USB stick after accidental format.

#8 Post by recuperation »

In this case recovery is impossible.

Please show the first sector of your USB-stick by copying it into a file named "mbr.bin" p.e..

Replace the content of the [] marked areas in the command below, you might have to use the sudo command:

Code: Select all

(sudo) dd if=[path to your USB device] of=/home/[yourprofile]/mbr.bin bs=512 count=1
Post the command you used and try to upload this binary file here or link it from the forum.

Locked