Archive for March 2011

Secure Hard Disk Erasure

Mar 15, 2011

Before setting up dm-crypt, one is supposed to overwrite the hard disk with random data. As it turns out, this is harder to do than initially expected. Using /dev/random or /dev/urandom as a data source to overwrite the disk will take ages (multiple days) for a hard disk drive of typical size. The same applies to using the wipe command.

Fortunately, there is an alternative available by means of the badblocks command:

badblocks -c 10240 -s -w -v -t random /dev/<device>

This takes approximately four hours per terabyte of data (YMMV).