Using dd to blank a drive

A lot of well-meaning people dumped their leftovers on me when I mentioned I was using a machine with a floppy drive, and had use for some spares. The things are like coat hangers now though — I have about twice as many as I wanted, and 10 times more than I need.

I also don’t really want to know what was on the floppy before it became mine, so I scrounged around a bit and found this as a command to overwrite the disk, until I find time to actually use it. As an alternative to the shred command. …

dd if=/dev/urandom of=/dev/fd0

The drive assignment is for Debian there, so it might be different for your distro. And changing the destination assignment will work for a USB drive or something else too. My primary school maths teacher taught us that we should always check our work, so …

dd if=/dev/fd0 count=1 | hexdump -C

That gives you a quick look at the earliest part of the floppy, so you can check and make sure what’s there is more or less unreadable. I don’t know if it’s a terrifically secure method or proof against forensics efforts, but neither of those is really a concern for me. :)

About these ads

8 Responses to “Using dd to blank a drive”

  1. 1 Mehall 2010/02/06 at 10:09 AM

    I hate to say wrong to you, but dd is actually by far one of the best ways to blank a drive. However much faith you put into DBaN, dd does the job so well, that if it completes a run (even if using /dev/null instead of /dev/urandom like you suggested) that many professional forensics recovery companies will refuse to try, as it is a waste of their time and your money.

    dd is a fantastic tool. Whenever I get a machine that I may have to return to the original owner, or to someone else significantly clueless about computers, I make a disk image to my external HDD, then wipe the disk (all using a live CD) using dd for both operations. a quick run of gParted later, and the disk is ready to have a new OS installed, but if I need to return it to the condition I got it in, dd will do exactly that given the disk image instead of /dev/null

  2. 3 anonymous coward 2010/02/06 at 1:18 PM

    and then there’s always the ‘badblocks’ command which comes with the ‘e2fsprogs’ package which allows you to check for … well, bad blocks on a device. I used to use the -w option almost all the time…

    • 4 anonymous coward 2010/02/06 at 1:25 PM

      d’oh! ;) here’s what the man page says about the ‘-w’ option:

      With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0×55, 0xff, 0×00) on every block of the device, reading every block and comparing the contents.

      • 5 Luca 2010/02/06 at 6:56 PM

        That sounds like a better way, as it’ll also check the integrity of the device. Depending on how un-random it is, it should also not take much longer.

  3. 6 anonymous coward 2010/02/08 at 11:32 AM

    Several passes with /dev/urandom (while syncing in between passes) is by far one of the best methods you can use to destroy data. Even if you’re worried about forensic recovery.

    Whenever I need to destroy a partition, I use:

    for i in {1..5}; do dd if=/dev/urandom of=/dev/sdXX bs=1M && sync; done

  1. 1 Links 6/2/2010: GNOME Journal Released, ARM CEO Sees Bright Future | Boycott Novell Trackback on 2010/02/07 at 9:45 AM
  2. 2 Thinking things through: dd over USB1.1 « Motho ke motho ka botho Trackback on 2010/08/24 at 6:25 AM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Visit the Wiki!

Some recent desktops

May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF

May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games

Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers


This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,958,212 hits



Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: