Home >Operation and Maintenance >Linux Operation and Maintenance >How to recover accidentally deleted files in Linux

How to recover accidentally deleted files in Linux

angryTom
angryTomOriginal
2019-11-05 16:04:564535browse

How to recover accidentally deleted files in Linux

How to recover accidentally deleted files in Linux

As a multi-user, multi-tasking operating system, Linux Once the files are deleted, they are difficult to recover. Although the delete command only marks the file node for deletion and does not actually clear the file content, other users and some processes that write to the disk will quickly overwrite the data. However, it can still be restored if you use Linux on a single computer at home, or if you accidentally delete files and remedy them in a timely manner.

1. Use SecureCRT to remotely monitor the operating system and check the current system version number and file system format

How to recover accidentally deleted files in Linux

2. To facilitate this experiment, we create a new file.

How to recover accidentally deleted files in Linux

3. Perform the deletion operation

rm -rf  web_1.txt

4. Use the system self-restore tool debugfs to repair

How to recover accidentally deleted files in Linux

5. Open the partition where the file was just deleted

View the directory in the partition

How to recover accidentally deleted files in Linux

How to recover accidentally deleted files in Linux

6. Use ls plus the -d parameter to display the directory where the file just deleted is located

How to recover accidentally deleted files in Linux

##7. The one shown with angle brackets is the Inode number of the file we are looking for. Execute logdump –I

How to recover accidentally deleted files in Linux

Eight, after executing the command, a screen of information is displayed. What we need is the following line, and remember the following value

How to recover accidentally deleted files in Linux

9. Exit dedugfs

qiut

10. Execute the following command

bs The offset value is consistent with the figure below, and the skip and block values ​​are consistent

How to recover accidentally deleted files in Linux

Eleven, the above results indicate that the recovery is successful. Let’s see if there are any in the /opt/wb_1 directory.

How to recover accidentally deleted files in Linux

Restored successfully!

Recommended:

linux system tutorial

The above is the detailed content of How to recover accidentally deleted files in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn