Ext4 rm 복구 - Ext4 rm boggu

ext4 삭제 파일 복구 방법이다.

우선 복구 프로그램 설치

[root@localhost tmp]# wget http://sourceforge.net/projects/extundelete/files/extundelete-0.2.4.tar.bz2

[root@localhost tmp]# tar -xvf extundelete-0.2.4.tar.bz2

[root@localhost tmp]# cd extundelete-0.2.4.tar.bz2

[root@localhost extundelete-0.2.4]# ./configure

[root@localhost extundelete-0.2.4]# make && make install

[root@localhost tmp]# df

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda2             14877092   6918260   7190928  50% /

/dev/sda7            126235228    192192 119527076   1% /work

/dev/sda6              2030736     35912   1890004   2% /tmp

/dev/sda5              4061540     73792   3778104   2% /user

/dev/sda1               124427     19351     98652  17% /boot

tmpfs                  2013944         0   2013944   0% /dev/shm

만약 /work/test 폴더가 삭제가 되었다면

[root@localhost tmp]# extundelete /dev/sda7 --restore-directory=/work/test

만약 /work/ 모든 파일을 복구 하고 싶다면

[root@localhost tmp]# extundelete /dev/sda7 --restore-all

하면 된다.

Ext4 리눅스 파일이 삭제된 이유 분석

아래는 Ext4 리눅스에서 데이터 손실된 가장 눞은 원인 리스트입니다.

  • 의도하지 않은 Ext4 리눅스 파티션 및 전체 디스크 포맷 제거
  • 하드 드라이브의 디스크 재파티셔닝
  • 파티션 디스크의 결함, 슈퍼 블록 균열
  • 악성 프로그램 감염, 소프트웨어 재설치
  • 컴퓨터 네트워크의 시스템 복구 

실은, 파일이 삭제되었을 때 파일 시스템은 inode파일을 삭제했을 뿐이며 실제 데이터는 제거되지 않습니다. 즉, 끓어진 inode파일과 실제 데이터를 연결시켜주면 삭제된 파일을 복구할 수 있습니다.

사라진 Ext4 파일 빠른 복구 방법

본 글에서는 믿음직하는 데이터 복구 전문 프로그램 EaseUS를 사용하여 Ext4 리눅스에서 삭제된 파일을 복구하는 가장 성공적인 방법에 대해 알아보겠습니다. 이지어스 복구 프로그램은 각 내부 모두 드라이브를 스캔하여 끓어진 inode파일과 실제 데이터를 연결시켜준 다음에 사라진 Ext4 파일이나 원한 데이터를 다 복구할 수 있습니다. 따라서 컴퓨터 용어에 대해 1도 모르는 초보자한테도 쉽고 안전하게 해결할 수 있으니 걱정하지 마시고  따라해보세요.

우선, 해당 시스템 링크를 눌러  설치한 다음에 리눅스 하드 드라이브 파티션이 올바르게 연결되어 있는지 확인합니다.

WarningLinux 시스템일 경우에는 아래 왼쪽 window버전을 선택하세요. EaseUS 자동으로 인식합니다. Windows 시스템에서 Linux 파일 시스템을 원격으로 복구하려면 해당 IP와 비밀번호를 입력하여 아래 가이드를 따라 하시면 됩니다.

복구 방법은 아래 3단계로 정리했습니다.

1단계 : EaseUS 데이터 복구 소프트웨어를 시작하고 Ext 4 파일을 스캔합니다.

"분실된 파티션"을 선택하고 "검색"을 클릭하여 이 프로그램이 Ext4 파일을 검색합니다.

Ext4 rm 복구 - Ext4 rm boggu

2단계 : 스캔 완료 후 발견된 Ext4 Linux 파일을 확인합니다.

스캔 완료 후 "삭제된 파일", "분실된 파일"에서 더블 클릭하여 삭제된 Ext4 파일를 미리보기로 통해 확인할 수 있습니다. 또는 필터 혹은 검색을 통해 파일 유형, 이름까지별로 검색할 수 있도록 삭제된 파일은 놓치없이 스캔 할 수 있습니다.

Ext4 rm 복구 - Ext4 rm boggu

3단계 :  Ext4 Linux에서 찾은 파일 데이터를 복구합니다. 

찾은 데이터를 선택한 후 "복구"를 클릭하여 손실된 데이터를 복구합니다. 삭제된 Ext4 파일을 안전하게 만들기 전에 이러한 파일을 다른 안전한 위치에 저장하십시오.

Ext4 rm 복구 - Ext4 rm boggu

마무리

Linux 외에 Windows 시스템 같은 경우에는 Windows에서 삭제 / 분실된 EXT 파일 복구 방법 같이 드니니 필요하시면 참고부탁드립니다.

