6

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

  1. The command that will let me do this

  2. Advice on how I can do this on a device with (seemingly?) non-removable media

Thanks in advance!

5 Answers 5

15

Another one you can use is DBAN.

3
  • Gotta love DBAN, even if it's just for the name! Aug 3, 2009 at 3:49
  • 1
    Just remember that most of those methods are almost pointless on today's hard drives, and ~2 passes of random data are usually enough. Aug 3, 2009 at 8:24
  • 1
    @grawity, 0, 1, random (in any order) is a slightly better idea. But your still correct that most DR places aren't going to find anything more than the random data.
    – Chris S
    Oct 13, 2010 at 15:11
11

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).

1
  • -n 100 will take a long time on a large drive.
    – nu everest
    Apr 24, 2018 at 4:14
5

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.

3

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.

1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .