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

번호 제목 글쓴이 날짜 조회 수
326 리눅스 간단 시스템 점검 1편 호스트웨이 2012.11.14 4128
325 vi 편집기에서 모든글자를 대소문자로 변경할때 사용하는 명령어 호스트웨이 2012.11.23 4139
324 VNC-server 설치 및 설정 호스트웨이 2012.10.12 4155
323 리눅스 dmesg 명령어 file 호스트웨이 2012.12.06 4158
322 rpm에서 원하는 파일만 풀어서 사용하기 호스트웨이 2015.09.19 4277
321 ngrinder를 이용한 부하 테스트 - 1) Controller 설치 file 호스트웨이 2015.04.08 4285
320 디렉토리(폴더) 색상 변경하기 file 호스트웨이 2015.09.08 4297
319 /dev/null 과 /dev/zero의 차이 file 호스트웨이 2012.10.05 4298
318 [ERROR] ftp error 500 OOPS: cannot change directory:/home/ 호스트웨이 2012.12.21 4298
317 명령어 dstat 사용하기 호스트웨이 2015.09.01 4370
316 ifconfig 항목 설명 호스트웨이 2012.11.22 4399
315 df 와 du의 출력 크기가 다르게 보이는 이유 호스트웨이 2012.12.14 4429
314 리눅스 comm 명령어를 통해 두개의 파일내용 비교하기 file 호스트웨이 2012.11.29 4432
313 useradd 명령어 사용방법 및 옵션 호스트웨이 2015.09.08 4436
312 리눅스 파일명 일괄변경하기 file 호스트웨이 2012.10.18 4469
311 리눅스 tac 명령어를 통해 파일내용 역순으로 출력하기 file 호스트웨이 2012.10.18 4486
310 Block 단위 파일 복사를 위한 dd 사용 호스트웨이 2015.09.18 4517
309 서비스 체크 스크립트 호스트웨이 2012.09.28 4537
308 리소스 많이 차지하는 프로세스 찾기 호스트웨이 2015.09.20 4562
307 Kick-Start 설정 호스트웨이 2015.09.18 4590