Linux System File Deletion recovery method, host Windows and Linux file sharing!

Source: Internet
Author: User

Experimental project:
Linux system files deleted by mistake recovery method;

Host windows with Linux file sharing

Lab Environment:
One: VMware virtual machine, Linux system RedHat6.5 (what version is not important);

Two: Install the following 3 dependent packages (Please note the order!) )
1 "rpm-ivh/mnt/packages/e2fsprogs-libs-1.41.12-18.el6.x86_64.rpm
2 "rpm-ivh/mnt/packages/libcom_err-devel-1.41.12-18.el6.x86_64.rpm
3 "rpm-ivh/mnt/packages/e2fsprogs-devel-1.41.12-18.el6.x86_64.rpm

Third: Install the compilation environment with Yum GCC gcc-c++

Four: Download the package extundelete-0.2.4.tar.bz2 to Windows (Baidu can not find a compressed package of friends to leave a message to me)

Experimental objectives:
Implementing host (Windows) and Linux file sharing
Implementation of system files in Linux mistakenly deleted recovery

Experimental steps:
At work we often mistakenly delete some files because of some careless operation, we have recycle Bin in window, but there is no Recycle Bin mechanism in Linux, so it is necessary to use external tools to recover deleted files in Linux. The process is as follows:
1. Download a compressed package to Windows (EXTUNDELETE-0.2.4.TAR.BZ2 needs to compress the package of friends please leave a message)
2. Share the package with the Linux system
3. Unzip, compile, and install the compressed package in Linux
4. Accidental deletion of analog files
5. Using the installed software to recover deleted files by mistake

The experiment passed:
1. First share the software downloaded to Windows into a Linux system, and find the location of the file to share this file, such as:

2. Right-click My Computer---manage---Local users and user groups. Such as:

3. Open local Policy (can not find to search)-User Rights Assignment-delete the guest group. Such as:

4. Open the security option in the local policy and select the network access security model as Classic mode. Such as:

5. Keep Linux and hosts in the same network segment. Execute command: smbclient-l//192.168.100.221 (keep up with the IP address of your host). Such as:

6. The need to use the device files in Linux needs to be mounted, so we need to create a mount point in Linux and attach the shared folder to Linux so that we can use it. Execute the command mkdir/abc (create mount point) separately mount.cifs//192.168.100.221/the source code package/ABC (Mount the shared folder to ABC) df-h (view mount information). Here, file sharing is done! Such as:

7. You can execute the command CD/ABC see the contents of the shared file, such as:

8. Before this, 3 dependencies, GCC gcc-c++ should be installed! (In the beginning of the experiment preparation, you can turn back to see.) Note the installation order of the dependent packages. Now you need to unzip the package and execute the command: Tar jxvf extundelete-0.2.4 file recovery. Tar.bz2-c/opt such as:

9. Execute the command: cd/opt/extundelete-0.2.4/switch to the extracted files, using the command LS to see the Configure this execution script can be obtained. Such as:

10. You need to pay attention to the path, execute the command separately./configure (execute this file); Make (convert config file to binary file); Do install (start installation) such as:

11. By the time the tool is installed, it is now possible to simulate the accidental deletion of files. It is especially important to note that when you accidentally delete a file you want to recover, do not write data to this disk, so as not to overwrite the data you mistakenly deleted, so what you have to do is to delete the files you mistakenly deleted the device files on the solution mount. It's important here!!!
Now write data to disk. For example, execute the command: Echo a>a (Generate a file name A and write a content inside), such as:
Then execute the command to delete the file: Rm-rf a RM-RF b such as:

12. At this time we mistakenly deleted the file, want to restore our first thought is that the device file should be mounted, execute the command umount/aaa (this is my own mistake to delete the file's mount point). You can now use the tool to recover deleted files, execute command: extundelete/dev/sdb1--restore-all restore All files in the SDB1 partition into the current directory. Such as:

13. All recovered files are in recovered_files This directory, switch to this directory, LS view OK to recover the deleted file a B. At this point you can move the two files to the table you are thinking of. Such as:

14.OK to this mistakenly deleted file recovery success, experimental success.

Summarize:
In the whole process, the following points need to be noted:
1. The order of installing dependent packages cannot be wrong
2. Need to install GCC gcc-c++ compiler
3. Take care of the path when performing, compiling, and installing the recovery software
4. In the actual work, do not accidentally delete files in the current directory to write data, it is recommended that the current device should be removed to mount the file. (Reason: Can understand the relationship between Inode and block!) )
5. The recovered files are stored in the current Recovered_files directory

Linux System File Deletion recovery method, host Windows and Linux file sharing!

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.