파일을 실수로 삭제했거나 손상되었을 때, extundelete
는 ext2, ext3, ext4 파일 시스템에서 파일을 복구하는 데 도움을 주는 유틸리티이다. 이 글에서는 extundelete
를 설치하고 사용하여 지운 파일을 복구하는 방법에 대해 알아본다.
extundelete
설치
먼저, 아래 명령어를 사용하여 extundelete
를 설치한다.
sudo apt update
sudo apt install extundelete
extundelete
를 이용한 파일 복구
복구하려는 파일이 있는 디렉토리에서 다음 명령어를 사용하여 extundelete를 실행한다.
sudo extundelete --restore-file 경로/파일이름 /dev/sdX
경로/파일이름
: 복구하려는 파일의 경로와 이름을 지정한다./dev/sdX
: 파일 시스템이 있는 저장장치를 지정한다.(/dev/sda
,/dev/sdb
등)
예를 들어, 홈 디렉토리에서 삭제한 파일을 복구하려면 다음과 같이 입력한다.
sudo extundelete --restore-file /home/user/deleted.txt /dev/sda1
복구된 파일 확인
복구된 파일은 복구된 디렉토리에 위치하게 된다. 기본적으로 /tmp
디렉토리에 복구된 파일이 생성됩니다. 따라서 다음 명령어로 확인할 수 있다.
ls /tmp/RESTORED_FILES/