Deep Format of a Harddrive on a Linux System
I've got an original Asus Eee PC Netbook that I'd like to sell. When I've sold old computers in the past, I've typically done a deep/secure/zeroing out style format. How can I do this on a Linux Netbook? I'm looking for
The command that will let me do this
Advice on how I can do this on a device with (seemingly?) non-removable media
Thanks in advance!
Another one you can use is DBAN.
First create a live Linux installation on a USB drive (instructions).
Then boot off that USB Linux installation and run:
shred -vfz -n 100 /dev/hda
You can change 100 to whatever number of passes of zero writes you want ("z" is specifying zero writes). The "f" parameter overrides any permissions issues. "v" is verbose. /dev/hda should be your hard disk (or it could be /dev/sda if you are using SATA). You can use sudo fdisk -l
to get the drive listing to make sure what you should use instead of (/dev/hda).
Is the NSA going to take your machine apart and is ready to spend man weeks recovering your data?
No?
Then just dd if=/dev/zero of=/dev/sda bs=1M or rather (as we are not logged in as root) sudo dd if=/dev/zero of=/dev/sda bs=1M
Might want to be booted single user, or from another device, but I suspect it doesn't matter (tiny chance the machine would crash before you finished writing, but I doubt it).
Machine disk sda will be all 0s, and unrecoverable. Given the way SSDs work, there probably will be some unreachable blocks, that you'd need a utility to get, but they will not be readable with normal tools.
Given that you don't overwrite data on SSDs, you write data, and the drive erases the area via hardware commands, and then writes your data on the new blank area (BIG oversimplification here), I suspect the overwrite a zillion times thing buys you nothing (and all that is just so the NSA cannot take your drive apart and read it with a scanning electron microscope or the like) as the tech is quite different with a SSD.
As Gardeniers suggested, DBAN is likely what you want. It has great hardware support, so it will likely work with your controller, and is easy to use. I have used it for years to sanitize drives containing case data. The interface is simplistic, yet easy to use. Plus it will run from a usb flash drive, making your life much easier.
boot from any live distro, fire up a a texteditor of your choice and write following piece of code into it, save and run:
#!/bin/bash
$DRIVE = /dev/sda # change this to your hard drive you wanna erase
$COUNT = 0
$TIMES = 16 # change this to reflect your state of paranoia =)
while [ $COUNT -lt $TIMES ] : do
dd if=/dev/zero of=$DRIVE && dd if=/dev/urandom of=$DRIVE
COUNT = $[$COUNT+1]
done
dd count=1 bs=1024 if=/dev/zero of=$DRIVE # erase the first 1megabyte to clear the MBR and partition table