Security: How To Make Removed Data Unrecoverable Before Selling The Hard Disk

Before you sell your hard disk, it is better to make sure that the data you had is unrecovable. In Linux and Unix Systems, making files unrecoverable is an easy thing to do.

The following command replaces the data with random bytes. It takes some time to finish its task, but everything becomes unrecovable.

Wipe the entire hard disk (do this as root): dd if=/dev/urandom of=/path/to/hard bs=1M

Wipe a partition (do this as root): dd if=/dev/urandom of=/path/to/partition bs=1M

Examples:

$ sudo dd if=/dev/urandom of=/dev/sda bs=1M

$ sudo dd if=/dev/urandom of=/dev/hda bs=1M

$ sudo dd if=/dev/urandom of=/dev/sda2 bs=1M

$ sudo dd if=/dev/urandom of=/dev/hda2 bs=1M

If you don’t know what does /dev/sda mean, read this article about the hard disk and partition representation in Linux and Unix systems.

Tagged with: , , , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!