Request to add to documentation wiki how to check and enable TRIM support



  • I was trying to figure out how to determine if TRIM is enabled and then how to enable it, and a lot of searching finally yielded this forum post:

    @nicholfd:

    Connect the console cable.

    At power on, make sure you are watching the boot.  Eventually you will get an option to boot to single user mode (screen shot attached).  Select option 2 and press enter.

    Eventually you will be asked to select a shell or press enter (IIRC).  Press enter and you will be at a command prompt.  Enter the following:

    /sbin/tunefs -t enable /
    /sbin/shutdown -r now
    

    After the reboot login and confirm TRIM is enabled:

    [2.3.1-RELEASE][admin@burns.springfield.com]/root: tunefs -p /
    tunefs: POSIX.1e ACLs: (-a)                                disabled
    tunefs: NFSv4 ACLs: (-N)                                   disabled
    tunefs: MAC multilabel: (-l)                               disabled
    tunefs: soft updates: (-n)                                 enabled
    tunefs: soft update journaling: (-j)                       enabled
    tunefs: gjournal: (-J)                                     disabled
    tunefs: trim: (-t)                                         enabled
    tunefs: maximum blocks per file in a cylinder group: (-e)  4096
    tunefs: average file size: (-f)                            16384
    tunefs: average number of files in a directory: (-s)       64
    tunefs: minimum percentage of free space: (-m)             8%
    tunefs: space to hold for metadata blocks: (-k)            6408
    tunefs: optimization preference: (-o)                      time
    tunefs: volume label: (-L)                                 
    
    

    It would be nice if this procedure were listed in the wiki some place.

    Note that checking the status of TRIM can be run from GUI command line by executing:

    tunefs -p /
    


  • Bumping to second the OP's request.


  • LAYER 8 Global Moderator

    "It would be nice if this procedure were listed in the wiki some place."

    Well request a wiki account and add it then ;)

    https://www.pfsense.org/get-involved/
    We can always use help with creating documentation and correcting existing material. If you would like to assist, please email wikiadmin@pfsense.org for an account on our documentation wiki.


  • Rebel Alliance Developer Netgate

    There are far too many variables, hardware support and so on, for an article to be viable. We've seen some disks violently disagree with TRIM so we won't advocate enabling it officially unless it's hardware we have 100% confirmed it will work for.



  • Does that include SSDs where the manufacturer states the drive supports TRIM? SanDisk, for example, states that all of their SSDs support TRIM. I picked up what was pretty much their cheapest drive when I bought it and haven't had even one issue with TRIM being enabled.

    An article stating how to do enable it and includes problems associated with enabling plus a list of verified drives would be yet more valuable than even what I requested above.


  • Rebel Alliance Developer Netgate

    There was one SSD which shall remain nameless, when TRIM was enabled it suffered complete filesystem failures 100% every time.

    We aren't going to keep track of other vendor's hardware with any risk like that. If someone wants to track down the info, fine, but the moment we put something like that up and someone loses data it'll be on us. If someone wants to put together some info in a post, perhaps a sticky would be OK, but not on the wiki.


Log in to reply