# FreeBSD 10 Trim for ZFS



## meteor8488 (Feb 9, 2014)

Hi All,

I just upgraded my server from FB9 FreeBSD 9 to FB10 FreeBSD 10.0, it seems now FB FreeBSD supports ZFS trim.  It seems trim is not enabled on my SSD (mirror zfs).

```
#sysctl vfs.zfs.trim
vfs.zfs.trim.enabled: 1
vfs.zfs.trim.txg_delay: 32
vfs.zfs.trim.timeout: 30
```


```
# sysctl -d kstat.zfs.misc.zio_trim
kstat.zfs.misc.zio_trim:
kstat.zfs.misc.zio_trim.bytes: Number of bytes successfully TRIMmed
kstat.zfs.misc.zio_trim.success: Number of successful TRIM requests
kstat.zfs.misc.zio_trim.unsupported: Number of TRIM requests that failed because TRIM is not supported
kstat.zfs.misc.zio_trim.failed: Number of TRIM requests that failed for reasons other than not supported
```


```
# sysctl -a |grep _trim
kstat.zfs.misc.zio_trim.bytes: 0
kstat.zfs.misc.zio_trim.success: 0
kstat.zfs.misc.zio_trim.unsupported: 1699
kstat.zfs.misc.zio_trim.failed: 0
```

How can I enable trim?  And how can I force server to start trim manually?


----------



## worldi (Feb 9, 2014)

TRIM is enabled by default.

Maybe your controller does not support it (see `camcontrol identify your_ssd_devicename_here | grep TRIM`).


----------



## SirDice (Feb 9, 2014)

It's also possible your SSD doesn't support TRIM. Not all of them do.


----------

