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% 복구되지 않을 수 있습니다.

번호 제목 글쓴이 날짜 조회 수
366 TCp syn Flooding 공격시 대처방법 TIP 호스트웨이 2012.10.26 2234
365 vim fileformat 변경하기: -bash: ./LINUX_03.sh: /bin/sh^M: bad interpreter: No such file or directory 호스트웨이 2012.11.29 2292
364 리눅스 시스템상에서 하드웨어사양 확인 호스트웨이 2012.10.24 2368
363 500 FTP server shut down 문제 해결 호스트웨이 2015.09.09 2394
362 rsync / 파티션 전체 동기화 방법 호스트웨이 2012.12.14 2426
361 ispell 명령어를 통한 철자 검사 및 수정하기 file 호스트웨이 2012.10.12 2522
360 리눅스 look 명령어 file 호스트웨이 2012.11.02 2598
359 hostname 변경하기 호스트웨이 2015.09.17 2621
358 리눅스 hdd 속도 알아보기 호스트웨이 2015.09.17 2622
357 쉘 프롬프트 설정하기 file 호스트웨이 2012.11.08 2669
356 읽기 전용 파티션 읽고 쓸수 있게 재마운트하는 방법 호스트웨이 2015.09.13 2714
355 랜카드 본딩(bond0) 설정 호스트웨이 2012.11.16 2716
354 쉘 프롬프트에서 바로 이전 디렉토리로 이동하기 호스트웨이 2012.12.20 2749
353 UTF-8 환경에서 리눅스 한글 꺠짐 현상 해결법 호스트웨이 2015.09.08 2761
352 df 쉽게 보기 호스트웨이 2012.12.20 2834
351 /proc/sys/net/ipv4 활용 서버보안 -1- 호스트웨이 2015.09.17 2838
350 SNMPD LOG 안남게 하기 호스트웨이 2015.09.10 2885
349 리눅스 tree 명령어 file 호스트웨이 2012.09.21 2925
348 yum을 이용한 X-Window 설치 호스트웨이 2012.09.27 3000
347 INIT: no more processes left in this runlevel 메세지 발생시 호스트웨이 2012.11.15 3011