Confirm LUKS Partition Restore Procedure

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
Post Reply
Message
Author
linxnewb
Posts: 2
Joined: 15 Mar 2019, 00:15

Confirm LUKS Partition Restore Procedure

#1 Post by linxnewb » 15 Mar 2019, 01:00

:geek: I've recovered deleted partitions on a linux boot disk with LUKS full disk encryption via TestDisk, A boot partition along with 2MB header, for LUKS encrypted partition has been recovered. I need to extend the 2MB Luks header to the end of the 1TB Hard disk. It sounds like this should be easy to do based on other posts, but the numbers and options in TestDisk don't make sense to me. Here are the recovered partitions:
Disk /dev/sde - 1000 GB / 931 GiB - CHS 121601 255 63
Partition Start End Size in sectors
>* Linux 0 32 33 62 53 55 997376
P Linux 62 86 25 62 151 25 4096
When I press 'a' on the Primary partition with 4096 sectors I see this:
Disk /dev/sde - 1000 GB / 931 GiB - CHS 121601 255 63
No partition 62 151 26 121600 254 63 1952514497
I don't know what the above means, but if I 'Change Ending Sector' to the default value of 63, will that extend my LUKS partition to the end of disk? Confirmation that this is the correct process would be greatly appreciated, as I'm very nervous about committing this change. :)

Sponsored links

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

Re: Confirm LUKS Partition Restore Procedure

#2 Post by cgrenier » 15 Mar 2019, 07:01

To restore a LUKS partition, use 'a' to manually add a new partition, you need to set the starting location to the location of the LUKS header found by TestDisk.
The end location may be the end of the disk (your case) or the sector before the next partition.
Set the partition type. Set the partition as P(rimary) and on next screen, Write, confirm and restart your computer.

linxnewb
Posts: 2
Joined: 15 Mar 2019, 00:15

Re: Confirm LUKS Partition Restore Procedure

#3 Post by linxnewb » 15 Mar 2019, 09:15

Thanks for the quick response cgrenier! You're my hero! :D I think newbs like me just don't know how to read the numbers relating to Cylinders, Heads and Sectors.

1. Based on my research, I now know I need to write down the three numbers listed under Partition Start( which I now understand represent Cylinders, Heads, Sectors (CHS) in respective order).

2. When I press 'a' to "add partition" I will place the current header at the start of a new partition by transplanting the same CHS start values to the start location of the new partition. I will then max out all three CHS end values to reach the end of the disk.

3. MY LAST QUESTION: Does the new LUKS encrypted partition need to be changed to a different partition type? Linux (83) is the current partition type. I'm assuming I should make NO CHANGE?

:D I'LL BE SURE TO DONATE WHEN I GET MY DISK BACK! :D THANK YOU!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests