How to erase a SSD to restore factory performance in Linux?
Due to big performance issues with an mdraid-1 array I'd like to pull down from the array one of the devices (Samsung 840 Pro), erase it to restore factory performance and re-add it to the array. The reason I want to do this to one of the SSDs is because the poor performance seems to be related to one specific SSD out of the two (although they are the same brand, model and firmware ver).
But how do I erase a SSD from Linux?
I mention that hdparm indicates that both drives are frozen at this time. Maybe because they are part of an md array?
Thanks in advance!
Solution 1:
You would need to perform a secure erase of the disk's contents - this would signal the controller that it can reclaim all blocks as wear-leveling candidates.
hdparm
has the --security-erase
parameter to do exactly this, but the operation has some pre-requisites:
- you would need to make sure your drive is not in a "frozen" state (which it is placed into by default to deter data-destructive manipulation)
- you would need to set a password for the drive and re-supply it with the
--security-erase
command
The referenced article from the Kernel wiki will guide you through the necessary steps.
You also might consider issuing a TRIM command for all sectors instead. Again, hdparm
offers support for it using the --trim-sector-ranges
parameter.