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

    Enable Trim on geom mirror

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    8 Posts 5 Posters 2.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.
    • A Offline
      abzstrak
      last edited by

      I'm a Linux guy, so I'm alittle uneasy making changes on FreeBSD without being sure.

      ok, so my two recycled laptop drives I had running in my firewall both developed bad sectors… kinda was a pain. so I went to Microcenter and bought a couple of PNY 120GB SSD's.  These suckers are TLC, so I really want to run trim, but I'm unsure as to how and don't want to screw anything up.

      right now if I run tunefs -p /  it shows trim is not running... but is that just on the mirror device?  how do I see the physical drives?

      I have them running in a mirror, most of the howto's I've found make mention of enabling AHCI in the loader.conf.local, that's easy.  Next you are to reboot off of a USB and use tunefs on the device ID of the drive.  Well, my fstab isn't using device id's of drives, it just shows pfSenseMirrors1a and pfSenseMirrors1b.  Do I enable trim on that? (sounds wrong) or the ada0 and ada1?

      anyway, if anyone that can provide me some direction I would appreciate it.

      1 Reply Last reply Reply Quote 0
      • K Offline
        kpa
        last edited by

        TRIM is a filesystem level thingy on FreeBSD, you enable or disable it on a UFS filesystem and not on the raw partitions that make up the GEOM mirror provider. It should work by booting into single user mode and running tunefs -t enable /dev/mirror/ <root>where <root>is the device node corresponding to the root filesystem. In your case <root>is /dev/mirror/pfSenseMirrors1a. The name may be confusing but the name of the GEOM mirror provider is pfSenseMirror, the virtual disk provided by it is split into slices and the first slice is s1 and finally the a at the end is for the first FreeBSD partition on the slice. Reboot when done</root></root></root>

        1 Reply Last reply Reply Quote 0
        • A Offline
          abzstrak
          last edited by

          I appreciate the response.  I actually thought that maybe trim was enabled, just not propagating through gmirror… nope, gstat -d shows no biodeletes after alot of activity, so I don't think it's running but not showing in tunefs...

          I went ahead and enabled AHCI and rebooted, then touched the file /root/TRIM_set and rebooting... no joy.

          Next I booted off a usb into single user mode, but when I issued the command "tunefs -t enable /dev/mirror/pfSenseMirror1a" it tells me this:
          tunefs: /dev/mirror/pfSenseMirror1a: could not find special device

          I'm not sure what to make of that.  I checked, it does show up in the filesystem.  I also tried it on 1b and 1 just for kicks, but got the same result. Not sure where to go from there, and googling around for freebsd similar issues isn't helping me either.

          Any ideas?

          1 Reply Last reply Reply Quote 0
          • C Offline
            chrcoluk
            last edited by

            you will need to create the geom mirror device in the rescue boot.

            Sadly I rarely have used geom mirror so I dont know off hand how to do this, but am about to have a quick look at the documentation and if I find the answer it will be at the end of this post before I click submit.

            For sure you will need to load the module which the command is```
            kldload geom_mirror

            
            Try that and report back if the geom device works or not.

            pfSense CE 2.8.0

            1 Reply Last reply Reply Quote 0
            • K Offline
              kpa
              last edited by

              It's possible that TRIM still doesn't work on geom_mirror. I tried to google for relevant information but it's pretty scarse except for a few FreeBSD mailing list posts from 2011 and 2012.

              1 Reply Last reply Reply Quote 0
              • C Offline
                chrcoluk
                last edited by

                yeah now days zfs is the popular choice thats why.

                UFS I think its days are numbered.

                The pfsense installer does need modernisiing I feel, add zfs support, make partitions 4k aligned, and add GPT support, as well as enabling trim if a ssd is detected.

                pfSense CE 2.8.0

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

                  @chrcoluk:

                  The pfsense installer does need modernisiing I feel, add zfs support, make partitions 4k aligned, and add GPT support, as well as enabling trim if a ssd is detected.

                  ZFS (incl. mirror) and GPT is already there in 2.4 snapshots. There won't be any trim support anywhere, but you can reboot to single user mode from the console menu.

                  1 Reply Last reply Reply Quote 0
                  • jimpJ Offline
                    jimp Rebel Alliance Developer Netgate
                    last edited by

                    ZFS supports TRIM natively so it'll do that automatically. There is a knob to disable it if your disk blows up with it on:

                    https://www.freebsd.org/doc/faq/all-about-zfs.html#idp59422952

                    Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

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