TRIM considerations when repartitioning a SSD

Mike Clarke jmc-freebsd2 at milibyte.co.uk
Mon Sep 8 14:08:53 UTC 2014


On Thursday 28 Aug 2014 17:24:04 Adam Vande More wrote:
> On Thu, Aug 28, 2014 at 4:54 PM, Mike Clarke
> <jmc-freebsd2 at milibyte.co.uk>
> wrote:
> > FreeBSD 9.3-RELEASE
> > 
> > I may soon need to repartition a SSD which has a zpool on it and
> > was wondering what is the best method of ensuring that all blocks
> > get marked as no longer in use.
> > 
> > Is gpart sufficiently TRIM aware to be able to just use gpart
> > delete?
> Extremely doubtful that it is.  You generally must reset the drive
> eg
> 
> camcontrol security da4 -s buhbyesweetdata -e buhbyesweetdata

I've tried this but it failed

curlew:/root# uname -a
FreeBSD curlew.lan 9.3-RELEASE FreeBSD 9.3-RELEASE #0 r268512: Thu Jul 
10 23:44:39 UTC 2014     
root at snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

curlew:/root# camcontrol security ada0 -s buhbyesweetdata -e 
buhbyesweetdata
pass1: <SanDisk SD6SB2M128G1022I X210400> ATA-8 SATA 3.x device
pass1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 512bytes)

You are about to ERASE ALL DATA from the following device:
pass1,ada0: <SanDisk SD6SB2M128G1022I X210400> ATA-8 SATA 3.x device

Are you SURE you want to ERASE ALL DATA? (yes/no) yes
Issuing SECURITY_SET_PASSWORD password='buhbyesweetdata', 
user='master', mode='high'
Issuing SECURITY_ERASE_PREPARE
Issuing SECURITY_ERASE_UNIT password='buhbyesweetdata', user='master'
ata2: timeout waiting for write DRQ
ata2: timeout waiting for write DRQ
camcontrol: ATA SECURITY_ERASE_UNIT failed: 0

How do I get round this?

-- 
Mike Clarke


More information about the freebsd-questions mailing list