Use this script to securely wipe your disk.
This script monitors the disk usage while wiping it. It continuously writes the contents of a file named secure-random into a file called trash in the current directory until the disk usage reaches 95%. After reaching the threshold, the trash file is deleted.
secure-random takes 10 MB. It is generated by my self-made PRNG, which is randomly composed of all printable ASCIIs. Feel free to replace it with your version.
A device that can be plugged in the disk to wipe, and that device should have the ability to execute bash.
The file system of that disk should support large files. For example, FAT is not supported.
- Put
disk-wiper/in the root directory of the disk. - Open your file manager, navigate into the
disk-wiper/folder. - Right-click on any blank space inside
disk-wiper/and select "Open in Terminal". - Run the script with
$ bash ./run.sh.
Because secure-random and trash files can be large, only view them using the nano editor in the terminal to avoid potential crashes caused by opening large files in heavier editors or file viewers.