In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use TestDisk to recover files in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
TestDisk is a powerful hard disk repair tool to help users recover lost data and repair hard drives that cannot be started. It is very easy to use Testdisk to restore partition tables.
Install TestDisk (PhotoRec) in the Linux system
Execute the following related commands on the system to install TestDisk:
-On Debian/Ubuntu/Linux Mint-$sudo apt-get install testdisk- On CentOS/RHEL/Fedora-$sudo yum install testdisk- On Fedora 22 +-$sudo dnf install testdisk- On Arch Linux-$pacman-S testdisk- On Gentoo-$emerge testdisk
If you don't have this installation package in your Linux system repository, you can download it here and run it in Live CD.
This installation package can also be found in emergency repair CD tools, such as Gparted LiveCD, Parted Magic, Ubuntu Boot CD, Ubuntu-Rescue-Remix, and other tools.
After the installation is complete, open a text window with the permissions of the root account, launch PhotoRec, and specify the partition of the deleted file:
$sudo photorec / dev/sda3
You will see the following interface:
Linux system PhotoRec data recovery tool
Use the left and right arrows to select menu options and press enter to confirm. To continue with the restore operation, select [Proceed] and click Enter.
You will see the following interface:
Select a partition for file recovery
Select [Options] to view the available recovery options, as shown in the following figure:
Linux system File recovery options
Press Q to return, and in the following screen, you can specify the file extension you want to query and restore. Therefore, select [File Opt] and press enter to confirm.
Press s to select or deselect all file extensions, if you have deselected all file extensions, just use the right arrow to select the file type you want to restore (or press the left arrow to deselect).
For example, I want to recover all missing .mov files on my system:
Specify the recovery file type
Press b to save the settings, and then you should see the information shown in the following figure. Click enter to return (or press Q), and then press Q to return to the main interface.
Save file recovery settings
Now select [Search] to start file recovery. In the following figure, select the type of file system in which the file partition is stored, and then press enter.
Select a file system type to restore deleted files
Next, as shown in the following figure, choose whether to analyze only the free space or the entire partition. Note that selecting the entire partition will make the operation longer and slower. After selecting the appropriate option, press enter to continue.
Select a file system for analysis
Select a directory to store the files to be restored, and when you are finished, press C to continue. Select directories for different partitions to avoid overwriting deleted files when more files are stored in this partition.
Press the left arrow to return to the root partition.
Select the directory where you want to save the recovery file
The following figure shows the deleted files of the specified type being restored. You can press enter to stop the operation.
Note: during the recovery process, your system will become very slow and is likely to get stuck for a while. Please wait patiently until the recovery is complete.
Restore deleted files on a Linux system
Finally, the Photorec tool will show the number of files recovered and the path to which they were saved.
Summary of Linux file recovery
By default, recovered files will be saved with root account permissions, so you need to open the File Manager to access these files with elevated permissions.
Use the following command (specify your file manager):
$gksudo nemo or $gksudo nautilus for more information, visit the PhotoRec website: http://www.cgsecurity.org/wiki/PhotoRec.
Thank you for reading! This is the end of this article on "how to use TestDisk to recover files in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.