Linux ETC

extundelete-0.2.4.tar.bz2 파일 다운 후 설치 진행

 

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

 

[root@localhost src]# cd extundelete-0.2.4

 

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

Configuring extundelete 0.2.4

configure: error: Can't find ext2fs library

 - 위와같이 ext2fs 라이브러리를 찾지 못한다고 하면 yum으로 설치 진행

 

[root@localhost extundelete-0.2.4]# yum install e2fsprogs-devel

 - 설치 완료 후 컴파일 재실행

 

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

Configuring extundelete 0.2.4

Writing generated files to disk

 

[root@localhost extundelete-0.2.4]# make

 

[root@localhost extundelete-0.2.4]# make install

 

설치 완료 후 파일 복구 진행

테스트 진행을 위해 임시로 파일을 복사

[root@localhost home]# cp -a /usr/local/apache2 /home/apache2

 

home 파티션 내용 삭제

[root@localhost /]# rm -rf /home/*

 

[root@localhost home]# ll

?⑷퀎 0

 

지워진 파티션을 umount

[root@localhost /]# umount /home

[root@localhost /]# df -Th

Filesystem    Type    Size  Used Avail Use% Mounted on

/dev/sda1     ext4     18G  3.5G   14G  21% /

tmpfs        tmpfs    936M     0  936M   0% /dev/shm

 

임시로 폴더를 생성하고 마운트 진행

[root@localhost /]# mkdir /backup

[root@localhost /]# mount /dev/sda3 /backup

[root@localhost /]# df -Th

Filesystem    Type    Size  Used Avail Use% Mounted on

/dev/sda1     ext4     18G  3.5G   14G  21% /

tmpfs        tmpfs    936M     0  936M   0% /dev/shm

/dev/sda3     ext4    128G  188M  122G   1% /backup

 

지워진 파티션 복구 진행

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

NOTICE: Extended attributes are not restored.

WARNING: EXT3_FEATURE_INCOMPAT_RECOVER is set.

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

If the partition is not currently mounted, this message indicates

it was improperly unmounted, and you should run fsck before continuing.

If you decide to continue, extundelete may overwrite some of the deleted

files and make recovering those files impossible.  You should unmount the

file system and check it with fsck before using extundelete.

Would you like to continue? (y/n)

y 입력

 

Loading filesystem metadata ... 1040 groups loaded.

Loading journal descriptors ... 1844 descriptors loaded.

Searching for recoverable inodes in directory / ...

3798 recoverable inodes found.

Looking through the directory structure for deleted files ...

286 recoverable inodes still lost.

 

완료 후 확인

[root@localhost /]# cd RECOVERED_FILES

[root@localhost RECOVERED_FILES]# ll

?⑷퀎 8

drwxr-xr-x 16 root root 4096 2016-02-18 16:43 apache2

drwxr-xr-x  2 root root 4096 2016-02-18 16:43 lost+found

 

폴더의 내용을 확인해보면 복구 된 것을 비교 확인

[root@localhost apache2]# pwd

/RECOVERED_FILES/apache2

[root@localhost apache2]# du -sh

94M     .

 

[root@localhost apache2]# cd /usr/local/apache2/

[root@localhost apache2]# du -sh

94M     .

 

위의 경우 테스트로 진행하여 파일 삭제 후 바로 진행했기 때문에 파일 복구가 원활히 진행 된 것으로 예상되며,


100% 복구되지 않을 수 있습니다.

번호 제목 글쓴이 날짜 조회 수
246 CPU core 별 사용량 확인 하기 호스트웨이 2012.06.08 25265
245 안전한 패스워드 생성하기 호스트웨이 2012.06.08 16385
244 sysstat 설치편 호스트웨이 2012.06.08 20400
243 sar 명령 옵션 호스트웨이 2012.06.15 92126
242 리눅스 가상콘솔개수 조절 file 호스트웨이 2012.06.15 15248
241 리눅스에서 fuser 명령어 사용하기 호스트웨이 2012.06.15 33495
240 Ext2Fsd 를 이용하여 윈도우즈 PC에서 리눅스 파티션 읽기 file 호스트웨이 2012.06.15 20342
239 L4 로드밸런서 알고리즘 호스트웨이 2012.06.22 19387
238 EXT3-fs warning: maximal mount count reached, running e2fsck is recommended 해결 호스트웨이 2012.06.22 19126
237 리눅스 ls 디렉토리 혹은 파일 별 출력하기 file 호스트웨이 2012.06.22 26079
236 리눅스에서 pkill, pgrep 명령어 사용하기 호스트웨이 2012.06.22 28501
235 특정 IP 엑세스 못하게 하는방법 호스트웨이 2012.06.22 14445
234 find 명령 사용 예제들 호스트웨이 2012.06.29 14964
233 시스템내에서 하드 용량이 다르게 보이는 이유 호스트웨이 2012.06.29 16425
232 xinetd 소개 및 설정 호스트웨이 2012.06.29 51903
231 리눅스 압축 명령어 tar 호스트웨이 2012.06.29 17720
230 리눅스에서 shutdown 명령어 사용하기 호스트웨이 2012.06.29 28858
229 리눅스 로그인 메시지 출력 file 호스트웨이 2012.07.06 17107
228 리눅스 로그파일의 종류 호스트웨이 2012.07.06 18242
227 Linux 계정 정보 관리 파일 호스트웨이 2012.07.06 17984