I made a Gist!

Posted by Kromey at 8:02pm Apr 3 '13
You must sign in to send Kromey a message

Long story short, I have a bunch of hard drives that, once I've copied all their data off, I have no further need for -- but don't want to potentially leak private data should they leave my hands.

The easiest way to wipe a hard drive in Linux is the venerable dd command. Unfortunately, if you're wiping a large hard drive -- and especially if you're doing this while being limited to USB 2.0 speeds -- this can take a very long time, and dd provides absolutely no output about its progress. Unless you send it the USR1 signal, of course, but then you have to spawn a separate terminal to get the output in the first terminal, and it's just not very nice, clean, nor elegant.

Enter my Bash-fu. Here's a script I wrote that spawns a dd process and then monitors it, while providing succinct status updates, all from/within the same terminal -- no need for multiple terminal windows!



Download and save the script, make it executable, and then run it as simple as can be:
./disk_wipe.sh /dev/sdg
where /dev/sdg is the hard drive you want to wipe. You can also wipe individual partitions by supplying that in place of the drive, e.g. /dev/sdg1 would wipe only the first partition on /dev/sdg.

A friend told me about Github's new(ish) Gist feature, and this is the first time I've used it. Just thought I'd share it in case someone else needs something like this.



added on 8:03pm Apr 3 '13:

Hm, evidently the new post processing doesn't allow one to embed external JavaScript anymore...

You currently have read-only access to this board. You must request an account to join the conversation.

Why Join 4thKingdom?

Note that there are no ads here. Just intelligent and friendly conversation. We keep the spam out, the trolls out, the advertisers out… 4K is just a low-key, old-fashioned site with members from around the world.
This community began in 1998, and we continue to accept new members today.

Hot Discussion Topics: