W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
過去在 GNU/Linux 里,凍仁會使用 dd
,此指令會將資料填零而達(dá)到抹除磁盤的功用,但就算這樣還是有被專業(yè)人士還原的風(fēng)險;現(xiàn)在凍仁都改用 shred
指令來完成這項任務(wù),此指令是專門用來撕碎資料的。
將 /dev/sdX 裝置填零。
dd if=/dev/zero of=/dev/sdX bs=1M
開始 shred 之前,您必須先安裝 coreutils 套件。
$ sudo aptitude install coreutils
# -v 顯示進(jìn)度。
# -f 強(qiáng)制寫入,必要時允許變更權(quán)限寫入。
# -z 用零覆寫并撕碎。
# -n 指定覆寫次數(shù)。
# -n 指定覆寫次數(shù)。
抹除硬盤
$ sudo shred -vfz -n 10 /dev/sdX
shred: /dev/sdX:11 次之第 1 次 (random)...
shred: /dev/sdX:11 次之第 1 次 (random)...471MiB/932GiB 0%
shred: /dev/sdX:11 次之第 1 次 (random)...472MiB/932GiB 0%
shred: /dev/sdX:11 次之第 1 次 (random)...949MiB/932GiB 0%
......
抹除檔案
$ shred -vu -n 10 hello-sherd.txt
shred: hello-sherd.txt: pass 1/3 (random)...
shred: hello-sherd.txt: pass 2/3 (random)...
shred: hello-sherd.txt: pass 3/3 (random)...
shred: hello-sherd.txt: removing
shred: hello-sherd.txt: renamed to 000000000000000
shred: 000000000000000: renamed to 00000000000000
shred: 00000000000000: renamed to 0000000000000
shred: 0000000000000: renamed to 000000000000
shred: 000000000000: renamed to 00000000000
shred: 00000000000: renamed to 0000000000
shred: 0000000000: renamed to 000000000
shred: 000000000: renamed to 00000000
shred: 00000000: renamed to 0000000
shred: 0000000: renamed to 000000
shred: 000000: renamed to 00000
shred: 00000: renamed to 0000
shred: 0000: renamed to 000
shred: 000: renamed to 00
shred: 00: renamed to 0
shred: hello-sherd.txt: removed
※ shred 在 ext3, ext4 這類的日志檔案系統(tǒng)上運(yùn)作時可能無法完整清除,若真不放心可以試試 hdparm。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: