Ubuntu

How to Install and Use the TestDisk on Ubuntu 22.04

Creating data backups is essential because it can help the users secure the data easily. However, the users sometimes don’t create the backups, and they end up losing the data. Although it can be tough to recover the data, don’t worry because some tools can restore the data.

If you are a Linux user and wants to recover the data, you can install the TestDisk tool. In this short tutorial, we will explain a simple method to install and use the TestDisk on Ubuntu 22.04.

How to Install the TestDisk on Ubuntu 22.04

First, run the following command to update the system because it eliminates the chances of getting errors while installing the TestDisk:

sudo apt update

Now, install the TestDisk through the following command in the terminal:

sudo apt install testdisk

How to Use the TestDisk to Recover the Data

After installing the TestDisk, run the following command to open its command-line interface:

sudo testdisk

Follow the prompts to select the disk that you want to scan and choose the appropriate options for the type of scan that you want to perform. For example, select “No Log”, “Deeper search”, and “Backup BS” if you want to scan a deleted partition. For example, select “No Log” and proceed further:

TestDisk displays a list of drives, so select the disk that you want to restore. Then, press the “Enter” button.

It displays the list of available partitions. Here, you can select the partition table type that you want to recover.

Here, you can explore the various features of TestDisk to recover the data:

For instance, go to the “Advanced” option and select the partition to search for the lost files. Moreover, you can choose the “Analyse” option and search for all the affected files.

TestDisk displays a list of the all available files on the partition.

Use the arrow buttons to scroll through the list and press “C” to copy the selected file. Follow the prompts to specify the destination for the copied file.

Note: It is important to save the recovered files to a different location than the original partition to avoid overwriting the data that you are trying to recover.

If it does not contain your desired partition, try running the TestDisk again with different scan options. Try using a different recovery tool since some tools are better at recovering certain data types than the others.

Conclusion

TestDisk is a powerful data recovery tool which is available for free on Ubuntu 22.04. With its easy-to-use command-line interface and wide range of recovery options, TestDisk is a valuable resource for anyone who is looking to recover the lost or deleted data from their hard drive.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.