How to Recover Data from an Encrypted LUKS Disk

In this article, we will look at how to recover data from drives protected by LUKS encryption technology. We will step through the cross-platform recovery of information from such media using Hetman Partition Recovery, which makes it possible to safely unlock and recover encrypted drives directly in your familiar working environment on Windows, macOS, or Linux.

How to Recover Data from an Encrypted LUKS Disk

Reliable encryption does an excellent job of hiding information from third parties, but it does not protect against accidents or system failures. Accidental deletion of a container file, agreeing to a Windows prompt to format an unrecognized disk, or a crash of the Ext4 file system are common situations in which access to your volumes suddenly disappears. Under such conditions, the presence of cryptographic protection only complicates the situation, but it by no means means the permanent loss of your data.

Go to view
How to Open a LUKS Partition in Windows and Recover Files (Ext4, Btrfs, XFS)

How to Open a LUKS Partition in Windows and Recover Files (Ext4, Btrfs, XFS)

LUKS Encryption Features

In our case, the protection is based on LUKS, or Linux Unified Key Setup. This is a robust block encryption standard that most often uses the strong AES algorithm, turning the entire disk contents into a solid mass of random data for any other system.

It should be noted that older Linux distributions used the first version of the standard, LUKS1, while modern operating systems by default work with the more advanced LUKS2 format, which provides stronger cryptographic protection.

If you connect such a drive to a computer running Windows 11, you will immediately face a double barrier:

  • The first obstacle is that Microsoft’s system does not have built-in tools for decrypting LUKS.
  • The second problem is the complete inability of Windows to read a Linux file system, such as Ext4, which is securely hidden inside the encrypted volume.

To remove cryptographic protection from such a partition, your user password, which you created yourself, or a special key file known as a keyfile is used. If you start a scan without applying them, the search algorithms will see only a continuous set of unintelligible data.

Since the operating system cannot unlock such a disk on its own, Hetman Partition Recovery comes to the rescue.

The all-purpose choice for recovering files from deleted, formatted, damaged, or inaccessible storage devices.
Hetman Partition Recovery: unlocking LUKS

In this case, our program acts as a special technical bridge. It has its own built-in algorithms for recognizing an encrypted container directly in the familiar Windows environment. You only need to enter the password or add your keyfile in the utility interface.

Hetman Partition Recovery: unlocking LUKS with a keyfile

Only after successful unlocking does the program on the fly decrypt the logical structure of the disk. And although in our case we are considering Ext4, the utility can work just as effectively with many other file systems, such as ZFS, Btrfs, or XFS, providing full access to the volume for recovering lost information.

Characteristic Description
Purpose LUKS (Linux Unified Key Setup) is the disk encryption standard in Linux that provides protection against unauthorized access to data.
Encryption type Full Disk Encryption (FDE) or encryption of individual partitions.
Supported algorithms AES, Serpent, Twofish, and other algorithms supported by the Linux dm-crypt subsystem.
Encryption keys A master key is used, which is encrypted with one or more passphrase keys (passwords or key files).
Number of key slots Up to 8 key slots, allowing multiple passwords or key files to be used for a single volume.
Metadata storage The header (LUKS Header) contains information about encryption algorithms, KDF parameters, and key slots.
Key derivation function (KDF) LUKS1 uses PBKDF2, while LUKS2 supports Argon2i and Argon2id, which provide better protection against brute-force attacks.
TRIM support Possible, but requires explicit enabling of the allow-discards parameter, which may partially reduce confidentiality.
Header backup support The ability to create a backup of the LUKS header (luksHeaderBackup) is provided, which is critical for restoring access to data.
Compatibility Works with most Linux file systems (Ext4, XFS, Btrfs, F2FS, etc.) and the LVM logical volume manager.
Performance A slight performance reduction due to the use of AES-NI hardware acceleration on modern processors.
Brute-force protection The use of PBKDF2 or Argon2 significantly complicates brute-force attacks.
Data recovery Access to data requires the correct password, key file, or LUKS header backup. If the header is damaged without a backup, recovery becomes much more difficult or impossible.
LUKS versions LUKS1 is a classic format with broad compatibility; LUKS2 is a modern format with Argon2 support, metadata redundancy, and advanced features.
Typical use cases Encryption of system drives, SSDs, HDDs, USB drives, RAID arrays, LVM volumes, and server storage.

How Do You Connect Storage Media to a PC?

To load encrypted data into Hetman Partition Recovery, there are two main options:

The first is physical connection of the drives to the computer. The most reliable method is to use the SATA ports on the motherboard, which ensures maximum read speed and stable operation.

Physical connection of a drive to a computer via SATA

An alternative is external enclosures or docking stations via USB, although their lower bandwidth may slightly increase scanning time.

Connecting a drive to a computer via a USB dock station

With any physical connection, it is critical to ignore Windows system prompts to format an unrecognized disk.

METHOD 1. Recovering Data from an LUKS Container File

Let us consider the recovery process using a previously mounted virtual image protected by the modern LUKS2 algorithm.

The main advantage of Hetman Partition Recovery is that you do not need to use any third-party tools or boot into a Linux environment to access your own data. The program can work with this technology directly in your Windows 11.

First, you need to mount the container file. To do this, open the program’s main menu and select the Mount disk option.

Hetman Partition Recovery: mounting an LUKS container file

From the available options, select the Raw disk images type.

