Restore accidentally deleted files in Linux

Source: Internet
Author: User
Tags qmail

Unrm
Http://packetstormsecurity.com/UNIX/utilities/unrm-0.92.tar.gz
A small tool actually uses the debugfs command in Linux, which simplifies the steps for manual use of debugfs,
There is no interactive interface, and the recovered files are directly placed under a fixed directory.

According to this situation, the tools that are bulky and need to be installed are out of the Selection Range. I used unrm
Without damaging the data disk content, I put this tool down/boot to expand. Suppose we need to restore aaa
This user's email

Modify the Mount path in the script (originally/usr/sbin/mount, and the system is/usr/bin)
Check whether/the local partition device is/dev/sda2.

./Unrm/dev/sda2-u Qmail-s aaa

Restore the files deleted by Qmail. The files contain the AAA string.
Actually, this-S parameter does not work.

After./unrm/dev/sda2-u Qmail is used, an unrm. Recover directory is automatically generated under the current directory.
Each recovered file is stored in the unrm. xxxxxx format.
Filtered
Grep AAA * | cut-D:-F 1 | uniq
Find these file names and CP them to the original Qmail mail directory (maildir/new)
The result of this operation is that 35 files have been restored, but four files have been basically damaged. Only 31 files have been completely recovered.
Try to receive the email. Everything works.

From the recovery work, we can see that the recovery in the Linux ex2 file system is more important than the restoration of the UFS system under solairs.
It is much more convenient. After UFS is deleted, each file block has no link, while ex2 is a bit similar
In the fat system, the inode number of the first block is lost for small files, and the blocks are linked.
A large file seems to have no link after a certain number of blocks.
Restoring files under UFS may be better than TCT.

Note: After my tests, on centos5, unrm can restore files normally. But there is a small problem, the solution is:

Ln-S/bin/Mount/sbin/mount.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.