How to permanently delete data in a file or on a hard drive

Today I will show you how to permanently delete a file or hard drive so that data can not be recovered using data recovery tools. This comes in handy when you have sensitive data you need to get rid of.

For the purpose of this tutorial I will be using Linux Mint 12 (steps work on all Linux distributions) however if you have a Windows system boot the system with a Linux Live CD and mount the hard disk.  This tutorial will show you how. Once this is done you can then use the steps outlined below.

To delete data securely we are going to use a tool called Shred.  Shred comes preinstalled on Linux so you don’t need to install it.  The following example will show you how it works.

Open up a terminal and create a file called test1 on your desktop by typing:

sudo touch /home/chris/Desktop/test1

Now we need to enter some data into the file so type:

sudo nano /home/chris/Desktop/test1

This will open up the file as shown below.  Enter whatever data you like into the file and then save and exit.


Now it is time to delete some data.  In your teminal type:

sudo shred /home/chris/Desktop/test1 

followed by:

nano /home/chris/Desktop/test1

As can be seen from the screenshot above Shred has completely scrambled all the data inside the file test1 making it unreadable.

All that is left is to delete the file so type:

sudo shred -u /home/chris/Desktop/test1

Shred will then overwrite the data 25 times with garbage while also renaming the file 11 times.  Your data is no gone.

To perform this operation on a hard drive you would open up a terminal and type the following:

sudo shred /dev/hda

where hda is your hard drive and /dev/hda is the mount point.  This would take some time to delete all the stuff on the drive so be patient.

About the Author

Hi I am Chris Wakefield the owner of ComTech IT Support. I provide Windows and Linux based IT Support, laptop repairs and computer repairs to both business and personal clients in and around Stirling.

For a list of what I can offer you why not visit my website www.comtech247.net where you will find a list of my services, testimonials, blog and much more.

This entry was posted in Blog and tagged file, hard drive, linux, Linux Mint 12, live cd, permanently delete, shred, terminal, widows. Bookmark the permalink.

One comment on “How to permanently delete data in a file or on a hard drive

  1. If a drive doesn’t work, I still don’t want the innards readable. I believe there are people who try to read drives that merely got thrown away.

    I’ve found that the insides of hard drives (accessible with a small Torx screwdriver) contain the parts you’d need for keeping things stuck to the refrigerator (the magnets) despite how big or fast your dog’s is, and wind chimes (the platters).

Leave a Reply

Your email address will not be published.

52,844 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>