LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-11-2021, 07:01 AM   #1
mgau
LQ Newbie
 
Registered: May 2021
Posts: 1

Rep: Reputation: Disabled
Question Resolved


Removed for privacy reasons

Last edited by mgau; 05-20-2021 at 09:33 AM.
 
Old 05-11-2021, 10:16 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,704

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
Writing primary partition info to the partition table has no detrimental effects. If however you use a tool that also formats the partition then you're in strife. I have no idea what the Windows tools do in that regard. Your post indicates it didn't, although I'm surprised there is so much readable text in a supposedly encrypted disk. That might indicate you had more than just the LUKS container - maybe an unencrypted boot and/or EFI partition. I would expect testdisk to find either of those ok though.

Quote:
Originally Posted by rknichols
The LUKS header contains no information about the size of the volume, and thus testdisk cannot determine the correct size of the partition.
Hopefully he will pass by this thread - but in the meantime I'd extend that /dev/sda1 to the end of the disk and see if a luksopen will work on that. fdisk will work as will parted - be careful to align the start as given by testdisk. I wouldn't use gparted as it might reformat just to help you out. I have an intrinsic distrust of GUI tools for this sort of thing. They are beaut for day-to-day tasks.
 
Old 05-12-2021, 08:04 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,547

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
testdisk is normally pretty good at finding LUKS partitions, just unable to determine their size.

As a last resort, run this:
Code:
hexdump -C /dev/sda | grep '  4c 55 4b 53 ba be'
That's the ASCII characters "LUKS" followed by the hex bytes 0xBA and 0xBE. That string marks the start of a LUKS header. If that string is not found on the disk, the header has been overwritten and your data is unrecoverable unless you have a header backup stored somewhere. If the LUKS partition was somewhere near the start of the disk, there is little point in waiting the long time it would take for hexdump to read through the whole disk,
 
Old 05-13-2021, 12:20 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,237
Blog Entries: 10

Rep: Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160
Quote:
Originally Posted by syg00 View Post
I wouldn't use gparted as it might reformat just to help you out.
I have to speak out on behalf of gparted here - it only ever works on the selcted drive, does nothing until you click "Apply", and even then it only applies what is clearly listed.

Sorry I have nothing more constructive to offer here.
I'm vaguely suspicious of using Windows tools to recover Linux partitions, but testdisk should be testdisk whether you use it on Windows or Linux.

Just one thing:
STOP using the physical drive immediately!
All actions should be performed from an operating system that does not run on the drive in question (not even swap), recovered files should never be saved back to the same drive; in a nutshell: the affected drive should only be read from, not written to.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot get past GDISK- Caution: Invalid backup GPT header, but valid main header, regenerating backup header from main header. murde Linux - Newbie 2 05-30-2020 08:23 PM
[SOLVED] It's possible to recover a LUKS header with this data? Adriano_B Linux - Security 13 12-16-2017 08:36 AM
[SOLVED] recover from deleted luks encryption partition unixedway Linux - General 12 01-16-2017 06:33 AM
[SOLVED] How to Recover Deleted (partly overwritten) Files in /home on ext3 fs, ubuntu 6.06 the_new_z Linux - Newbie 3 08-05-2010 01:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration