Navigation

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

    2.2.4 and how I enabled TRIM

    Installation and Upgrades
    31
    59
    23199
    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.
    • 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

        1 Reply Last reply Reply Quote 0
        • CNLiberal
          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!

          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
            • 2
              2chemlud Banned last edited by

              I plugged my new Samsung EVO 850 120GB SATA with 2.2.6 i386 installed in my PC-BSB machine and booted. As root I entered

              sbin/tunefs -t enable /dev/ada1s1a

              Now my box does not come back, the console is full of

              CAM status: Command timeout

              after "Mounting filesystem…"

              The SSD supports trim, btw:

              http://www.samsung.com/global/business/semiconductor/minisite/SSD/global/html/ssd850evo/specifications.html

              How do I get out of this mess, the installation worked fine before... :-(


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

                Boot from an USB pen drive and then activate TRIM support in pfSense.

                1 Reply Last reply Reply Quote 0
                • 2
                  2chemlud Banned last edited by

                  Did fsck in PC-BSD and disabled TRIM. Booted to USB and enabeled TRIM again. Same problem. I do a fresh install on the SSD as apparently Samsung is to dull to handle TRIM in some OS, Linux has a known problem with the 8xx series, apparently, dunno if BSD is also involved…

                  https://en.wikipedia.org/wiki/Trim_%28computing%29

                  see "Shortcommings"

                  So I will go without TRIM.

                  Wuuuuuaaaaaa what a mess!

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

                    So I will go without TRIM.

                    But then it would be a perhaps fast dieing because the data will be not marked correctly for overwriting
                    and the SSD drive will be perhaps in short time lame and dieing.

                    Wuuuuuaaaaaa what a mess!

                    Right, but if it works for so many other peoples, it must also working for you!
                    You might be do it again and boot from a USB pen drive into "single user mdoe"
                    to activate it right!

                    1 Reply Last reply Reply Quote 0
                    • E
                      Engineer last edited by

                      @BlueKobold:

                      So I will go without TRIM.

                      But then it would be a perhaps fast dieing because the data will be not marked correctly for overwriting
                      and the SSD drive will be perhaps in short time lame and dieing.

                      TRIM cleans up after files are deleted (to insure fast writing to those deleted sectors).

                      Edit:  Incorrect (TRIM does indeed lower write amplification of the drive making it last longer):

                      The 'Wear Leveling' routine of the drive's firmware should work in the background to move sectors around to give the drive a nice, full life.  Edit 2:  TRIM does indeed help because of the lower write amplification.

                      1 Reply Last reply Reply Quote 0
                      • 2
                        2chemlud Banned last edited by

                        But this Samsung drives have data corruption with TRIM enabled, see Wikipedia above. It takes some time to make  fresh SSD pfSense again and then copy the config.xml, I don't want to go through that over and over again.

                        I could not revive the first install by disabeling TRIM again, the installation was corrupt afterwards, fschk did not resolve that. Should I really try again to enable TRIM on this Samsung trash?

                        I think this TRIM is kind of voodooo and highly emotional when it comes to discussions. Any opinions on the importance of TRIM and how much it will influence the life-expectance of the SSD?

                        Merry Christmas everybody! :-)

                        chemlud

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

                          TRIM cleans up after files are deleted (to insure fast writing to those deleted sectors).

                          if a file is wiped, it is not really away and gone, and TRIM is then marking this data can be overwritten
                          so that the wear level algorithm is knowing that new data can be written on this sectors/blocks.

                          If the data will not be marked for overwriting the wear leveling algorithm gets even less and more less
                          sectors where the data can be written on and then the mSATA or SSD will be slowing down before dieing
                          then after a while.

                          It does nothing that I have read about to make the drive last longer.

                          If the wear leveling algorithm is getting less and more less free sectors/blocks to write on
                          until there are no free ones this might be then the end of the drive, but if the TRIM command
                          is marking this sectors/blocks as free for new write cycles the wear leveling algorithm get even
                          again and again new free sectors/blocks where it can be writing on. And so the lifetime will be
                          enlarged or hold.

                          The 'Wear Leveling' routine of the drive's firmware should work in the background to move sectors around to give the drive a nice, full life.

                          There are only one amount of sectors/blocks that can be used to write on and the wear level algorithm is
                          using them in a balanced way thats all.

                          I think this TRIM is kind of voodooo and highly emotional when it comes to discussions.

                          If this will be right, why then all peoples care about this "voodoo"? Why not then let them out or inactive?

                          Any opinions on the importance of TRIM and how much it will influence the life-expectance of the SSD?

                          You could use your Samsung drive without TRIM support and report it here for us.

                          1 Reply Last reply Reply Quote 0
                          • 2
                            2chemlud Banned last edited by

                            Have no alternative, hu?

                            btw: Why should it matter if the BSD is started in single-user mode for switching to TRIM?

                            If there was kind of "mega"-nano image (16 or 32 GB) I would run the SSD with that, but there were experts in the past that denied this is helpful (more space, faster degradation of card/SSD, no joke).

                            Worst thing: I have another Samsung 850 here, I wanted to install some Linux to. Maybe better I bring it back before opening up… sigh...

                            1 Reply Last reply Reply Quote 0
                            • E
                              Engineer last edited by

                              After reading (searching), I stand corrected on this.  Sorry about that and thanks BlueKobold.

                              With that said, how is TRIM triggered in FreeBSD.  In Windows, it's triggered when you empty the recycle bin.  I'm curious as to how and how often TRIM is triggered when running a program like pfsense with FreeBSD?

                              1 Reply Last reply Reply Quote 0
                              • 2
                                2chemlud Banned last edited by

                                ..I think I will go without TRIM for the while, I can simply not assess the importance of this "issue" for the time being

                                http://www.digitaltrends.com/computing/six-dead-solid-state-drives-prove-theyll-last-longer-than-you-imagined/

                                My guess: The Atom board with the SSD with break before the SSD goes south. Anything to be monitored in the Syslogs (besides the SMART status) to control for read/write errors?

                                1 Reply Last reply Reply Quote 0
                                • 2
                                  2chemlud Banned last edited by

                                  Just for the record: I tried the same with the second Samsung 850 EVO SSD, installed 2.2.6, copied over config.xml, booted from USB in single user mode, activated TRIM, reboot.

                                  At "mounting filesystems" during boot I ended in the same errors as given above. No way to have TRIM with pfSense on these drives, apparently…

                                  Question: Would it help to do a fresh install every 6 months to avoid the problems related to deactivated TRIM?

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    ThePOO last edited by

                                    Greetings and I wish everyone a great New Year !!!!!

                                    I posted in here August 04, 2015 about my getting pfSense to enable TRIM for my SSD.

                                    Well, I'm happy to say my SSD is working great and has never faulted in any way, ever!!!    I was careful vetting the SSD when I purchased the "cheapie" drive –- it was purchased from the Ama--- site and I carefully read the characteristics and that it supported TRIM, and further that TRIM support worked for several folks under FreeBSD.    I took the gamble the drive would work with TRIM enabled and the rest has been a very pleasant history ... for me.

                                    I am so happy that my list of instructions has benefited others too .... I mean, after all, when playing with the cutting edge you could open a vein if not careful <smile>.

                                    Anyway, today I upgraded my box from 2.2.5 to 2.2.6 and my TRIM status is still properly set (I did see where someone else apparently did a fresh 2.2.5 install and my instructions to enable TRIM worked for them {yay}.)

                                    So far 2.2.6 is working great, TRIM is taking care of my storage -- the world spins on .......
                                    *except something is broken in the 2.2.6 Traffic Shaper and I'll post separately about that soon ...</smile>

                                    1 Reply Last reply Reply Quote 0
                                    • B
                                      bluepr0 last edited by

                                      So TRIM does work on the Samsung Evo 850 then? I'm using a Mac mini as my pfsense box and I would like to replace my 5400rpm disk with a EVO 850 I have on my NAS for cache!

                                      1 Reply Last reply Reply Quote 0
                                      • 2
                                        2chemlud Banned last edited by

                                        eeh, what' the meaning of the word "ERROR" in your language? OIo

                                        ..please read my posts above again, just in case…

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

                                          I have a 120gb Samsung 840 EVO SSD and I was able to enable TRIM using ThePOO's instructions without incident.  I'm running pfsense 2.2.6 and I booted off my pfsense 2.2.6 USB installer.  So far no issues.

                                          I will say that my experience with this Samsung drive and it's use in 2 other systems hasn't been stellar which is why I've never purchased another Samsung and won't in the future.  For the record, my other SSDs are:

                                          • 120GB PNY (Sandforce based)

                                          • 240GB Toshiba

                                          • 240GB OCZ ARC100

                                          The PNY is "slow" by today's standards but just works (been in 3 systems) and the Toshiba and post Toshiba buyout OCZ are great.

                                          1 Reply Last reply Reply Quote 0
                                          • 2
                                            2chemlud Banned last edited by

                                            Just to avoid confusion: I'm referring to my experience with 2 Samsung EVO 850 SSDs, MetalGeek has a EVO 840 ;-)

                                            1 Reply Last reply Reply Quote 0
                                            • E
                                              elementalwindx last edited by

                                              @2chemlud:

                                              Just to avoid confusion: I'm referring to my experience with 2 Samsung EVO 850 SSDs, MetalGeek has a EVO 840 ;-)

                                              Not exactly sure why anyone in here is caring about TRIM. I've been running a pfsense box for at least a few years now on a samsung ssd. I think it's a 60 or 80gb 830 pro. I've had 0 issues with it. I don't even know if trim is on or not but I've made 0 effort to find out or change it.

                                              1 Reply Last reply Reply Quote 0
                                              • 2
                                                2chemlud Banned last edited by

                                                @element

                                                See above my post on the esoteric side of the TRIM discussion. But as a matter of fact I have here 2 Samsung EVO 850 120GB SSDs, for both I could not activate TRIM without corrupting pfSense, while it worked fine the same way on a 30GB Kingston NOW…

                                                1 Reply Last reply Reply Quote 0
                                                • K
                                                  keatre last edited by

                                                  I just performed my first install on a new machine running pfsesnse 2.2.6 and TRIM was indeed not enabled.  Followed OP's instructions, and TRIM is now enabled for my Intel 535.

                                                  Confirming OP's instructions are still needed and work for SSD users on 2.2.6

                                                  1 Reply Last reply Reply Quote 0
                                                  • 2
                                                    2chemlud Banned last edited by

                                                    I must confess I'm a little disturbed now, as I recognized that the problem with TRIM is apparently not related to the Samsung EVO 850, but to the i386 version of pfsense 2.2.6

                                                    I have a Kingston 30 GB SSD, which was doing fine with x64 pfsense full 2.2.6, but when installing i386 pfsense on boot it hangs on TRIM activation…

                                                    ![TRIM kingston 30 GB.JPG](/public/imported_attachments/1/TRIM kingston 30 GB.JPG)
                                                    ![TRIM kingston 30 GB.JPG_thumb](/public/imported_attachments/1/TRIM kingston 30 GB.JPG_thumb)

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

                                                      but to the i386 version of pfsense 2.2.6

                                                      Earlier or later this version (32Bit) will be not available, so anybody should take the chance to settle over
                                                      to the x86_64 version, perhaps we will see that changing is coming earlier as we all could expect or imagine it.

                                                      1 Reply Last reply Reply Quote 0
                                                      • 2
                                                        2chemlud Banned last edited by

                                                        To see if the problem has to do with the activation of TRIM on my 64bit BSD, I followed exactly the steps given in the first post of this thread, same result, same hanging on booting.

                                                        This whole TRIM thing is a pile of sh*t on i386 BSD…

                                                        1 Reply Last reply Reply Quote 0
                                                        • K
                                                          kapara last edited by

                                                          I wonder if it is a batch of bad Samsung ssd's

                                                          I recently built out a new box on supermicro MB.  Enabled trim without error.  I did have to use 64bit, and installed off of usb 2.0 port and disable AHCI.  Legacy IDE only.  No issues so far!

                                                          Samsung 850 Pro

                                                          1 Reply Last reply Reply Quote 0
                                                          • 2
                                                            2chemlud Banned last edited by

                                                            " I did have to use 64bit,"

                                                            64bit worked here too, but not 32 bit–-

                                                            1 Reply Last reply Reply Quote 0
                                                            • S
                                                              sts 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.

                                                              […]

                                                              Thanks for this guide, I just successfully enabled TRIM on the 16GB mSATA SSD module of the apu2c4!

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

                                                                Thank you very much, this very help me.

                                                                1 Reply Last reply Reply Quote 0
                                                                • X
                                                                  xman111 last edited by

                                                                  me too,  did it last night on 64bit pfsense 2.3, and an Intel SSD.

                                                                  1 Reply Last reply Reply Quote 0
                                                                  • Pippin
                                                                    Pippin last edited by

                                                                    Thank you to @ThePOO
                                                                    It worked for me.

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

                                                                      Thank you for sharing this guide, ThePOO

                                                                      1 Reply Last reply Reply Quote 0
                                                                      • N
                                                                        nicholfd last edited by

                                                                        @jimp:

                                                                        Devices purchased from the pfSense store are loaded with TRIM enabled since we know the hardware and disks are capable (or at least in some cases do not have a negative reaction to it)

                                                                        This wasn't the case with a new set of HA rack mount SG-4860's just purchased (thread https://forum.pfsense.org/index.php?topic=113803.0).  Has this changed?  Should the HA set of SG-4860's have TRIM enabled?

                                                                        Thanks,
                                                                        Frank

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

                                                                          I just used this guide to enable TRIM on my new Samsung 850 evo msata drive. Rebooted and everything looks as it should.
                                                                          Should I be concerned about corruption or would it be immediately obvious if there was a problem, I'm using pfSense x64.
                                                                          Thanks.

                                                                          1 Reply Last reply Reply Quote 0
                                                                          • E
                                                                            EricE last edited by

                                                                            @2chemlud:

                                                                            This whole TRIM thing is a pile of sh*t on i386 BSD…

                                                                            TRIM is an ugly hack, period.  Mainly a symptom of trying to graft old storage technology that works one way on top of flash memory that works an entirely different way.  Hopefully someone will come up with a replacement for SATA and develop a native flash memory stack end to end.

                                                                            Until then I just buy SSDs that are over-provisioned and do their own garbage collection irrespective of TRIM.  Most Sandforce based SSDs work this way - it just takes a bit more digging to find 'em.

                                                                            1 Reply Last reply Reply Quote 0
                                                                            • S
                                                                              somniture last edited by

                                                                              @EricE:

                                                                              TRIM is an ugly hack, period.  Mainly a symptom of trying to graft old storage technology that works one way on top of flash memory that works an entirely different way.  Hopefully someone will come up with a replacement for SATA and develop a native flash memory stack end to end.

                                                                              It's called NVMe.

                                                                              1 Reply Last reply Reply Quote 0
                                                                              • W
                                                                                Waqar.UK last edited by

                                                                                @EricE:

                                                                                @2chemlud:

                                                                                This whole TRIM thing is a pile of sh*t on i386 BSD…

                                                                                TRIM is an ugly hack, period.  Mainly a symptom of trying to graft old storage technology that works one way on top of flash memory that works an entirely different way.  Hopefully someone will come up with a replacement for SATA and develop a native flash memory stack end to end.

                                                                                Until then I just buy SSDs that are over-provisioned and do their own garbage collection irrespective of TRIM.  Most Sandforce based SSDs work this way - it just takes a bit more digging to find 'em.

                                                                                With regard to  over-provisioned SSD a good article (at least from Kingston) is
                                                                                https://www.kingston.com/en/ssd/overprovisioning
                                                                                Seagate:
                                                                                http://www.seagate.com/gb/en/tech-insights/ssd-over-provisioning-benefits-master-ti/

                                                                                1 Reply Last reply Reply Quote 0
                                                                                • First post
                                                                                  Last post

                                                                                Products

                                                                                • Platform Overview
                                                                                • TNSR
                                                                                • pfSense
                                                                                • Appliances

                                                                                Services

                                                                                • Training
                                                                                • Professional Services

                                                                                Support

                                                                                • Subscription Plans
                                                                                • Contact Support
                                                                                • Product Lifecycle
                                                                                • Documentation

                                                                                News

                                                                                • Media Coverage
                                                                                • Press
                                                                                • Events

                                                                                Resources

                                                                                • Blog
                                                                                • FAQ
                                                                                • Find a Partner
                                                                                • Resource Library
                                                                                • Security Information

                                                                                Company

                                                                                • About Us
                                                                                • Careers
                                                                                • Partners
                                                                                • Contact Us
                                                                                • Legal
                                                                                Our Mission

                                                                                We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

                                                                                Subscribe to our Newsletter

                                                                                Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

                                                                                © 2021 Rubicon Communications, LLC | Privacy Policy