What is the recommended way to empty a SSD?
- by Lekensteyn
I've just received my new SSD since the old one died. This Intel 320 SSD supports TRIM. For testing purposes, my dealer put malware, err, Windows on it. I want to get rid of it and install Kubuntu on it.
It does not have to be a "secure wipe", I just need the empty the disk in the mosy healthy way. I believe that dd if=/dev/zero of=/dev/sda just fills the blocks with zeroes and thereby taking another write (correct me if I'm wrong).
I've seen the answer How to enable TRIM, but it looks like it's suited for clearing empty blocks, not wiping the disk.
hdparm seems to be the program to do it, but I'm not sure if it clears the disk OR cleans empty blocks. From its manual page:
--trim-sector-ranges
For Solid State Drives (SSDs). EXCEPTIONALLY DANGEROUS. DO NOT
USE THIS OPTION!! Tells the drive firmware to discard unneeded
data sectors, destroying any data that may have been present
within them. This makes those sectors available for immediate
use by the firmware's garbage collection mechanism, to improve
scheduling for wear-leveling of the flash media. This option
expects one or more sector range pairs immediately after the
option: an LBA starting address, a colon, and a sector count,
with no intervening spaces. EXCEPTIONALLY DANGEROUS. DO NOT USE
THIS OPTION!!
E.g. hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz
How can I make all blocks appear as empty using TRIM?