Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
up vote 5 down vote accepted

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.

share|improve this answer
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
@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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.