Enable TRIM on FreeBSD 9 Install

2

I recently upgraded all of the parts in my FreeBSD 9 server.

I purchased an SSD to run as a the root drive - I'd like to enable TRIM on it but the only documentation I can find on it is that it can be enabled using newfs or tunefs.

Is there a way to specify flags to newfs during the installation process, and if not, am I going to run into TRIM-related issues if I run tunefs after installation is complete?

javanix

Posted 2012-05-03T14:32:31.450

Reputation: 609

Answers

2

For UFS2 file systems, on FreeBSD 8.2+ you can use the tunefs utility to enable trim after installation or by going into a shell before rebooting during the installer.

Make sure the file system is not mounted read/write (such as in single user mode)

  • Single user mode
  • mount
  • tunefs -t enable /dev/ada0p2

Replace ada0p2 with your disk.

If you're using ZFS, older versions of FreeBSD do not support TRIM. There was some work to add trim support into newer versions of FreeBSD (10+?) , but it would be enabled through the ZFS commands rather than tunefs.

Lucas Holt

Posted 2012-05-03T14:32:31.450

Reputation: 201