Securely Wipe Disks on Linux

Wiping Free Space

Creates 1GB files full of zeros. Wipes almost all of the free space. Use a for loop to create the files on each filesystem. Run until the filesystem fills up before deleting zero files.

for (( i=1; i<=10; i++ ))
    num=$(printf "%03d" $i)
    echo $num
    dd bs=1024 count=1024K if=/dev/zero of=zero-$num

Wiping a Whole Drive

In RedHat Enterprise, and maybe others:

badblocks -w -s -p # [device]

Where # is the number of passes you want to use and device refers to the partition (/dev/sda1) or whole device (/dev/sda) you want to wipe.