Linux Format

Destroying data

-

I have a hard drive that is showing SMART errors. It is still under warranty, which means I can return it but what abut the data that is on there? I don’t really want my personal informatio­n being made available to random people. Is deleting my home directory sufficient for this? I have heard that deleted files can still be read. George Bowen You are correct, deleting files doesn’t actually delete them. All it does is remove their entries from the directory table, the contents are still exactly where they were when they were created. Overwritin­g files isn’t sufficient either as many filesystem­s, when asked to rewrite a file, write a new copy of it and then delete the old one merely by updating the directory table to point to the new version. This is secure in terms of surviving power failures and crashes, at least you still have the old version, but isn’t much use in your situation. The simplest way to do this is to delete what you need to get rid of then overwrite all free space on the filesystem with zeros with. $ sudo rm -fr /home/* $ sudo dd if=/dev/zero of=/home/nothing bs=4k

This will write zeros to a file called home/ nothing until the filesystem is full. That will overwrite all the space used by any other data.

There is some dispute over whether this is sufficient with stories abounding about sophistica­ted equipment and methods that can be used to recover data even after a complete zeroing. This is actually much harder than it used to be, because drives pack everything so much more tightly, but if you are at all worried, replace /dev/zero with /dev/ urandom in the above command to fill the drive with pseudo-random data. Don’t try to use /dev/random, this requires you to be using the computer to generate entropy data for the random bits – you will get bored with wiggling the mouse long before any reasonable sized drive is finished. Then delete the file that you created and repeat the process a couple more times.

This removes all the data on your home partition, but what about things like password files in places like /etc? To be fully secure, backup all your important data, which includes /etc as well as home (if you have the space, make a complete drive image with Clonezilla). Then you can erase the whole drive with $ sudo dd if=/dev/zero of=/dev/sdX bs=4k where /dev/sdX is your drive. Make sure you get this right as dd doesn’t ask if you are sure before erasing everything – once you hit Enter there is no going back.

If this is a system drive, run the command from a live CD, and use /dev/urandom as above if you want extra peace of mind. Bear in mind you will not receive your old disk back, but if it can be repaired it will be sent to someone as a replacemen­t for their faulty disk, so be careful with your data. If you really want peace of mind, then there’s always the Darik’s Boot and Nuke (DBAN) live CD from www.dban.org, which does everything possible to delete your drive’s data short of drilling holes in the platters.

 ??  ?? If you want to be sure of deleting data, use DBAN, but make sure you pick the right drive.
If you want to be sure of deleting data, use DBAN, but make sure you pick the right drive.

Newspapers in English

Newspapers from Australia