Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    2.2.4 and how I enabled TRIM

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    59 Posts 31 Posters 33.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      Ramosel
      last edited by

      @ThePOO:

      –----  I was pretty frustrated getting TRIM enabled in 2.2.4
      ------  This is what worked for me to get the trim status set to enabled for my SSD.
      3.  booted pfSense from USB stick into single-user mode

      I had my first SSD failure (3 years old) and was pretty frustrated getting TRIM set too.  I thought I had remembered something in the build up to 2.2 propaganda that this feature was going to be a tick box so I looked all over and couldn't find it…  tried the old ways, didn't work...  your booting into single-user mode was the trick.

      thanks,
      Rick

      1 Reply Last reply Reply Quote 0
      • F
        foresthus
        last edited by

        When will fstrim be a part of pfsense (not as a addon)?

        1 Reply Last reply Reply Quote 0
        • M
          MikeDPitt
          last edited by

          I second the notion that it would indeed be a great idea to add this option in the installer as a tick box. I also had issues getting it enabled a few versions back, and the single user mode worked. I also had a question regarding pfsense's software RAID mirroring and TRIM. Is it possible on two supported SSD's and how would it be accomplished?

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            It's STILL not there even in 2.3?! There was something even available at certain time to avoid similar absurd hacking around, then it got removed with a commit message "we'll figure out something better" so it went MIA in 2.2.x and and nothing ever came back.

            Seriously absurd.

            1 Reply Last reply Reply Quote 0
            • ?
              Guest
              last edited by

              indeed be a great idea to add this option in the installer as a tick box.

              and

              I also had issues getting it enabled a few versions back, and the single user mode worked

              Would be the problem as I see it right.

              message "we'll figure out something better" so it went MIA in 2.2.x and nothing ever came back.

              At this time I really think it might be the best to be able to activate it manual by the admin is much better then
              all other things, because from where the developer would be able to know if this or another SSD is really
              capable of TRIM support? Many peoples are often here in the forum are asking for a so called "cheap build"
              and then many of them tend also to take a cheap SSD or mSATA to go with and don´t really know anything
              about the TRIM support of this devices. And if there will be an automatic enabled TRIM support and a device
              will be down or failing all peoples will complain to the developer team about this service, so if you know what
              kind of SSD or mSATA you are running you could be activating it on the manual way better then the automatic
              way, that will be often beloved to have and called for.

              1 Reply Last reply Reply Quote 0
              • M
                MikeDPitt
                last edited by

                Do you happen to know if (on two SSD's that supported TRIM of course) a softraid mirror that the newer version offers during install, is also possible with TRIM enabled on both drives?

                1 Reply Last reply Reply Quote 0
                • M
                  markn62
                  last edited by

                  I've been looking for answers to this for a while now. I thought I had it right that each of the SSD drives have to be partitioned, formatted and offset before the PF sense install/config. Then trim would be set post-install presuming its Raid-1 compatible. But after reading this post about a softraid miror, i'm not so sure.

                  Re: https://forum.pfsense.org/index.php?topic=99424.msg556454

                  1 Reply Last reply Reply Quote 0
                  • M
                    MikeDPitt
                    last edited by

                    For my purposes, and as is mentioned by Jimp in that threat you're quoting, a new softraid array, and a simple config backup and restore would be the much more supported and easier way to go. I would think trying hardware raid would much more challenging. If pfsense supports a mirrored softraid option and auto handles all the partitioning / drive formatting on it's own, why mess with a controller? It's also got email alerts for array status baked in already. I imagine some people have certain use cases where hardware RAID would somehow be better but for my purposes I can't think of one. Adding a controller card still creates a single point of failure, just like softraid and a motherboard failure is a single point of failure. It's not like there's a ton of data on pfsense installations and data loss is more important than uptime right? but can TRIM be enabled on pfsense's OWN softraid mirroring is the answer am I after. I imagine setting trim for something with a controller would be an entirely different story altogether.

                    What I'm saying is, all of those things you're mentioning doing prior to a pfsense softraid install, don't need to be done. It's done during install now if it detects two (or more I would guess)  identical disks and does a softraid mirror for you. Can TRIM be added to these drives after "the easy way" of doing softraid with pfsense?

                    1 Reply Last reply Reply Quote 0
                    • M
                      markn62
                      last edited by

                      I'm not hung up on needing a hardware raid solution. And just to be clear I'm NOT intending to image my SSD to a pair of SSD's as an upgrade path. I just want to know what works in a holistic manner. I know SSDs need to be offset. I know raid and trim need to be compatible. But need a stepped process to upgrade from one SSD to a raided pair of SSD's while retaining an offset & trim like my current single drive full install has. Has nobody successfully accomplished this yet? Maybe I'll have to poney up for another box that's non-production I can tinker with.

                      1 Reply Last reply Reply Quote 0
                      • M
                        MikeDPitt
                        last edited by

                        I think we're saying the same thing. Although I don't quite get the offset bit. This is something that pfsense does not do by default when installed on an SSD  normally? I'm looking to do the exact same thing you are. Migrate form a single SSD to a mirrored RAID SSD, and have TRIM enabled. I have TRIM enabled on the one I use now, but I never did anything outside of that, or out of the usual pfsense install sequence. Am I missing something?

                        1 Reply Last reply Reply Quote 0
                        • M
                          markn62
                          last edited by

                          I think so, we're after the same. According to Jimp on my reference post he said two months ago,  "There is no special code in the installer to handle any sort of alignment/offset at this time". WinXp doesnt but Win8 does offset when an SSD is detected. Presume FreeBsd doesn't by default. SSD performance can be substantially reduced if its partition is not properly offset. So I figure I have to partition, format & offset the new SSD pair with partition magic or other self-booting drive utility cd then install PfSense.

                          1 Reply Last reply Reply Quote 0
                          • M
                            MikeDPitt
                            last edited by

                            It would surprise me that so many users of things like FreeNAS would have a storage based OS designed around something that didn't handle drive partitioning for almost any drive properly by default. Very interested in the response from someone from pfsense on this. So I guess my questions have expanded now to :  :D

                            1. Does pfsense not using this mentioned type of partition offset actually adversely affect SSD life? how much? As much as something like not enabling TRIM?
                            (I see a few people randomly asking about this in the forums, but never heard it was some type of precaution needed when using pfsense (BSD) with an SSD, then again, I'm not super familiar with BSD outside of pfsense)

                            2. Is doing a softraid mirror with SSD's in pfsense and TRIM a viable option?

                            1 Reply Last reply Reply Quote 0
                            • D
                              DownloadDeviant
                              last edited by

                              @ThePOO:

                              –----  I was pretty frustrated getting TRIM enabled in 2.2.4

                              ------  This is what worked for me to get the trim status set to enabled for my SSD.

                              1.  booted pfSense from USB stick and installed pfSense to SSD

                              2.  booted pfSense from SSD and watched my console -- made note of ...
                                  "Trying to mount root from /dev/ufsid/55bdd213616a70a3"

                              3.  booted pfSense from USB stick into single-user mode

                              4.  at the # prompt, the following was issued:
                                  /sbin/tunefs -t enable /dev/ufsid/55bdd213616a70a3
                                  /sbin/reboot

                              5.  booted pfSense from SSD.  ran Shell from the console -- verified TRIM status with:
                                  /sbin/tunefs -p /

                              ------  I hope this works for everyone!

                              I'm running a fresh install of 2.2.5 on a TRIM capable SSD. My system details are in my sig.

                              I just performed a clean install too and used the auto restore method to bring my config.xml file settings back. Didn't have to do this but since I have holiday time off I had some time to experiment, wanted to learn something new, and thought maybe after so many upgrades some 'dirt' might have been left behind. I can't get TRIM to work at all. Granted, I don't know anything when it comes to CLI in pfSense. I checked, and TRIM is not enabled.

                              I login in under single user mode, I tried just the basic commands
                              /sbin/tunefs -t enable / (this errors and I get "cannot execute, no such file/directory")
                              /sbin/reboot (this doesn't work at all but just typing EXIT does)

                              I took note of TRYING TO MOUNT details using DMESG under command prompt in WEBGUI.
                              So I tried
                              /sbin/tunefs -t enable /dev/ufsid/56534606bb206e02
                              and again NO SUCH FILE/DIRECTORY error message.

                              At this point I am stumped.

                              Anyone have any advice? This is really more about me learning and understanding this TRIM problem than it is turning it on…so please help me learn when providing the solution with some explanation. Thanks in advance!

                              PS - to the pfSense developers...2.3...Bootstrap....WOW!!!!!!!!!!!!!!!! Those screenshots are just amazing! I can't wait!

                              System: pfSense 2.4.3p1 - ZFS CPU: AMD Athlon 5350 (Kabini) MOBO: ASRock AM1H-ITX HD: 60GB SSD Patriot Inferno RAM: G.SKILL 8GB DDR3 2133 NIC: Intel I350-T2 PS: Lite-On 75W AC PACKAGES: Cron, NUT

                              1 Reply Last reply Reply Quote 0
                              • J
                                jusjay
                                last edited by

                                This worked for me in 2.2.5. Thank you kindly for sharing this ThePOO!

                                1 Reply Last reply Reply Quote 0
                                • P
                                  pLu
                                  last edited by

                                  @DownloadDeviant:

                                  I login in under single user mode, I tried just the basic commands
                                  /sbin/tunefs -t enable / (this errors and I get "cannot execute, no such file/directory")
                                  /sbin/reboot (this doesn't work at all but just typing EXIT does)

                                  I took note of TRYING TO MOUNT details using DMESG under command prompt in WEBGUI.
                                  So I tried
                                  /sbin/tunefs -t enable /dev/ufsid/56534606bb206e02
                                  and again NO SUCH FILE/DIRECTORY error message.

                                  At this point I am stumped.

                                  Your problem is, for some reason, running the commands. tunefs is not even trying to access /dev/ufsid/56534606bb206e02 since it failed to run.

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    DownloadDeviant
                                    last edited by

                                    @pLu:

                                    Your problem is, for some reason, running the commands. tunefs is not even trying to access /dev/ufsid/56534606bb206e02 since it failed to run.

                                    OK, so it's not me or my syntax but something else?

                                    Because I am clueless when it comes to BSD/pfSense CLI so I wouldn't doubt I am to blame. Something I plan on exploring after the holidays to learn more…but I also have that freakin' pesky problem of a job getting in the way and consuming all of my time too. lol

                                    System: pfSense 2.4.3p1 - ZFS CPU: AMD Athlon 5350 (Kabini) MOBO: ASRock AM1H-ITX HD: 60GB SSD Patriot Inferno RAM: G.SKILL 8GB DDR3 2133 NIC: Intel I350-T2 PS: Lite-On 75W AC PACKAGES: Cron, NUT

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      dancwilliams
                                      last edited by

                                      @ThePOO:

                                      –----  I was pretty frustrated getting TRIM enabled in 2.2.4

                                      ------  This is what worked for me to get the trim status set to enabled for my SSD.

                                      1.  booted pfSense from USB stick and installed pfSense to SSD

                                      2.  booted pfSense from SSD and watched my console -- made note of ...
                                          "Trying to mount root from /dev/ufsid/55bdd213616a70a3"

                                      3.  booted pfSense from USB stick into single-user mode

                                      4.  at the # prompt, the following was issued:
                                          /sbin/tunefs -t enable /dev/ufsid/55bdd213616a70a3
                                          /sbin/reboot

                                      5.  booted pfSense from SSD.  ran Shell from the console -- verified TRIM status with:
                                          /sbin/tunefs -p /

                                      ------  I hope this works for everyone!

                                      This method worked great for me!  I had an existing install that did not have TRIM working as it should.  We jsut booted to the USB and set the TRIM using the method above.  Removed the USB and it booted to the existing config and worked great.

                                      Thanks,

                                      Dan

                                      1 Reply Last reply Reply Quote 0
                                      • D
                                        DownloadDeviant
                                        last edited by

                                        @dancwilliams:

                                        This method worked great for me!  I had an existing install that did not have TRIM working as it should.  We jsut booted to the USB and set the TRIM using the method above.  Removed the USB and it booted to the existing config and worked great.

                                        Thanks,

                                        Dan

                                        Hmmmm, I guess booting from a USB stick is necessary. I did a fresh install and figured USB booting wasn't necessary…just what the OP did.

                                        I'll try that specifically tonight or tomorrow and see what happens.

                                        UPDATE -
                                        OK. That was the problem. I had to boot from the USB stick, then run the commands with my specific UFS ID (do I have that right? lol) included.

                                        I can't believe getting TRIM to run is that much of a fuss!? lol I am not complaining. I just have to imagine there could be a simpler method added via GUI or CLI without having to do the whole USB boot thing. Ughh. lol

                                        System: pfSense 2.4.3p1 - ZFS CPU: AMD Athlon 5350 (Kabini) MOBO: ASRock AM1H-ITX HD: 60GB SSD Patriot Inferno RAM: G.SKILL 8GB DDR3 2133 NIC: Intel I350-T2 PS: Lite-On 75W AC PACKAGES: Cron, NUT

                                        1 Reply Last reply Reply Quote 0
                                        • CNLiberalC
                                          CNLiberal
                                          last edited by

                                          I just performed a new install last night.  I backed up my config from the 2.2.1 install, pulled the spinning HDD and put in dual 256GB Samsung SSDs.  I chose to install the full version of pfSense 2.2.5 for i386 as I only have 2GB of RAM in the system.  During the install, I chose to do a GEOM mirror (soft RAID?).  The installer partitioned everything and formatted and I accepted the defaults.  The system is now reporting a single ~230GB "drive".  I checked on TRIM, and it's not enabled:

                                          
                                          [2.2.5-RELEASE][root@pfsense.yadda.localdomain]/root: /sbin/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
                                          [b]tunefs: trim: (-t)                                         disabled[/b]
                                          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)                                 
                                          [2.2.5-RELEASE][root@pfsense.yadda.localdomain]/root: 
                                          
                                          

                                          I'm not following the above conversation very well.  I'd like to enable TRIM, but it sounds like I can't because I'm using the GEOM mirror?  I don't want to lose SSD performance or cause them to die prematurely.  Should I try enabling TRIM with the method mentioned earlier?  Thanks!

                                          pfSense 2.7.2-RELEASE

                                          Dell R210 II
                                          Intel E3-1340 v2
                                          8GB RAM
                                          SSD ZFS Mirror
                                          Intel X520-DA2, RJ45 SFP+ (WAN) and 10Gb SFP+ DAC (LAN)
                                          1 x Cisco 3850 12XS-S (Core Switch)
                                          2 x Cisco 3750X PoE Gig Switch (Access Stack)
                                          3 x Cisco 2802i APs (Mobility Express)

                                          1 Reply Last reply Reply Quote 0
                                          • W
                                            wirerogue
                                            last edited by

                                            @ThePOO:

                                            –----  I was pretty frustrated getting TRIM enabled in 2.2.4

                                            ------  This is what worked for me to get the trim status set to enabled for my SSD.

                                            1.  booted pfSense from USB stick and installed pfSense to SSD

                                            2.  booted pfSense from SSD and watched my console -- made note of ...
                                                "Trying to mount root from /dev/ufsid/55bdd213616a70a3"

                                            3.  booted pfSense from USB stick into single-user mode

                                            4.  at the # prompt, the following was issued:
                                                /sbin/tunefs -t enable /dev/ufsid/55bdd213616a70a3
                                                /sbin/reboot

                                            5.  booted pfSense from SSD.  ran Shell from the console -- verified TRIM status with:
                                                /sbin/tunefs -p /

                                            ------  I hope this works for everyone!

                                            hooray! supernoob (me) with fresh build got trim enabled. :) now, if i could just get everybody off plex, i could plug this thing in and see how she works. maybe tomorrow. :(

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.