How to destroy all your data on your Ubuntu Linux system!

WARNING: Do NOT try these examples; they will cause data loss!
If you intentionally want to wipe your hard drive or destroy all data on it, here are a few examples!

The following examples are provided to warn about the dangers of dd, if used incorrectly. Trying any of these commands with the proper privileges will almost certainly result in major data loss, and may make the system unusable. In order to prevent accidental copying and pasting, “dd” has been replaced with “[dd]” here.

This overwrites the complete first hard disk with null bytes, erasing it (though not in a manner that is as secure as overwriting with random data):

[dd] if=/dev/zero of=/dev/hda

This overwrites the first few blocks of the first hard disk with the file, resulting in a loss of the partition table:

[dd] if=funnysong.mp3 of=/dev/hda

This will completely corrupt an entire hard disk (/dev/dsp is the sound player/recorder):

[dd] if=/dev/dsp of=/dev/hda

This will overwrite an entire disk with pseudorandom data, making its initial contents unrecoverable outside a clean room in a hard drive forensics laboratory, and probably unrecoverable there as well.

[dd] if=/dev/urandom of=/dev/hda

The examples above presume device names (valid on some Linux systems) that may be different on other platforms. Here are some common variations.

Mac OS X:

[dd] if=/dev/zero of=/dev/disk0


[dd] if=/dev/zero of=/dev/c0d0p0

NetBSD/OpenBSD (does not work if securelevel > 1):

[dd] if=/dev/zero of=/dev/rwd0
Let me know if you find anything more destructive/efficient!

Clicky Web Analytics