Hetman Partition Recovery: selecting the Raw disk images type

In the file search window, be sure to change the filter to All files so that you can see and open your container file.

Hetman Partition Recovery: selecting the All files filter for an LUKS container

The selected container will immediately appear in the general list of available devices. The program is now fully ready to analyze your volume.

Hetman Partition Recovery: mounted LUKS container

Next, click the encrypted volume in the utility’s disk manager and enter your user password in the corresponding window.

Hetman Partition Recovery: unlocking LUKS

As soon as the correct password is entered, the program will instantly decrypt the container, and the unlocked partition will appear in the list of available devices. Then, for quick recognition of the logical structure of the Linux file system (for example, Ext4) hidden inside, use the Fast scan mode. This algorithm will promptly analyze the contents of the container and successfully reconstruct the directory tree.

Hetman Partition Recovery: fast analysis of an LUKS container

After the analysis is complete, proceed to view the contents of the analyzed container. Here you can find both existing data and previously deleted files. Use the preview feature to verify the integrity of the found documents or media files.

After selecting the required folders, the saving process is started using the Recovery button.

Hetman Partition Recovery: recovering files from an LUKS container

The key safety rule remains the same here: saved files must be written only to another safe storage device under Windows, and absolutely not to the same container or disk from which you are currently recovering the information.

METHOD 2. Recovering Data from an Encrypted USB Flash Drive

Users often encounter file loss on portable USB drives. Let us consider a scenario in which your flash drive was encrypted with the LUKS algorithm in Ubuntu. The loss of access may be caused by accidental deletion of documents or a logical failure.

Hetman Partition Recovery: encrypted LUKS USB flash drive

The connected locked flash drive will immediately appear on the utility’s main screen. To access the logical structure, the program offers two convenient methods of unlocking the volume:

  • by manually entering the password,
  • or by an alternative option — using a saved key file, that is, a keyfile.
Hetman Partition Recovery: unlocking a LUKS USB flash drive with a keyfile

After successful removal of the protection, start the Fast scan process. This algorithm is well suited for quickly finding both existing and previously deleted files in various formats.

Hetman Partition Recovery: fast analysis of an LUKS USB flash drive

After the analysis is complete, proceed to view the contents of the flash drive. The program makes it easy to verify the integrity of found photos or documents using the convenient preview tool. Next, all that remains is to select the required files and safely save them using the Recovery function to the local hard drive of your computer.

Hetman Partition Recovery: recovering data from an LUKS USB flash drive

METHOD 3. Recovering After Deleting LUKS Partitions

Let us consider a more critical data loss scenario. Imagine that the encrypted partition on your portable flash drive was completely deleted, for example, due to an accidental mistake in the system disk manager. As a result, the entire encrypted volume loses its logical structure and turns into a single unallocated area.

Hetman Partition Recovery: deleted LUKS partition

However, Hetman Partition Recovery is also capable of handling this challenge. After connecting the drive, select your flash drive in the list of available devices, which is now displayed as unallocated space due to the deleted volume, and start the deep analysis Full scan function.

Hetman Partition Recovery: full analysis of a deleted LUKS partition

Before the scan begins, the program will automatically detect traces of the encrypted partition and prompt you to enter the password. As soon as you enter the correct password, the utility will successfully begin the scanning process.

Hetman Partition Recovery: password for a deleted LUKS partition

For the most accurate result, when configuring the scan it is advisable to manually select the Ext4 file system so that the program searches for data using the specific signatures of this file system.

After the deep analysis is complete, proceed to view the found contents. The program will reconstruct the directory tree, allowing you to find and view previously inaccessible files. After verifying their integrity in the convenient preview window, select the required data and successfully save it using the Recovery function to the local disk of your computer.

Hetman Partition Recovery: recovering files from a deleted LUKS partition

Conclusion

LUKS encryption provides a high level of data protection in Linux; however, in the event of accidental file deletion, file system corruption, or drive failure, the recovery process has its own specifics. The main condition for successful recovery is having the correct password or key file to unlock the encrypted volume. Without access to the keys, decrypting the disk contents with modern methods is practically impossible.

In most cases, if the data on the media has not been overwritten, it can be recovered using specialized software that supports encrypted LUKS partitions and Linux file systems. At the same time, it is very important to stop any writes to the disk after data loss in order to avoid overwriting deleted files and preserve the maximum chance of successful recovery.

Regular backups, secure storage of passwords and key files, and timely monitoring of drive health will help prevent loss of important information and significantly simplify recovery in the event of unforeseen situations. Combining reliable LUKS encryption with a properly organized backup strategy is the best way to ensure both the security and availability of your data.

Vladimir Artiukh

Author: , Technical Writer

Vladimir Artiukh is a technical writer for Hetman Software, as well as the voice and face of their English-speaking YouTube channel, Hetman Software: Data Recovery for Windows. He handles tutorials, how-tos, and detailed reviews on how the company’s tools work with all kinds of data storage devices.

Oleg Afonin

Editor: , Technical Writer

Oleg Afonin is an expert in mobile forensics, data recovery and computer systems. He often attends large data security conferences, and writes several blogs for such resources as xaker.ru, Elcomsoft and Habr. In addition to his online activities, Oleg’s articles are also published in professional magazines. Also, Oleg Afonin is the co-author of a well-known book, Mobile Forensics - Advanced Investigative Strategies.

Recommended For You