# SECURE_ERASE support for conditioning SSD drives?



## xxxIRONxxxLIONxxxZIONxxx (Sep 20, 2012)

Hello Guys,
I would like to use the the native ATA SECURE_ERASE function to wipe my SSD drives and restore their performance.
My current platform is FreeBSD 9.0 and I have discovered a couple of patches for the secure erase function, but they appear to be out of date. 

The first one was a perfect implimentation for atacontrol (http://www.roe.ch/ATA_Security).   It was submitted but rejected with the explanation there will be no more development on atacontrol as camcontrol will be the common access interface (yay!!).


```
BSD9# atacontrol
atacontrol: 
ATA_CAM option is enabled in kernel.
Please use camcontrol instead.
```
The latest effort that I was able to find was somewhat of a port of the atacontrol patch effort to a camcontrol patch for FreeBSD 8.2 (http://blog.multiplay.co.uk/2011/08/freebsd-security-support-for-ata-devices-via-camcontrol/).     This was almost perfect, but I am running v9.0.

I'm very much of a newb when it comes down to compiling or making patches, so I have two questions for this thread:
   1)   Is there a way to use ATA SECURE_ERASE under FreeBSD v9.0?
   2)   Can I apply a patch written for FreeBSD v8.2 camcontrol to v9.0?

I tried to apply the patch but I did not get a return status:

```
BSD9# ls -l
total 276
-rw-r--r--  1 root  wheel     389 Jan  2  2012 Makefile
-rw-------  1 root  wheel   38079 Sep 20 09:58 ata_security_cam.patch
-rw-r--r--  1 root  wheel   33742 Jan  2  2012 camcontrol.8
-rw-r--r--  1 root  wheel  162331 Jan  2  2012 camcontrol.c
-rw-r--r--  1 root  wheel    2486 Jan  2  2012 camcontrol.h
-rw-r--r--  1 root  wheel   25571 Jan  2  2012 modeedit.c
-rw-r--r--  1 root  wheel    3901 Jan  2  2012 util.c
BSD9# patch ata_security_cam.patch
```

FYI - I did not modify the 8.2 patch.
Any help would be greatly appreciated.


----------



## Nukama (Sep 26, 2012)

For further reference, are you using the second patch of PR bin/159833?

Have you redirected ata_security_cam.patch to patch()? `# patch [b]<[/b] ata_security_cam.patch`


----------

