To recover files using TestDisk, follow these detailed steps:
-
Install TestDisk (if not already installed):
- 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 start TestDisk with superuser privileges:sudo testdisk -
Create 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 from which you want to recover files and pressEnter. -
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. This will scan for lost partitions.
- Choose
-
Deeper Search (if needed):
If the quick search does not find your lost files or partitions, you can selectDeeper Searchfor a more thorough scan. -
List Files:
- Once partitions are found, navigate to the partition you want to recover files from and select it.
- Choose the option to
Listfiles. This will display the files and directories in that partition.
-
Select Files to Recover:
- Use the arrow keys to navigate through the list of files.
- To select files for recovery, highlight the file and press the
:key. A*will appear next to the selected files.
-
Copy Selected Files:
- After selecting the files you want to recover, press the
Ckey to copy them. - You will be prompted to choose a destination for the recovered files. Navigate to the desired directory (make sure it's on a different drive or partition to avoid overwriting data) and press
Cagain to confirm.
- After selecting the files you want to recover, press the
-
Exit TestDisk:
After the recovery process is complete, you can exit TestDisk by selecting the appropriate option.
Important Considerations:
- Always work on a copy of the disk if possible to prevent further data loss.
- Recovery success depends on how much the disk has been used since the files were deleted.
- Read the documentation or help files within TestDisk for more detailed instructions and options.
