웹사이트 검색

Linux에서 파쇄를 사용하여 하드 드라이브의 데이터를 안전하게 삭제/삭제하는 방법


때때로 다른 사람이 액세스할 수 없도록 하드 드라이브에서 데이터를 파기하거나 지워야 합니다(예: eBay에서 기존 하드 드라이브를 판매하기 전에). 단순히 데이터를 삭제(예: rm 사용)하는 것은 파일 시스템 포인터만 제거하지만 데이터는 제거하지 않으므로 복구 소프트웨어로 쉽게 삭제를 취소할 수 있기 때문에 충분하지 않습니다. 하드 드라이브를 비우는 것만으로는 충분하지 않을 수 있습니다. 여기에서 파쇄가 작동합니다. 파쇄는 파일과 파티션을 반복적으로 덮어쓸 수 있으므로 값비싼 하드웨어 검색으로도 데이터를 복구하기가 더 어려워집니다.

1 Linux 파쇄 응용 프로그램 정보

파쇄는 파일과 파티션 및 하드 드라이브를 지우는 데 사용할 수 있습니다. 파쇄 맨 페이지를 살펴보면 ...

man shred

... 다음을 알 수 있습니다.

CAUTION: Note that shred relies on a very important assumption: that the file system overwrites data in place. This is the traditional way to do things, but many modern file system designs do not satisfy this assumption. The following are examples of file systems on which shred is not effective, or is not guaranteed to be effective in all file system modes:
* log-structured or journaled file systems, such as those supplied with AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)
* file systems that write redundant data and carry on even if some writes fail, such as RAID-based file systems
* file systems that make snapshots, such as Network Appliance's NFS server
* file systems that cache in temporary locations, such as NFS version 3 clients
* compressed file systems
In the case of ext3 file systems, the above disclaimer applies (and shred is thus of limited effectiveness) only in data=journal mode, which journals file data in addition to just metadata. In both the data=ordered (default) and data=writeback modes, shred works as usual. Ext3 journaling modes can be changed by adding the data=something option to the mount options for a particular file system in the /etc/fstab file, as documented in the mount man page (man mount).

파쇄를 사용하여 파일을 지우는 경우에만 걱정해야 할 사항입니다. 그러나 하드 드라이브를 지우고 싶기 때문에 이 자습서에서는 전체 파티션 또는 하드 드라이브에 대해 파쇄를 사용합니다.

2 파쇄기 사용

시스템 파티션을 지우려면 라이브 시스템(예: Knoppix, Ubuntu Live-CD, 호스팅 시스템 복구 시스템 등)으로 부팅해야 합니다. 시스템 파티션을 지우지 않으려면 필요하지 않습니다.

파쇄가 이미 설치되어 있어야 합니다(

which shred

); 그렇지 않은 경우 다음과 같이 설치할 수 있습니다(Debian/Ubuntu/Knoppix):

apt-get install coreutils

전에 말했듯이 파티션과 하드 드라이브에서 파쇄를 사용하고 싶습니다. 예를 들어 /dev/sda5 파티션을 지우려면 다음을 사용할 수 있습니다.

shred -vfz -n 10 /dev/sda5

-v: 진행률 표시

-f: 필요한 경우 쓰기를 허용하도록 권한 변경

-z: 파쇄를 숨기기 위해 0으로 최종 덮어쓰기 추가

-n: 기본값 대신 N번 덮어쓰기(3)

따라서 이것은 /dev/sda5를 10번 덮어씁니다.

예를 들어 RAID 파티션에 대해 파쇄를 사용할 수도 있습니다.

shred -vfz -n 10 /dev/md1

그리고 /dev/sda와 같은 전체 하드 드라이브를 지우려면 다음을 사용할 수 있습니다.

shred -vfz -n 10 /dev/sda

파쇄는 파티션/하드 드라이브의 크기와 실행 횟수(-n)에 따라 시간이 오래 걸릴 수 있습니다.