The Known Plaintext blog has a pretty interesting high-level article called Ten Commandments of Data Destruction, which gives some advice on how to handle destruction of data on hard drives or USB thumb drives (e.g. if you want to sell them on eBay)...
While most of the stuff is good advice, there's one thing in there which is certainly not a good idea: "format your hard drive before giving it to the recycler"! That will usually not help at all! Don't ever think that formatting will really erase your data! Using simple, and widely-available tools everybody could restore data from such a formatted drive, even without requiring any costly equipment.
If you absolutely must sell or give away an old hard drive (physical destruction is always better!), wipe it with a Gutmann-style tool, such as wipe(1), or shred(1). Oh, and apply the tools to the raw partitions (e.g. /dev/hda) after booting from a live CD. Wiping single files on a mounted file system might not yield the expected results on some (journalled) file systems, because they are caching stuff etc...
The follow-up article presents some further ideas, e.g. an acid bath for your hard drive. It also mentions that simply breaking the read/write head or the motor of the disk might not suffice, forensics labs could replace those parts successfully...
David Bianco makes a very good point about data on company laptops (especially so if you consider the alarmingly high rate of "laptop theft, xxx million data records lost"-type news stories): "don't put the freakin' data on the laptop in the first place!".
(via Jesse Kornblum)
As I have bought a new 300 GB external USB disk drive on Friday, I have tried something new this time: disk encryption using dm-crypt / LUKS. It has been suggested to me multiple times that dm-crypt is superior to loop-aes, however I didn't get a real reason. Yes, it doesn't require any kernel patches and is easier to setup. But has any serious cryptographer looked at it sharply, yet? Did it withhold his eye contact?
Anyways, here's how I encrypted my 300 GB drive. I largely followed the guide at the EncryptedDeviceUsingLUKS wiki page...
badblocks -c 10240 -s -w -t random -v /dev/sdb
/dev/sdbwith whatever is correct on your system. If you're really paranoid, and are willing to wait one or two days, do this:
dd if=/dev/urandom of=/dev/sdb
apt-get install cryptsetup
cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb1
cryptsetup luksOpen /dev/sdb1 samsung300gb
mkfs.ext3 -j -m 1 -O dir_index,filetype,sparse_super /dev/mapper/samsung300gb
mount /dev/mapper/samsung300gb /mnt/samsung300gb
/mnt/samsung300gbwill be encrypted transparently.
cryptsetup luksClose /dev/mapper/samsung300gb
After unmounting, nobody will be able to see your data without knowing the correct passphrase. Drive is stolen? No problem. Drive is broken, and you want to send it in for repair without the guys there poking in your data? No problem. You leave the USB drive at home and some jerk breaks into your house, steals your drive, rapes your wife, and kills your kids? No problem. Well, sort of, but you get the idea ;-)
There's more things you can do, thanks to LUKS: have multiple passphrases which unlock your data, change/add/remove passphrases as you see fit, etc.
Update 2006-04-17: You have to use cryptsetup from unstable if you want LUKS support. cryptsetup in testing does not support this (thanks Ariel).