Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

slagell

macrumors newbie
Feb 18, 2011
3
0
Good luck verifying you have SECURELY erased an SSD

You should look at this work being done at UCSD, in particular the USENIX paper.

http://nvsl.ucsd.edu/sanitize/

As a consumer, we don't have a way to verify a vendor's implementation of the ATA sanitizing commands, though most just say they wipe the FTL. If that is the case, then their sanitizing software will not really erase anything (but it will restore performance).

Even the drives that uses encryption may not really be sanitized, because there is no way for most consumers to verify that the way they wipe the key is sufficient.

Single file scrubbing (like Secure Empty Trash or srm on the Mac) leave 67% of the data behind. On almost any OS or any tool, file and free space wiping are almost certainly not going to work well.

If the vendor doesn't implement the ATA sanitizing commands well, then you can do a full disk format twice, and that does wipe most drives clean that use MLCs. SLCs could potentially leave some analog traces behind, but I don't know that there is any tech right now that would help you get at those. Full drive wipes preferably would write random data, as some SSDs use compression. In that case a writing a bunch of 0s doesn't do much. In either case, resetting to all ones with the ATA sanitizing commands afterwards would be good for performance restoration after formatting.

I would REALLY like to see a formal statement form vendors that they have worked with the people at UCSD to understand if they have implemented the sanitizing commands correctly, and I would love to see a tool that could sanitize your drives in a Mac using those low-level commands.

So to answer your question, if you want to be sure, you'll have to physically destroy your drive. Next time, you may want to do whole disk encryption or something like FileVault so that the OS only writes encrypted data to disk. Then you don't have to worry about sanitizing as long as you aren't writing the key in plaintext to the drive ever.
 

VirtualRain

macrumors 603
Original poster
Aug 1, 2008
6,304
118
Vancouver, BC
So to answer your question, if you want to be sure, you'll have to physically destroy your drive. Next time, you may want to do whole disk encryption or something like FileVault so that the OS only writes encrypted data to disk. Then you don't have to worry about sanitizing as long as you aren't writing the key in plaintext to the drive ever.

Who's question? :p

This thread is about restoring performance... not sanitizing your drive. ;) I guess I need to make that more clear in the OP (EDIT: It is pretty clear... 2nd paragraph in post #1 outlines the objective of this procedure)
 

slagell

macrumors newbie
Feb 18, 2011
3
0
I replied to the wrong thread, having too many tabs open. :)

Though, I could still see someone being confused, simply because of the terminology used "secure erase". It isn't really securely erasing, but I understand that is not your term. That is the name of the ATA function, which ironically isn't "Secure" on most SSDs.
 

VirtualRain

macrumors 603
Original poster
Aug 1, 2008
6,304
118
Vancouver, BC
Agreed... it is a poorly named command to be sure. It has led to much confusion in that some people come across the term "secure erase" in association with restoring performance and then incorrectly assume that any kind of security related format, such as overwriting data with "1"s or "0"s will restore their performance. This, of course, is counter-productive to restoring an SSD.

And, as you point out, it's not even an appropriate term if interpreted literally... so it's not doing anyone any good.
 

ghislain

macrumors member
Apr 22, 2009
98
12
pretty useless for SSD under macos X?

I bought a 128 Go Samsung SSD 6 months ago and use it daily since then. When testing read and write speeds with Quick Bench, I still get results which show that performances have not deteriorated over time, i.e. for instance around 190 MB/Sec for maximum sequential read and write (1024 KB). On this basis, it seems to me that macos X manage SSD hard drives in such a way that deterioration of performances is not a serious concern, and this even in the absence of regular TRIM.
 

slagell

macrumors newbie
Feb 18, 2011
3
0
Agreed... it is a poorly named command to be sure. It has led to much confusion in that some people come across the term "secure erase" in association with restoring performance and then incorrectly assume that any kind of security related format, such as overwriting data with "1"s or "0"s will restore their performance. This, of course, is counter-productive to restoring an SSD.

Good article.
http://arstechnica.com/ask-ars/2011...tm_source=rss&utm_medium=rss&utm_campaign=rss
 

RAWIRON

macrumors newbie
May 2, 2011
3
0
#2 Unfreeze your SSD: This is required because the firmware for the on-board SATA connectors "freezes the drive" (to use the ATA nomenclature) making it unable to accept the secure-erase command. There are at at least 3 reported ways to solve this...

Hey, I'm kinda confused - I'm have a G1 80 Gig 1.8 Intel drive that I want to put in the 2009 MBA and a USB dongle for it. The kernel.org manual explicitly states that you shouldn't use USB interface when trying secure erase it using hdutil as you can destroy the SSD. Any comments here?
I'll be trying the lid trick once I manage to boot Ubuntu liveCd on MBA.
 

bearcatrp

macrumors 68000
Sep 24, 2008
1,733
69
Boon Docks USA
has anyone tried reformating the SSD to another format (ie.. fat 32 etc), then back to what they need, provided its not the OS drive? Would be curious if this would work.
 

