Restore deleted files using ext3grep in Linux

Source: Internet
Author: User
Article Title: Use ext3grep in Linux to restore deleted files. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

The data of 10 Gb was deleted by mistake and almost collapsed. I tried all the conventional recovery software and it was useless. When I had to give up, I found the ext3grep open source stuff!

Data can be restored smoothly, so data deletion in linux is not terrible. What's terrible is that there is no restoration method after deletion. Let's take a look at the following operations!

[Root @ localhost ~] # Uname-

Linux localhost. localdomain 2.6.18-8. el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

In fact, it doesn't matter what version of the system!

Required Libraries

[Root @ localhost ~] # Rpm-qa | grep e2fsprogs

E2fsprogs-libs-1.39-8.el5

E2fsprogs-1.39-8.el5

E2fsprogs-devel-1.39-8.el5

A e2fsprogs-libs is required, otherwise there will be problems with the installation of ext3grep later.

Partition:

[Root @ localhost ~] # Df-h

Filesystem Size Used Avail Use % Mounted on

/Dev/mapper/VolGroup00-LogVol00

6.2 GB 1.8G 4.2G 30%/

/Dev/sda1 99 M 11 M 83 M 12%/boot

/Dev/mapper/VolGroup00-LogVol02

1008 M 34 M 924 M 4%/data

Tmpfs 125 M 0 125 M 0%/dev/shm

Software required

Http://code.google.com/p/ext3grep/downloads/list

Download Software first

[Root @ localhost ~] # Cd/root/src/

[Root @ localhost src] # wget http://ext3grep.googlecode.com/files/ext3grep-0.6.0.tar.gz src

[Root @ localhost src] # ls

Ext3grep-0.6.0.tar.gz

[Root @ localhost src] # tar xfvz ext3grep-0.6.0.tar.gz

[Root @ localhost ext3grep-0.6.0] #./configure

[Root @ localhost ext3grep-0.6.0] # make install

[Root @ localhost ext3grep-0.6.0] # ext3grep

Running ext3grep version 0.6.0

Compile the program and test the program. After all the tasks are completed, start the recovery process.

My directory is/data Partition. I first formatted the partition. I put a file in the root directory and a file in a subdirectory.

/Dev/mapper/VolGroup00-LogVol02 1008 M 34 M 924 M 4%/data

The following italics are not mandatory:

In fact, it doesn't matter what partition is used here. You can also simulate it. The following is a simulation step:

1. mkdir/data1/

2. cd/data1/

3. dd if =/dev/zero of = disk1 count = 2048000.

4. mkfs. ext3 disk1

5. mkdir-p/dfs/

6. mount-o loop/data1/disk1/dfs/

Here, we use the/data Partition to copy some files first.

[Root @ localhost ~] #] # Cp/bin/ls/data/

[Root @ localhost ~] #] # Cp-rf/bin/data/

[Root @ localhost ~] #] # Ls-la/data/

Total 136

Drwxr-xr-x 4 root 4096 Apr 21.

Drwxr-xr-x 25 root 4096 Apr 21 ..

Drwxr-xr-x 2 root 4096 Apr 21 bin

Drwx -- 2 root 16384 Apr 21 17: 15 lost + found

-Rwxr-xr-x 1 root 93560 Apr 21 ls

[Root @ localhost ~] #

[1] [2] Next page

Related Article

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.