2

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!

Andy B
  • 105
  • 2
  • 8

1 Answers1

6

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.

the-wabbit
  • 40,319
  • 13
  • 105
  • 169
  • Thank you. I've used the tutorial and it yielded good resuts. The read speed increased 2.5 times and the write speed across the md-raid array increased from a pitiful 5-13MB/s to 130-140MB/s. What I'd like to note is that the drive was frozen. So after removing the raid partitions from the array (mdadm --fail and --remove), I had the SSD cage pulled out for 10 seconds from the bay. This was enough to unfreeze it. – Andy B Oct 23 '13 at 20:49
  • 1
    @AndyB the drive is "frozen" by the BIOS or the OS bootup to prevent an inadvertent "secure erase" or password set operation - this is a standard setting after ransomware locking up users' disks has been sighted in the wild a couple of years ago. – the-wabbit Oct 24 '13 at 10:34