Isidore

macrumors member
Feb 13, 2004
55
43
London
Agreed... it is a poorly named command to be sure. It has led to much confusion in that some people come across the term "secure erase" in association with restoring performance and then incorrectly assume that any kind of security related format, such as overwriting data with "1"s or "0"s will restore their performance. This, of course, is counter-productive to restoring an SSD.

And, as you point out, it's not even an appropriate term if interpreted literally... so it's not doing anyone any good.

I was originally drawn to this thread because I had BOTH issue to deal with on a 2008 MacBook Air (pata SSD). My 128 Gb drive was almost full and really slow and I was planning ahead for buying my next Air with Thunderbolt and backlit keyboard (I wish!) in the near future. Can't sell the present machine on unless I could securely delete the drive. Following the instructions and starting up in Linux, my first surprise was that there was no sign of the locked drive issue- is that an aspect of it being a Pata drive? The utility went ahead and deleted the contents without any problems and while I forgot to run x-bench before starting, it certainly seems to run a whole lot faster. When I come to sell I can reset the drive fill it with dummy files and reset it again. I know that's not a perfect erase but it's a step in the right direction unless someone has a more complete solution to the secure erase.

To the OP,
Live Long and Prosper!

Regards Isidore
 

VirtualRain

macrumors 603
Original poster
Aug 1, 2008
6,304
118
Vancouver, BC
To the OP,
Live Long and Prosper!

Regards Isidore

Thanks! You too! :)

This should still work on the 320 Series Intel SSDs right?

A quick Google search revealed a few reports of people (including Anand) able to secure erase their 320. However, I'm not sure exactly what method they might have used. I also came across one report where someone could not secure erase their drive.

There's no harm in trying it... give it a shot and report your results back here.

If it turns out not to work on the 320, you can effectively do the same thing using TRIM now.
 
Last edited:

Maclver

macrumors 68030
Nov 23, 2008
2,661
2,036
New Mexico
Thanks! You too! :)



A quick Google search revealed a few reports of people (including Anand) able to secure erase their 320. However, I'm not sure exactly what method they might have used. I also came across one report where someone could not secure erase their drive.

There's no harm in trying it... give it a shot and report your results back here.

If it turns out not to work on the 320, you can effectively do the same thing using TRIM now.

Will do.. I came across some people who said enabling TRIM via the hack.. has messed with their ssds
 

VirtualRain

macrumors 603
Original poster
Aug 1, 2008
6,304
118
Vancouver, BC
Will do.. I came across some people who said enabling TRIM via the hack.. has messed with their ssds

Yeah, I saw that too. If the effects are lasting, then this is probably a preferred method. If you can get away with enabling the hack, trimming the drive, and then removing the hack, you can effectively restore performance with a lot more convenience than this solution entails.
 

Maclver

macrumors 68030
Nov 23, 2008
2,661
2,036
New Mexico
Yeah, I saw that too. If the effects are lasting, then this is probably a preferred method. If you can get away with enabling the hack, trimming the drive, and then removing the hack, you can effectively restore performance with a lot more convenience than this solution entails.

Tested it out today on my 320.. and it worked perfectly.. ran into 0 issues..
 

MJL

macrumors 6502a
Jun 25, 2011
845
1
@VirtualRain:

Cannot get locally a SSD with IDE interface so now I am investigating putting a SATA SSD in my MAC Mini G4. Yes, I know it is IDE but you can get a SATA => IDE adapter that might just fit between the SATA SSD and the IDE socket. (only a few dollars on oBoy/eBait) It does mean that the sub-board with the IDE socket has to be temporarily removed while mounting the HDD/SSD and then it needs to be put back. You'll have to figure out how to support the HDD/SSD (It looks like carefully drilling a few new mounting holes).

While I am waiting for the adapter (and then will try it out with a standard SATA HDD that I have lying around) I am investigating how to maintain performance. (real challenge) At this moment I am leaning towards a SSD with indilinx controller since I've heard about too many failures with the Sandforce. Alternatively I might go for an Intel. Price in our country for this kind of hardware plays a role too.

There is no native TRIM support under earlier versions of OS X and garbage collection looks to be more of a patch than a real solution. I did search for a Live CD for doing a secure erase and although there are enough choices for an Intel based machine I found only one for a PPC: Finnix which is a Live CD especially tailored for the system administrator. It does have commands like hdparm. There is a version for both Intel and PPC was recently included again. http://www.finnix.org

There is a Wiki write up on secure erase too: https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase

edit: additonal link on secure erase under Unix/Linux: http://forums.extremeoverclocking.com/showthread.php?p=3887917

Hope this is usefull.
 
Last edited:

brylant

macrumors newbie
Jul 22, 2011
3
0
help needed (fixed!)

Hi,

