LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   SSD reset, TRIM? (https://www.linuxquestions.org/questions/linux-hardware-18/ssd-reset-trim-4175446390/)

malloc 01-19-2013 04:32 PM

SSD reset, TRIM?
 
I want to reinstall Linux on my SSD. How do I reset the SSD such that the SSD controller is informed that every block is now indeed free?

Can I do this with hdparm's --trim-sector-ranges? If so, what arguments should I give that command?

I don't fully understand the example in the manpage:

hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz

With the syntax [LBA]:[sector count]

Can I simply do hdparm --trim-sector-ranges 0:[number of sectors in total] [device]?

How can I confirm that the the SSD has indeed been reset?

TobiSGD 01-19-2013 04:40 PM

If you want to reset your SSD you can use its Secure Erase feature, it will do what you want to achieve:
Code:

sudo hdparm --security-erase NULL /dev/sda

malloc 01-19-2013 05:03 PM

Quote:

Originally Posted by TobiSGD (Post 4873733)
If you want to reset your SSD you can use its Secure Erase feature, it will do what you want to achieve:
Code:

sudo hdparm --security-erase NULL /dev/sda

Thanks, are you sure this is correct though? There is no mention in the manual that --security-erase actually uses TRIM or that it in any other way tells the controller this data has been deleted using TRIM. Simply deleting the contents of the device, e.g. sending it arbitrary data to fill every byte, will not erase anything as far as the SSD controller is concerned.

Also, I'm still wondering how it can be verified that the device has been reset.

TobiSGD 01-19-2013 06:13 PM

Secure Erase will tell the controller to dump all contents of the disk and mark the blocks as unused. It will not zero out the device or copy any data to it.
http://en.wikipedia.org/wiki/Write_a...n#Secure_erase


All times are GMT -5. The time now is 04:27 AM.