How do I permanently erase hard disk?

by on July 10, 2006 · 5 comments· LAST UPDATED June 14, 2008

in , ,

Q. I am going to sell my laptop soon. Before discarding my system, I want to make sure that no one should able to use my personal data using any method (format do not work). Is there any open source software out there that can help me permanently erase my hard disk?

A. For erasing hard disk permanently, you can use standard dd command. But I recommend using shred command.

Erase disk permanently under Linux

Step # 1: First, download knoppix Live CD.

Step #2 : Boot from CD.

Step #3: How do I use shred command?
Shred originally designed to delete file securely. It deletes a file securely, first overwriting it to hide its contents. However same can be used to erase hard disk. For example your hard disk name is /dev/sda (SCSI hard disk) then type following command:
# shred -n 5 -vz /dev/sda
Where,

  • -n 5: Overwrite 5 times instead of the default (25 times)
  • -v : Show progress
  • -z : Add a final overwrite with zeros to hide shredding

Command is same for IDE hard disk hda (PC/Windows first hard disk connected to IDE) :
# shred -n 5 -vz /dev/hda

Other options or Live CDs
Darik's Boot and Nuke CD is highly recommended for permanently erasing hard disk

Darik's Boot and Nuke ("DBAN") is a self-contained boot floppy (CD ISO also available) that securely wipes the hard disks of most computers. DBAN will automatically and completely delete the contents of any hard disk that it can detect, which makes it an appropriate utility for bulk or emergency data destruction.

Download page. Also don't forget to read - Frequently Asked Questions

DBAN works with MAC, PC (windows XP) and Linux system. Once you used shred or DBAN cd you can sell laptop :)

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 5 comments… read them below or add one }

1 dban December 3, 2011 at 10:18 pm

DBAN now works best with flash drive – just don’t forget to set your computer to boot to USB first.

Reply

2 Becky Wright April 29, 2013 at 10:35 am

Thanks for sharing this article! It gives me an idea on how to delete my personal data and information. Noted this one!

Reply

3 Neo Jensson December 18, 2013 at 2:51 pm

One free over writing tool is ErAce. It can be downloaded from erace.it or sourceforge

Reply

4 RH User January 12, 2014 at 9:42 pm

Thanks for the tutorial. It solved my issues.

Reply

5 Caracal August 7, 2014 at 5:49 pm

According to “man shred” the default is 3 rather than 25

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: