Data Recovery from an Encrypted Linux Disk after a System Crash

An Ubuntu 14.04 computer was in a system software updating process when it struck a power outage. The computer cannot boot anymore. Looks like this is an easy case for data recovery? Not exactly. There is bad news: the system was installed over an encrypted LVM file system. The good news is though, the password isn't forgotten. Here comes the challenge: retrieve the user's files.

The first natural move is to create an Ubuntu startup disk, boot the computer, mount the file system, and copy the files to another disk. Then, the operating system on the computer can be repaired or re-installed. This will work only if the file system is intact. If not, what has to be done when the files become inaccessible?

It's possible to use another Linux machine with installed R-Studio for Linux, but it may not be easily available. So, this article will show how to use R-Studio for Windows instead. We also provide some information on how to work with Ubuntu for those who aren't very familiar with that OS.

Windows systems cannot directly access encrypted Linux partitions, therefore we need to use data recovery over network. So, we need two computers connected to a network: a Windows machine with R-Studio Network installed and the affected Ubuntu computer. We also need a place to store recovered data. It may be any disk visible to the Windows system, or an external hard drive connected to the Ubuntu computer. In addition to all native Linux file systems, such a drive can be formatted as an NTFS device.

Data recovery process
Creating an Ubuntu startup disk
1. Download the Ubuntu 14.04 install image and create a USB startup disk. The official Ubuntu site explains it in detail: Download Ubuntu Desktop and How to create a bootable USB stick on Windows.

Please, note, that although it's enough to have a 2GB USB stick to install Ubuntu, we'll need much more disk space to perform data recovery. We'll use a 32GB SSD device as a startup disk.

Working with the Ubuntu computer
2. Start the Ubuntu computer using the Ubuntu startup disk and select Try Ubuntu on the Install window.
Fig.1. Ubuntu startup screen
Click image to enlarge

3. Locate the encrypted disks.
Fig.2. Encrypted and external disks in Ubuntu
Click image to enlarge

Unlock them by clicking and entering the password.
Fig.3. Unlocking the encrypted disks
Click image to enlarge

Locate the external disk and double-click it to mount.

4. Move the cursor to the upper left corner, click the Find button, enter Ter, and run the Terminal program.
Fig.4. Starting the Terminal
Click image to enlarge 5. In the Terminal, enter sudo -i to obtain the superuser privileges.

6. Determine the IP address of the computer by entering ip addr show
Fig.5. Finding the IP address
Click image to enlarge

7. Run Firefox, go to and download R-Studio Agent for Linux.
Fig.6. URL for R-Studio Agent for Linux
Click image to enlarge

By default, Firefox will place it to the Downloads folder. Close Firefox.

8. Click the Folder button, go to the Downloads folder, and double-click the downloaded file. Extract the rsagent file.
Fig.7. Extracting R-Studio Agent for Linux
Click image to enlarge

9. Right-click the rsagent file, select the Permission tab, and check that Allow executing file as program is selected.
Fig.8. Setting permissions for R-Studio Agent for Linux
Click image to enlarge

Close this window and go back to the Terminal.

10. Go to the Downloads folder:
cd /home/ubuntu/Downloads
then run R-Studio Agent by typing ./rsagent

11. Configure R-Studio Agent. You may enter a very simple password if you work on a local network.
Fig.9. Starting R-Studio Agent for Linux
Click image to enlarge

You may read more about configuring R-Studio Agent for Linux at R-Studio's help: R-Studio Agent for Linux.

Ignore the Unregistered warning if your R-Studio is properly registered.

Working with the R-Studio computer
12. Connect R-Studio to the Ubuntu computer.
Fig.10. Connecting R-Studio to its Agent for Linux
Click image to enlarge
See R-Studio's help: Data Recovery over Network for details.

13. Locate the damaged LVM file system.
Fig.11. Damaged encrypted LVM
Click image to enlarge

14. Scan the LVM file system.
Fig.12. Scan parameters for LVM
Click image to enlarge
See more about scan parameters on R-Studio's help: Disk Scan.

15. See the scan results and locate the recognized partitions on the LVM file system.
Fig.13. Scan results
Click image to enlarge

16. Open the found recognized partition. If the file system is severely damaged, it may take a long time.

17. Locate the user's folders and mark files for recovery.
Fig.14. Recognized partition
Click image to enlarge
You may use various file search methods to find and mark particular files. See R-Studio's help: Searching for a File and R-Studio's help: Mass File Recovery for details.

18. Click the Recover Marked button, select a place to store recovered files, and specify other recovery parameters.
Fig.15. Recover parameters and disks to store recovered files on the remote computer
Click image to enlarge

Then click the OK button on the Recover dialog box, and R-Studio will start file recovery saving the files on the external disk.
Fig.16. Recovered files on the external NTFS disk
Click image to enlarge

© Copyright 2000-2016 R-Tools Technology Inc.