When it becomes necessary to completely format the data, such as when discarding the hard disk, simply deleting the file may cause it to be stolen by using recovery software. Use the dd command to delete the complete data.
The device is / dev / sdX.
$ sudo fdisk -l /dev/sdX
disk/dev/sdX: 1.8 TiB,2000398934016 bytes,3907029168 sector
unit:sector(1 * 512 =512 bytes)
Sector size(logic/Physics):512 bytes/4096 bytes
I/O size(minimum/Recommendation):4096 bytes/4096 bytes
The physical sector size seems to be 4096 bytes. The total number of physical sectors is 2000398934016/4096 = 488378646 sectors.
Write a random number. If the capacity is large, it will take time, so execute it when the resources of the PC are sufficient.
$ sudo dd if=/dev/urandom of=/dev/sdX bs=4096 count=488378646 seek=0 status=progress
https://wiki.archlinux.jp/index.php/ディスクの完全消去
Recommended Posts