Изтриване на празното място на хард диск
Изтриване на празното място на хард диск – звучи глупаво нали? Да ама не..
На мен по-скоро ми звучи логично от гледна точка на това: копувам си хард диск втора употреба от prodavalnik.com например.
Предишният му собственик го е форматирал, като с това той си мисли че е изтрил информацията от него. Да ама не!
Има много програми за Windows или Linux които могат да възтановят тази информация (дали частично или напълно) но могат.
Затова е важно да се знае, че ако искаме да скрием напълно информацията от хард диска си , то е необходимо да я изтрием безвъзвратно.
В този си пост ще напиша как става тая хватка под Linux / мразя Windows / :
root@test:~# df -m Filesystem 1M-blocks Used Available Use% Mounted on /dev/simfs 10240 777 9464 8% / none 256 1 256 1% /dev none 52 1 51 2% /run none 5 0 5 0% /run/lock none 205 0 205 0% /run/shm none 100 0 100 0% /run/user root@test:~#
Тук се вижда че имаме свободни 9464MB които ще запълним до дупка и след това ще изтрием чрез командата shred
Първо създаваме файл голям колкото свободно място имаме в момента, след това го изтриваме „защитено“ със shred:
root@test:~# dd if=/dev/zero of=/free-space bs=1024 count=102400 102400+0 records in 102400+0 records out 104857600 bytes (105 MB) copied, 0.397582 s, 264 MB/s root@test:~# du -sh /free-space 101M /free-space root@test:~# shred -v -s 9464M /free-space shred: /free-space: pass 1/3 (random)... shred: /free-space: pass 1/3 (random)...645MiB/9.3GiB 6% shred: /free-space: pass 1/3 (random)...892MiB/9.3GiB 9% shred: /free-space: pass 1/3 (random)...1.2GiB/9.3GiB 13% shred: /free-space: pass 1/3 (random)...1.6GiB/9.3GiB 17% shred: /free-space: pass 1/3 (random)...1.9GiB/9.3GiB 21% shred: /free-space: pass 1/3 (random)...2.3GiB/9.3GiB 24% shred: /free-space: pass 1/3 (random)...2.6GiB/9.3GiB 28% shred: /free-space: pass 1/3 (random)...2.9GiB/9.3GiB 32% shred: /free-space: pass 1/3 (random)...3.3GiB/9.3GiB 36% shred: /free-space: pass 1/3 (random)...3.7GiB/9.3GiB 40% shred: /free-space: pass 1/3 (random)...4.0GiB/9.3GiB 43% shred: /free-space: pass 1/3 (random)...4.4GiB/9.3GiB 47% shred: /free-space: pass 1/3 (random)...4.7GiB/9.3GiB 51% shred: /free-space: pass 1/3 (random)...5.1GiB/9.3GiB 55% shred: /free-space: pass 1/3 (random)...5.4GiB/9.3GiB 59% shred: /free-space: pass 1/3 (random)...5.8GiB/9.3GiB 62% shred: /free-space: pass 1/3 (random)...6.1GiB/9.3GiB 66% shred: /free-space: pass 1/3 (random)...6.5GiB/9.3GiB 70% shred: /free-space: pass 1/3 (random)...6.9GiB/9.3GiB 74% shred: /free-space: pass 1/3 (random)...7.2GiB/9.3GiB 78% shred: /free-space: pass 1/3 (random)...7.6GiB/9.3GiB 82% shred: /free-space: pass 1/3 (random)...7.9GiB/9.3GiB 86% shred: /free-space: pass 1/3 (random)...8.3GiB/9.3GiB 90% shred: /free-space: pass 1/3 (random)...8.7GiB/9.3GiB 94% shred: /free-space: pass 1/3 (random)...9.0GiB/9.3GiB 98% shred: /free-space: error writing at offset 9913876480: Disk quota exceeded root@test:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/simfs 10G 10G 0 100% / none 256M 4.0K 256M 1% /dev none 52M 1020K 51M 2% /run none 5.0M 0 5.0M 0% /run/lock none 205M 0 205M 0% /run/shm none 100M 0 100M 0% /run/user root@test:~# du -sh /free-space 9.3G /free-space root@test:~# du -m /free-space 9464 /free-space
root@test:~# shred -vfz -n 10 -u /free-space shred: /free-space: pass 1/11 (random)... shred: /free-space: pass 1/11 (random)...452MiB/9.3GiB 4% shred: /free-space: pass 1/11 (random)...664MiB/9.3GiB 7% shred: /free-space: pass 1/11 (random)...1.0GiB/9.3GiB 10% shred: /free-space: pass 1/11 (random)...1.3GiB/9.3GiB 14% shred: /free-space: pass 1/11 (random)...1.6GiB/9.3GiB 17% shred: /free-space: pass 1/11 (random)...1.9GiB/9.3GiB 21% shred: /free-space: pass 1/11 (random)...2.2GiB/9.3GiB 24% shred: /free-space: pass 1/11 (random)...2.5GiB/9.3GiB 27% shred: /free-space: pass 1/11 (random)...2.8GiB/9.3GiB 30% ........ shred: /free-space: removing shred: /free-space: 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: /free-space: removed
За Windows знам за „secure“ изтриване чрез sdelete и BleachBit