I'm trying to follow the instructions but I run into a problem I can't really figure out. I have 2011 iMac, I installed intel 510 ssd and trying to do secure erase (in order to install/reinstall lion). Here's what I do:
1. boot ubuntu (11.04, x86). booting from live CD.
2. run: hdparm -I /dev/sdb. Here's what I get:
Security:
Code:
Security: 
       Master password revision code = 65534
               supported
       not     enabled
       not     locked
               frozen
       not     expired: security count
               supported: enhanced erase
       2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.
3. put iMac to sleep and run hdparm again:
Code:
Security: 
       Master password revision code = 65534
               supported
       not     enabled
       not     locked
       not     frozen
       not     expired: security count
               supported: enhanced erase
       2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.

And this is where the problems begin...
4.
Code:
hdparm --user-master u --security-set-pass passwd /dev/sdb

/dev/sdb:
Issuing SECURITY_SET_PASS command, password="passwd", user=user, mode=high
SECURITY_SET_PASS: input/output error

I tried --user-master m, secure erase with NULL password etc... Nothin works. I _always_ get input/output error regardles of the command...
I'm using latest hdparm (9.37 compiled from sources)
Any idea what is wrong? I don't really want to tear the iMac apart again to disconnect the drive...

Thanks,

EDIT:
OK. After fighting the problem for almost 2 days I decided to try ubuntu 10.04 LTS. And guess what... It worked perfectly!
Although I did not get this output (in red):
Code:
Issuing SECURITY_ERASE command, password="passwd", user=user
[COLOR="Red"]0.000u 0.000s 0:39.71 0.0%      0+0k 0+0io 0pf+0w[/COLOR]

I only got this:

Code:
Issuing SECURITY_ERASE command, password="passwd", user=user
but it took about 20-25 seconds to complete the erase command and I did not get any errors (plus hdparm -I showed not locked again) - I'm assuming it worked!
 
Last edited:

shiny-blanket

macrumors member
Sep 21, 2007
93
0
No matter what point I try to plug in my OCZ Vertex 2 into internal SATA (09' MacBook Pro) the computer shuts off. Any ideas?

Edit: Ok Ubuntu 10.04 LTS it was. I had to sudo the commands but I think it worked, although I got the same input/output error?

Output on the security erase:
Command exited with non-zero status 5
0.00user 000system 0:001elapsed 21%CPU (0avgtext+0avgdata 2112maxresident)k
0inputs+0outputs (0major+178minor)pagefaults 0swaps
 
Last edited:

shiny-blanket

macrumors member
Sep 21, 2007
93
0
Perhaps worth noting that after the erase the, drive remained unlocked unbeknown to me. After rebooting the SSD wasn't visible to anything—uh-oh, I thought I had crapped the drive.

A few things to note about how I finally made the process work:

Gparted failed, on the options screen hit tab and add space 'nouveau.noaccel=1 blacklist=vga16fb'
I had to prefix sudo to all commands: $ sudo hdparm -I /dev/sda
I had to unlocked my drive using $ sudo hdparm --user-master m --security-unlock PASSWORD /dev/sda
If you get stuck, the help menu is invaluable $ hpdram (enter)
 
Last edited:

hehe299792458

macrumors 6502a
Dec 13, 2008
772
3
I have a Macbook Air (no optical drive, and I can't remove the SSD itself). Is there any way I could still restore the performance of its SSD? It's a 2009 model so it doesn't support TRIM either.
 

HHarm

macrumors regular
Mar 4, 2009
138
2
This is pretty frustrating. After spending half a day not being able to do a security erase I hope somebody can help...

  • I want to secure erase a X25-M G2 (and after that 2 x G1)
  • I bough an USB enclosure for it. The SSD works in it in OSX and Win7
  • I burned the Linux boot cd linked in the first message of this thread. I can boot to it and the SSD is visible as /dev/sda
  • The wiki from the OP is offline so I had to find an instruction here and a instruction there to know what to do. (I don't know Linux)
  • With "hdparm -I /dev/sda" I get an error "HDIO_DRIVE_CMD(identify) failed: Bad address"
  • With "sudo hdparm --user-master u --security-unlock p /dev/sda" I get "Issuing SECURITY_SET_PASS command, password "p", user=user, mode=high The current kernel lacks CONFIG_IDE_TASK_IOCTL support for this device. SECURITY_SET_PASS: Invalid argument
  • I've also tried using Intel's Solid-State Drive Toolbox but with the USB enclosure the drive isn't recognised and with SATA secure erase isn't available
  • I also downloaded a bootable ISO with HDDErase 3.3 but didn't have success in getting it to USB stick in OSX

What is wrong or what am I doing wrong? This really isn't my terraint so help is greatly appreciated! :eek:
 

HHarm

macrumors regular
Mar 4, 2009
138
2
Got it done and with suprising ease.

With Intel'ss Solid-State Drive Toolbox I unplugged and then replugged the SSDs (inside the MP in SATA) when Win7 was running. That allowed the application to run the secure erase.

Raid0 boot drive with three "brand new" SSDs here I come!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.