# Securely erasing old SSD - Ubuntu



## Dia01 (Feb 26, 2018)

Very inexperienced with Linux and have been playing around lately with Ubuntu 17.10 successfully recovering data from a bad HDD, quite impressed by it also.  

First question is.  I have an old OCZ Vertex 3 120GB that has been lying around forever and want to wipe it to factory settings and install Ubuntu on it (so I don't need to run Windows side by side on my current OS drive).  I'm assuming the easiest way to do this is to do the following?

Boot Ubuntu from USB installer
Select 'Try Ubuntu before you install it'
Open the Terminal and 
Use the Command-line to Simple Secure Erase i.e. hdparm --security-erase PASS /dev/sdX
My second question is, if the above will work do I then need to format the entire SSD in ext4 or does the installer by default format/partition the SSD when 'Erase disk and install Ubuntu' is selected?


----------



## Aquinus (Feb 26, 2018)

The installer will automatically partition the disk. It will probably make a swap partition the size of physical memory then use the rest of the space for "/" with ext4. That's what it does out of the box, more or less iirc. If you want something else, you need to tell it or you need to configure it before or afterwards (if it's not your boot device.) This formats the drive but, it does not zero it out beforehand. For someone booting from a software RAID, this will usually be customized to first mount "/boot" from a non-RAID device to load the kernel and driver into memory before mounting "/", stuff like that but, that's not important in most cases.


----------



## Dia01 (Feb 26, 2018)

Thanks for the response.  Good to go then


----------



## Jetster (Feb 26, 2018)

To secure erase an SSD you need to use the manufactures utility
https://support.ocz.com/customer/en...i-secure-erase-my-sata-ssd-using-ssd-utility-

Although installing Linux will erase the part it is installed to


----------



## Aquinus (Feb 26, 2018)

Jetster said:


> To secure erase an SSD you need to use the manufactures utility


To secure erase just about anything in Linux by doing something like "sudo dd bs=1M if=/dev/zero of=/dev/sdX" where X is the number of the block device for your drive.


----------



## renegat (Feb 26, 2018)

'Secure erase' in case of a SSD should never be done by zeroing! 
Do not use ubuntu installer 'secure erase' or 'dd' on a SSD.
This is a tourture for the flash cells and massivly shortens life of the device. 
One way is to use the provided tool of the manufacturer - which in most cases only works with windows.
The other way is to use hdparm under linux. 
Secure Erase aka "memory cell clearing" of a SSD is done by just deleting the internal encyption key and gererating an new one so the formerly data cannot be read anymore. This is not done by the ubuntu installer!


----------



## qubit (Feb 26, 2018)

SSDs work completely differently to HDDs, so all you need to do to securely erase them is a full format, ie writes to every sector.


----------



## Dia01 (Feb 26, 2018)

All good, well took some trial and error.  SSD was reported frozen, unlocked by enabling hot plugging, secure erased SSD then used gparted, installed Ubuntu 17.10 without any issues.  Thanks guys.


----------

