If you want to wipe your hard drive clean to pass the computer on to a new home without the risk of someone getting your personal files, there are a number of ways to do that.
Windows 10 has a reset feature, it was introduced in Windows 8. You can simply search for reset or go through Settings, Update & Security.
From Update & Security, you will see Recovery on the left hand side, click on that and click Get started.
Since you wish to remove all your files, choose Remove everything.
To start the wipe process, choose Remove files and clean the drive.
Alternatively, you can use the format command from cmd.
format x: /p:1
Replace the x with the drive letter that appears in Windows Explorer. The /p:1 sets the number of passes that Windows will erase the data. You may want 3 passes with a normal hard drive, but with solid state drives, it reduces the lifespan.
If you have a hard drive attached to your computer or a memory stick you want to securely erase, then Eraser is the program for you. You can download it for free here: eraser.heidi.ie
You can also use it on files.
Windows 7 and older
In Windows 7 and older there is no secure wipe process available, you can use eraser but it is more effective to use DBAN (Darik’s Boot And Nuke) which you can get from DBAN.org. You download the CD image, put a blank CD in your DVD writer and Windows will write this to your CD.
Next you need to restart your computer, paying attention to which button to press to change the boot order and choose CD.
You will want to press enter to start DBAN interactively.
If you have more than one drive, you can select the drive using the arrow keys and space bar.
You can press M to choose the method, with the default being DoD Short, which performs 3 passes wiping the drive. You can change this to the full DoD 7 passes if you have the time, but the PRNG stream is the shortest, writing random numbers over the drive.
When you are ready, press F10 on your keyboard and the wiping process starts.
However, if your computer has a solid state drive, then you can’t perform this operation. Blancoo do offer secure erasure but at a steep price. They charge £23 per drive.
Mac OS X
If you have a Solid State Drive in your Mac, start by using FileVault (Apple menu, System Preferences, Security & Privacy) to encrypt your existing data. It takes a while for the Mac to encrypt everything but it is a feature you need to consider when using your Mac. It does enforce password use however, as your password is the key to the File Vault encryption.
Once encrypted, you can use Disk Utility to erase the drive and all your data is securely removed.
For normal hard drives, the secure wipe feature in Disk Utility (Applications, Utilities folder) will make sure all your data is securely removed.
However, if it is your system drive you wish to wipe, then you need to restart into Recovery mode by holding down both Cmd and R after you press the power button to turn your Mac on.
The four settings are:
- Fastest – No secure erase is performed, the data is just deleted.
- One pass of random data followed by a pass of zeros to erase the data
- DoD Short – 3 passes over the data
- DoD 5220-22 M, 7 passes over the data
Once you have chosen how securely you would like to erase your drive, click OK, then Erase.
If this is your system drive, you will need to exit after and choose to reinstall Mac OS., or turn off the Mac and let the next owner reinstall Mac OS.
Either at the command line, or in a terminal, we need to work out what the drives are called:
Once we have the drive name (/dev/sda) we can check the drive out using hdparm:
hdparm -I /dev/sda
There are two things to look for:
Firstly to see if the drive supports SECURITY ERASE UNIT and ENHANCED SECURITY ERASE UNIT, if it has we can proceed with hdparm.
Secondly, to see if the drive is frozen. In a frozen state, the drive is unable to be wiped, so we have to unfreeze it:
echo -n mem >/sys/power/state
This command tells the computer to enter a low power state and unfreeze drives, so a simple press of the power button restores the computer and the drive is unfrozen.
hdparm -I /dev/sda
Next we set a temporary master password on the drive:
hdparm –user-master u –security-set-pass p /dev/sda
This allows us to perform a secure erase. We can see the change to the drive with hdparm:
hdparm -I /dev/sda
If you have ENHANCED SECURITY ERASE as an option enter:
hdparm –user-master u –security-erase-enhanced p /dev/sda
or for SECURITY ERASE:
hdparm –user-master u –security-erase p /dev/sda
You can verify with:
dd if=/dev/sda bs=1M count=5
If you see nothing, then your drive has been securely wiped.
If secure wipe is not available, or there is data visible after the secure wipe, then use dd:
dd if=/dev/urandom of=/dev/sda
dd is a data duplicator, it copies blocks of data from input to output. In this case, /dev/urandom is a device that generates random numbers. The process gives no output, and may take several hours to complete