Brandon's Notepad

June 28, 2011

Wiping Linux File Systems

Filed under: How-To,Linux — Brandon @ 9:00 am
Tags: , , , , , ,

Home > My Lists > Technical Notes > Wiping Linux File Systems

Here are two Linux commands that can be used to overwrite disks with random bits:

badblocks -c nnnn -s -w -t random -v /dev/sdb

dd if=/dev/urandom of=/dev/sdb

The badblocks command searches for bad blocks on the disk and the parameters used above put it into write-mode (-w), writing random data (-t random) to the disk. The dd command takes longer but uses a higher quality of encryption. Also, /dev/random device is more secure but has higher enthropy than /dev/urandom.

Incidentally, the Wikipedia entry for dd explains that its JCL roots give the “Data Description” utility its name, but that “it is jokingly said to stand for ‘disk destroyer’, ‘data destroyer’, ‘death and destruction’, or ‘delete data'”. Personally, I thought it stood for “disk dup” because my experience has always been centered around writing boot/root disks and usb drives for Linux installs. I probably based this assumption on other utilities, such as the Tandem “FUP DUP” command.


Create a free website or blog at

%d bloggers like this: