TestDisk is a powerful tool that can help you recover lost or deleted files from your ext4 partition. In this article, we will guide you through the process of using TestDisk to extract the whole directory tree and filenames from your ext4 partition.
What is TestDisk?
TestDisk is a free and open-source data recovery utility that allows you to recover lost partitions and repair damaged file systems. It is available for multiple platforms, including Windows, macOS, and Linux. TestDisk supports a wide range of file systems, including ext4, NTFS, FAT, and more.
Step 1: Install TestDisk
The first step is to install TestDisk on your system. Follow these steps to install TestDisk on Ubuntu:
- Open the Terminal by pressing
Ctrl + Alt + Ton your keyboard. - Run the following command to install TestDisk:
sudo apt-get install testdisk - Enter your password when prompted and wait for the installation to complete.
Step 2: Launch TestDisk
Once TestDisk is installed, you can launch it by following these steps:
- Open the Terminal.
- Run the following command to launch TestDisk:
sudo testdisk
Step 3: Select the Disk
After launching TestDisk, you will see a command-line interface. Follow these steps to select the disk containing your ext4 partition:
- Use the arrow keys to navigate and select the disk you want to recover data from.
- Press Enter to proceed.
Step 4: Select the Partition Table Type
Next, you need to select the partition table type. In most cases, the default option is correct. If you are unsure, you can choose the default option and proceed.
Step 5: Analyze the Partition
TestDisk will now analyze your ext4 partition and display the current partition structure. Follow these steps to analyze the partition:
- Use the arrow keys to navigate to the "Analyse" option.
- Press Enter to proceed.
- Wait for TestDisk to analyze the partition. This may take some time depending on the size of your partition.
Step 6: Select the Whole Partition
Once the analysis is complete, TestDisk will display the partition structure. Follow these steps to select the whole partition:
- Use the arrow keys to navigate to the partition you want to recover data from.
- Press Enter to proceed.
Step 7: Select the Filesystem Type
Next, you need to select the filesystem type. In this case, select "ext4" as the filesystem type.
Step 8: Navigate to the Directory
TestDisk will now display the directory structure of your ext4 partition. Use the arrow keys to navigate to the directory you want to recover. If you want to recover the whole directory tree, navigate to the root directory.
Step 9: Copy the Files
Once you have selected the directory, you can copy the files to another location. Follow these steps to copy the files:
- Use the arrow keys to navigate to the file you want to copy.
- Press
cto enable the copy mode. - Navigate to the destination directory where you want to copy the file.
- Press
Cto copy the file.
Repeat these steps for each file you want to recover. TestDisk will copy the files to the specified destination directory.
That's it! You have successfully used TestDisk to extract the whole directory tree and filenames from your ext4 partition. Remember to always double-check the recovered files to ensure their integrity.
References
| Number | Source |
|---|---|
| 1 | TestDisk Step By Step |
| 2 | TestDisk Analyse |