Safely deleting a drive with LUKS

It can be very fast to safely delete a drive using encryption. The idea is basically to encrypt the whole disk and afterwards to overwrite it with zeros. In this article, I use LUKS, which already ships with Ubuntu 14.04. This procedure may be quicker and more reliable than “copy-based” methods if your CPU supports crypto commands.

First, replace all partitions that should be safely deleted with one large unformatted partition. I assume that this partition is called /dev/sda1 . Afterwards, setup LUKS on the unformatted partition. The password may be a really simple one.

Now, open the encrypted volume, entering the same password:

Afterwards, you start writing zeros into the encrypted partition, which will produce more or less random data on the disk:


Leave a Reply