2016.02.29 19:37
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 | SSH(Secure shell) 사용하기 | 호스트웨이 | 2008.05.19 | 30532 |
325 | Login 실패시 계정 잠그기 및 PAM 설정 | 호스트웨이 | 2016.01.04 | 30144 |
324 | ramdisk 사용하기 | 호스트웨이 | 2008.05.19 | 30073 |
323 | script 명령어 이용하기 | 호스트웨이 | 2008.05.19 | 30000 |
322 | ethtool | 호스트웨이 | 2008.05.19 | 29609 |
321 | 폴더에 다수의 파일을 삭제하기 | HOSTWAY | 2009.02.19 | 29439 |
320 | ssh에서 일반계정들의 접속을 제한 하는 방법 | 호스트웨이 | 2008.05.19 | 29315 |
319 | nmap 사용법 | sylee | 2008.05.15 | 29307 |
318 | User생성시 홈디렉토리 자동생성하기 | sylee | 2008.05.15 | 29019 |
317 | mrtg를 이용한 트래픽 모니터링(debian 5.0) | jook | 2009.06.02 | 28968 |
316 | 리눅스에서 shutdown 명령어 사용하기 | 호스트웨이 | 2012.06.29 | 28860 |
315 | vsftpd.conf 설정 | jook | 2009.06.03 | 28743 |
314 | 많이 사용되는 리눅스 명령들 | sylee | 2008.06.11 | 28716 |
313 | 리눅스에서 pkill, pgrep 명령어 사용하기 | 호스트웨이 | 2012.06.22 | 28519 |
312 | Putty 접속 시 창 분할하는 방법(screen 이용) | 호스트웨이 | 2012.07.27 | 28511 |
311 | 리눅스 daemon 설명 | 호스트웨이 | 2012.08.10 | 28448 |
310 | grub 사용방법 | sylee | 2008.05.15 | 28374 |
309 | arp 명령 사용법 | 호스트웨이 | 2012.03.27 | 28284 |
308 | atop like top | HOSTWAY | 2008.06.04 | 28202 |
307 | 리눅스 UTF-8 언어 설정 | 호스트웨이 | 2015.09.07 | 27615 |