Securely wiping the hard-drive inside your machine is a sensible move if you’re planning to donate the machine to a new owner.
The standard factory reset or refresh procedures built into many machines gives the impression that it completely wipes the data. In all probability however, it wouldn’t take a headstrong user very long to resurrect your files with a few free tools found on the internet.
This Big Tech Question guide will show you how to safely and securely erase the hard-drive so that the chances of data retrieval are significantly reduced. We’re covering the most common methods for Windows, as well as an all purpose method which needs a little preparation and a couple of USB flash drives – so grab some just in case.
The easy method
As mentioned earlier, Windows 10 has a built in reset feature which will wipe the drive and reset the machine. If you follow our guide ‘How should I reset Windows 10 before I donate my machine?‘ you won’t go far wrong. However, if this doesn’t work or you’re looking for a more secure method, keep on reading – we have just what you’re looking for.
If you’re not running Windows 10 or the machine’s operating system doesn’t load correctly, then it’s time to roll up your sleeves. This is where the real fun begins!
The harder method
You’re going to need at least one 8GB USB stick, which will be erased during the process. If the computer that you’re wiping is the only machine that you have access to, then use our guide ‘How can I create a Windows 10 USB boot device?‘ before you begin.
It is much easier to erase a Windows drive if it’s not in use, so we’re going to use SparkyLinux to work the magic. Sparky maintains a 32 bit version which will work on older or lower powered machines. Download the ISO (we’ve choose the LXQt variant) which we’ll use as a ‘Live’ environment on the machine – this means we’re not installing Linux to the machine, just running it in RAM.
Building a bootable Linux USB using Rufus
Insert a USB drive into the machine, open Rufus, and under boot selection choose Disk or ISO image (Please select).
Press Select and point Rufus towards the downloaded Sparky Linux ISO.
If you have a reasonably new machine (Windows 8 upwards), switch Partition Scheme to GPT and make sure that Target System toggles to UEFI (non CSM). This tell Rufus to build a UEFI compatible SparkyLinux USB which modern machines will prefer. If you have an older machine (non-UEFI), then have a look here.
If Rufus asks, use Write in ISO Image mode and press OK. Rufus will also flash a warning saying that all the data on the USB drive is about to be erased – click OK. Rufus will now take a few moments to create the bootable drive.
Booting from an USB drive
Once Rufus has finished, we’ll need to persuade the PC to fire up using the USB as a boot device.
Modern machines, especially laptops, use a feature called Secure Boot which will stop Sparky from loading. Disabling Secure Boot requires access to the UEFI/BIOS. HP laptops use the Esc key to enter the boot menu and most Lenovo units have the NOVO button – a small hole on the chassis requiring a prod with a straightened paper-clip. Other machines use combinations of Del, F2 or F12. A bit of trial, error, Googling and random key pressing will usually reveal the trigger. The next couple of screenshots are from an HP laptop, so yours may look a little different.
Once inside, disable Secure Boot, then save and exit.
Insert the USB, power on the machine and be ready to stab the keyboard. Select the SparkyLinux USB drive from the boot menu and wait for it to load.
Got an older machine? Don’t Panic…
If you’re following this guide on a very old machine which doesn’t like UEFI booting, then repeat the Rufus stage switching the Partition Scheme to MBR and Target System to BIOS or UEFI.
Welcome to SparkyLinux
At the SparkyLinux menu, choose the first option. As we’re not installing Sparky onto the system, we don’t need to be too concerned with language choices and region selection.
Sparky will begin to load. When the desktop appears, click Menu in the bottom left hand corner and in the box that pops up, type GParted. Click the icon that appears just above. GParted is a utility for managing hard drive partitions, but we’re using it for a different reason.
When the GParted window appears, head towards the drop-down menu towards the top right and click it. This will show a list of all the drives attached to the machine. There will probably only be two – the internal drive (to be wiped) and the USB with Sparky on it. The internal drive will probably have more partitions and be the larger of the two drives (unlike our example below – I just happen to have a large USB drive 😊).
Once you’ve spotted the correct drive, make a note of its sdx designation. In our example, the drive to be wiped is sda (the USB drive is sdb). Time to close GParted.
sudo dd if=/dev/urandom of=/dev/sda status=progress
Make sure you type the correct sdx designation into the command line, otherwise the wrong drive will be wiped.
Press enter on the keyboard and watch it fly… or more accurately, don’t. This can take some time, especially if you have a large drive, so you may need to run this process overnight.
Briefly, the command is filling every single part of the drive with randomised data. Anything that used to be on it will be scrambled and lost. The last part of the code (status=progress) gives a running tally of progress as DD’s default behavior is to keep silent.
Eventually DD will rip through your drive and terminate.
Job done. Thank you Sparky!
Power off the machine and pull out the SparkyLinux USB. To reload Windows, insert the pre-prepared Windows boot USB (made using our how to create a Windows 10 USB boot device guide), power on and hit that previous magical combination of keys to force the machine to boot from the drive.
Note – you may wish to enter the UEFI/BIOS (to re-enable Secure boot, etc.) that you might have disabled to run Sparky.
The Windows loader will appear and walk you through the installation procedure. Once you’ve answered all the questions, the machine will have a fresh copy of Windows for you to play with.
Securely wiping a drive before passing the machine to a new owner is clearly a sensible idea. Although you may know and trust your machine’s next owner, the same may not be true of the owner after that.
These methods will significantly reduce the chances of data recovery, but it’s impossible to remove all chances of data retrieval unless a drive is physically destroyed. If you’re dead set on scrubbing your drive as clean as possible, the Sparky method can be modified and repeated. Try these three commands in sequence in the SparkyLinux terminal:
sudo dd if=/dev/urandom of=/dev/sda status=progress sudo dd if=/dev/zero of=/dev/sda status=progress sudo dd if=/dev/urandom of=/dev/sda status=progress
The first command fills the drive with random data, the second fills the drive with zeros, and the final command once again refills it with random data.
We’ve shown you how to do this for free, but there are commercial packages such as KillDisk which do pretty much the same thing.
If you’re still unsure, then seek out your local neighbourhood friendly computer store who will probably offer a drive wiping service.