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

번호 제목 글쓴이 날짜 조회 수
306 linux 특정 용량으로 파일을 찾기, 삭제하기 호스트웨이 2015.09.08 4682
305 리눅스 tee명령어를 이용하여 디렉토리 목록 저장 file 호스트웨이 2012.09.28 4730
304 라우팅 제어명령 호스트웨이 2015.09.17 4784
303 리눅스 명령어 모음 호스트웨이 2012.12.06 4785
302 bios 타이머 및 시간 설정 호스트웨이 2015.09.18 4826
301 iotop 사용하기 호스트웨이 2015.09.14 4914
300 Web site에서 php error log 출력하지 않기 호스트웨이 2012.11.01 5047
299 패키지에 포함된 리스트 확인하기 호스트웨이 2012.12.07 5084
298 리눅스 파일 및 디렉토리 권한 관리 file 호스트웨이 2015.09.13 5181
297 리눅스 캐시 메모리 비우기 file 호스트웨이 2012.12.26 5267
296 Linux -(하이픈)으로 시작하는 파일 지우기 호스트웨이 2015.09.20 5497
295 Proftp 설치 및 xinetd 에서 실행하기 file 호스트웨이 2015.09.18 5588
294 dumpe2fs - 파일시스템 상세 정보 확인 호스트웨이 2015.09.18 5611
293 서버 네트워크 대역폭 제한 호스트웨이 2015.09.20 5715
292 LAN 카드에 여러개의 IP 주소 할당 호스트웨이 2015.09.18 5768
291 tar 분할압축하기 호스트웨이 2015.09.19 5872
290 Linux chkrootkit을 이용한 백도어 설치 탐지 호스트웨이 2015.09.18 5932
289 lrzsz 사용해보기 호스트웨이 2012.10.12 6059
288 Touch 파일 용량 0바이트 만들기 호스트웨이 2015.09.20 6111
287 ls -l 출력 시 날짜형태 변경 호스트웨이 2012.12.27 6128