🔥 New Launch of Fastest Growing AItrendytools Platform!
Submit Your AI Tool Today!Accidentally deleted files on your Linux/Ubuntu system? Don’t worry, you can recover them using a powerful utility called PhotoRec. In this guide, we will walk you through the step-by-step process of recovering your lost files efficiently. PhotoRec is packaged with TestDisk, a popular tool from CGSecurity, and is specifically designed to recover deleted media files from SD cards, USB drives, and hard drives.
bash Copy code sudo apt -y install testdisk
bash Copy code sudo photorec
Let’s explore each step in more detail.
PhotoRec is part of the TestDisk package, so you won’t find it as a standalone software in the repositories. Use the command below to install TestDisk, which includes PhotoRec.
bash Copy code sudo apt -y install testdisk
This command installs both TestDisk and PhotoRec. Once the installation is complete, you can run PhotoRec directly from your terminal.
To start PhotoRec, open your terminal and enter the following command:
bash Copy code sudo photorec
You’ll see a menu-driven interface. First, select the hard drive from which you want to recover files. Use the arrow keys to navigate and press the Enter key to proceed.
After selecting the drive, you’ll need to choose the partition. This is where the deleted files were stored. If unsure, select the most appropriate partition, often labeled with ext4 if you’re using a standard Linux filesystem.
To speed up the recovery process, select the file types you want to recover. For example, if you’re looking for deleted photos, choose JPG or other image file formats. You can access this option from the File Options menu when selecting the partition.
Next, decide if you want PhotoRec to search only the free sectors or scan the entire drive. Searching the free sectors is faster, but scanning the entire disk gives a more thorough result, recovering older files.
You’ll be prompted to choose where PhotoRec should save the recovered files. It’s best to select a different drive or directory from the one you are scanning to avoid overwriting recoverable data. Once the location is set, press the letter C to begin the recovery process.
As PhotoRec works, it will save files into a folder named recup_dir. You can access this folder even while the recovery process is ongoing. Navigate through the recovered files to find the specific ones you were looking for.
Q1: Can I use PhotoRec to recover non-media files?
Yes, despite its name, PhotoRec can recover a variety of file types beyond photos, including documents, archives, and videos. It scans based on file signatures and can work on a wide range of file formats.
Q2: How long does the recovery process take?
The time required depends on the size of your drive and how many file types you select for recovery. Limiting file types to those you need (like only photos) can speed up the process.
Q3: What if PhotoRec doesn’t recover my files?
If PhotoRec fails to recover the files, try other recovery tools like Recuva or Disk Drill. You may also check the integrity of the drive using disk repair utilities before attempting recovery again.
When you delete a file, only the metadata (file information) is erased, but the actual data remains on your disk until it’s overwritten. PhotoRec searches for these lost data blocks and reconstructs the file. Since the tool operates at the data sector level, it doesn’t rely on the original file structure, making it incredibly effective even if the filesystem is damaged.
PhotoRec is a powerful and free tool that makes recovering deleted files on Linux/Ubuntu straightforward. While its text-based interface might seem daunting, the step-by-step process we covered ensures you can recover your files without any hassle. If you’re looking for other recovery options, tools like PhotoRescue Wizard or Recuva can also be valuable alternative
Read more: 3600 Seconds to Minutes: Quick Convert & Time Tips
Python Substring Guide: Complete Tutorial with Examples
Learn Python substring operations with clear examples. Master string slicing, manipulation methods, and best practices.
JavaScript setInterval: Complete Guide to Timing Functions
Master JavaScript's setInterval function with this comprehensive guide. Learn syntax, best practices, real-world examples.
Java Two-Dimensional Arrays: Guide, Examples & Traversal
Learn how to declare, initialize, access, and modify two-dimensional arrays in Java. A complete guide with examples, FAQs, and traversal techniques.
© 2024 - Made with a keyboard ⌨️