June 14

Linux: Securely Erase A Hard Drive

shred -vfz -n 100 /dev/hda

Here’s what this does. “shred” is the command that tells the operating system that you want to not only erase all the files on the drive but also to over-write those files with random bits. The “f” in the “-vfz” command forces the write by changing the permissions on the drive wherever necessary. The “z” in the “-vfz” command writes zeros to the drive. The “-n” command is followed by a number (“100″ in the example above). This tells the operating system how many times to write random data to the drive. The more times you write over the data you had on the drive, the lower the odds that someone will be able to recover your files. Writing over your data 100 times is likely overkill; 3 to 5 times is how many times I typically wrote over data using Eraser (which does the same thing). Finally, the “/dev/hda” portion of the command tells the computer which drive to wipe.

By: Ryan


Copyright 2021. All rights reserved.

Posted June 14, 2012 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B