I'd like to sell my old pc (writing this on it) that has ubuntu 16.04 LTS. The guy who I am selling this to is my brother. He doesn't want the hdd to have ubuntu on it. So I'd like to know how do I delete all files and ubuntu too from this drive. It is the only drive on this PC. So basically the hdd would be in it's original state.
Asked
Active
Viewed 2,347 times
1 Answers
1
The harddisk cannot be deleted while ubuntu is running from it, so you will have to boot a Live CD from a CD or flashdrive.
Method 1: Terminal
You can use a dd
comand:
Boot into the Live CD
Check the partitions with
fdisk -l
Run
dd if=/dev/zero of=/dev/sda
(assuming that/dev/sda
is your HDD)
Method 2: GUI only
Here we will use gParted:
- Boot into the Live CD
- Run
gParted
from live CD. It should come with the Live CD, but in case it does not, run:apt-get update && apt-get install gparted
- Delete all partitions on your HDD (not the medium you are booting the Live CD from).
- Click the green "Apply All Operations" check-mark.
-
Since it is the brother the PC is sold to, it might be OK to just zero the HDD or delete the partitions. Otherwise I would recommend
shred
or any other method to securely wipe the disk. – Thomas Jan 08 '17 at 13:05 -
1@Thomas Nowadays the need to "shred" data instead of simply overwriting it once to securely delete it is a myth. One single overwriting cycle is enough. Even in a specialized high-tech lab that takes the disk apart and analyzes it with whatever funky tools they have will likely lead to nothing useful because data is so tightly packed on modern disks. – Byte Commander Jan 08 '17 at 13:15
-
MilosM, please note that deleting only the partitions does not delete any data. All files are still there and could be recovered. That might not be an issue if you give the disk to a beloved relative, but in general is bad advice when selling a disk. – Byte Commander Jan 08 '17 at 13:27
-
@ByteCommander I think you are wrong. dd command overwrite existing data with
zero's
– fugitive Jan 08 '17 at 13:29 -
@MilosM Yes, the
dd
approach is fine. But only deleting the partitions with gParted will not overwrite any data. – Byte Commander Jan 08 '17 at 13:34 -
@ByteCommander: thanks for the hint, I wasn't aware of that. Whereas I normally use 1-3 passes with random data to erase my disks. – Thomas Jan 08 '17 at 13:47
-
I might just buy a new drive since this one is so old and I don't trust it. I am not 100% sure how old the drive is but definitely over 5 years. Thank you for the help! I do not have a free usb drive and the CD that I installed ubuntu from was not mine so I don't even have it anymore. – JoVa Jan 08 '17 at 14:43