To use TestDisk for recovering lost partitions or files, follow these steps:
Install TestDisk:
- On Debian/Ubuntu:
sudo apt-get install testdisk - On Fedora:
sudo dnf install testdisk - On macOS (using Homebrew):
brew install testdisk
- On Debian/Ubuntu:
Run TestDisk: Open a terminal and run TestDisk with superuser privileges:
sudo testdiskCreate a Log File: When prompted, choose to create a new log file, append to an existing one, or not use a log file.
Select the Disk: Use the arrow keys to select the disk you want to analyze and press
Enter.Select Partition Table Type: TestDisk usually detects the partition table type automatically. If you're unsure, you can accept the default option.
Analyze the Disk:
- Choose
Analyzeto search for lost partitions. - Select
Quick Searchto start the search. If partitions are found, you can choose to list files or continue with deeper searches.
- Choose
Deeper Search (if needed): If the quick search does not find your lost partitions, you can select
Deeper Searchto perform a more thorough scan.Recover Files:
- If you find the lost partition, you can navigate through it and select files to recover.
- Use the
Ckey to copy files. Choose a destination to save the recovered files.
Write Changes (if necessary): If you need to restore a partition, select it and choose the option to write the changes. Be cautious with this step, as it can overwrite existing data.
Exit TestDisk: After completing your recovery, you can exit TestDisk by selecting the appropriate option.
Important Notes:
- Always work on a copy of the disk if possible to avoid further data loss.
- Recovery success depends on various factors, including how much the disk has been used since the deletion.
- Read the documentation or help files within TestDisk for more detailed instructions and options.