항상 응원하겠습니다!

rm으로 지운 파일이 복구가 된다는 희소식!

참고2: http://ubuntuforums.org/showthread.php?t=1657295

[주의]

아래에서 소개하는 방법은 프로그램을 하나 설치해서 사용하는 방법이다.

그런데 프로그램을 설치하면서 복구하려고 한 파일의 영역을 덮어써버릴 수 있다.

따라서, 프로그램을 미리 설치해놓는 것도 방법이고,

확실하게 하려면, 실수로 rm을 한걸 발견하자마자 컴퓨터를 꺼버리고, 하드디스크를 꺼낸 뒤 다른 컴퓨터에 프로그램을 설치하고나서 복구하고자 하는 파일이 있는 하드디스크를 연결해서 복구를 실행하는 방법이 있다.

1. extundelete 프로그램 설치

$wget http://sourceforge.net/projects/extundelete/files/extundelete-0.2.4.tar.bz2

$tar xvf extundelete-0.2.4.tar.bz2

아래 명령은 ubuntu 12.04 기준. (ext2fslibrary 를 설치해야 한다.)

sudo apt-get install e2fslibs-dev 

$./configure

$ make

$ sudo make install

2. 디바이스 이름 확인

$ df -h

Filesystem      Size Used Avail Use% Mounted on

/dev/sda1        93G  20G   69G  23% /

udev            5.9G  4.0K 5.9G   1% /dev

tmpfs           1.2G 848K  1.2G   1% /run

none            5.0M     0 5.0M   0% /run/lock

none            5.9G   18M 5.9G   1% /run/shm

/dev/sdb1       1.4T 252G  1.1T  20% /data

/dev/sda3       492G 112G  356G  24% /home

내 경우엔 /data 파티션 아래의 파일들을 일부 복구하려는 것이었다.

3. 파일 복구

전체 경로를 알고 있는 파일 혹은 디렉토리를 복구하려면 아래와 같이 한다.

$ sudo extundelete [device name] --restore-file=[full path of a file]

$ sudo extundelete [device name] --restore-directory=[full path of a directory]

ex) sudoextundelete /dev/sdb1 --restore-directory=/data/benchmark/

하지만, 내 경우엔 /data/benchmark 라는 디렉토리는 살아있고 그 아래 파일들만 지웠는데 이름을 다 기억하지 못 했다. 그래서 다음과 같이 했다.

$ sudo extundelete /dev/sdb1 --restore-all -otemp/

--restore-all 옵션은 지워진 모든 것을 살리라는 것이고,

-o 옵션은 해당 경로에 파일을 살리는 대신, 지정한 경로 밑으로 파일을 복구하라는 것이다. (물론 다른 하드디스크를 지정했다.)

아래와 같은 메시지가 나오면서 복구가 된다.

===================================================================

NOTICE:Extended attributes are not restored.

WARNING:EXT3_FEATURE_INCOMPAT_RECOVER is set.

Thepartition should be unmounted to undelete any files without further data loss.

If thepartition is not currently mounted, this message indicates

it wasimproperly unmounted, and you should run fsck before continuing.

If youdecide to continue, extundelete may overwrite some of the deleted

files andmake recovering those files impossible. You should unmount the

file systemand check it with fsck before using extundelete.

Would youlike to continue? (y/n) => mount 된 상태로 복구를 하면 몇 파일이 복구되지 못할 수도 있다는 이야기다. umount를 시켜봤지만, device is busy 라고 떠서 어쩔 수 없어서 y를 눌렀다. 재부팅을 시키거나 다른 컴퓨터에 연결시켜서 umount가 가능한 상황이라면 그렇게 하는 것이 복구에는 더 좋을 것 같다.

y

Loadingfilesystem metadata ... 11179 groups loaded.

Loadingjournal descriptors ... 32182 descriptors loaded.

Searchingfor recoverable inodes in directory / ...

17162recoverable inodes found.

Lookingthrough the directory structure for deleted files ...

Unable torestore inode 85852165 (benchmark/SPECCPU_2006.tar.gz): Space has beenreallocated.

Unable torestore inode 85852166 (benchmark/SPECCPU_2006_gem5.tar.gz): Space has beenreallocated.

Unable torestore inode 85852169 (benchmark/parsec-2.1.tar.gz): Space has beenreallocated.

Unable torestore inode 85852172 (benchmark/speccpu_2006.tgz): Space has beenreallocated.

Unable torestore inode 85852181 (benchmark/parsec-3.0.tar.gz): Space has beenreallocated. => 일부 파일은 해당 영역이 이미 덮어씌워져서 복구하지 못했다.

===================================================================