3

I have a laptop that is barely alive. The screen is busted. The power cord is frayed. The power indicator flashes red sometimes. Etc. So I want to wipe the hard drive as effectively as I can before I take it into recycling today. The usual way to do this is to boot DBAN from a flash drive, but, oh no! I don't have a spare flash drive or any CDs!

What is the most effective way to wipe data from a hard drive if one is restricted to trying to do so from the Linux OS currently installed on the drive? Or from the BIOS I suppose. I ask because I assume there is something better than

  1. Classic rm -rf --no-preserve-root /.

  2. dd if=/dev/zero of=/dev/sda or something related.

  3. Remove and disassemble the drive with a hammer. But does that make it harder to recycle? I'm not actually sure how hard drives are recycled. :) But I'd rather not do this.

2
  • @Moab But, correct me if I'm wrong, you can't unmount the drive/partition from which the OS is currently running. So then you can't use dd or shred on that partition? Commented Mar 19, 2019 at 23:47
  • @MikePirrce you can run dd on the currently mounted partition. It will work but will crash at the end.
    – davidgo
    Commented Mar 20, 2019 at 10:01

1 Answer 1

8

Use dd (aka: option 2): Simple and effective.

dd doesn't care about mounted filesystems.

It has earned its nickname "Data Destroyer" for a reason

Testing it on a virtual machine yields the results expected. Just add && poweroff to put it out of its I/O error misery.

FWIW, testing indicates poweroff is available even after dd has completely overwritten the drive; I presume Bash loads it into RAM on start.

As per @Andy's comment (while sticking with dd), overwrite the drive multiple times. Chain multiple dd commands together or use a for loop to automate it:

for ((I=0;I<=7;I++)) {
  dd if=/dev/zero of=/dev/sda status=progress;
  echo "Drive has been overwritten $I time(s)";
}
2
  • I would add that dd is not a secure wipe per the NSA standards as these specify a number of overwrites with random data to ensure the data is unrecoverable. I usually take the hard drives out of laptops before sending the laptop to ewaste and keep the drive around for a while. If I really want to destroy the disks, I will use DBAN from another computer at a later time. nsa.gov/resources/everyone/media-destruction
    – Andy
    Commented Mar 20, 2019 at 17:58
  • @Andy: For any modern (as in non-ancient) drive, a single zero overwrite is most likely good enough. See e.g. this question on security.SE for details.
    – sleske
    Commented Mar 21, 2019 at 0:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .