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

    swap not listed? [solved]

    Scheduled Pinned Locked Moved General pfSense Questions
    solved
    41 Posts 9 Posters 5.8k 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.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator
      last edited by johnpoz

      Not sure if I missed a step or skipped something in setup.. Not sure even need a swap, but this morning I got curious when adding last config change to show on my system info widget, hey swap is checked to show

      noswap.jpg

      But it isn't, running on a sg4860 running 23.01.. I had moved to zfs a few versions back - and for sure not as up to speed on zfs as I should be.. Did I forget to create swap when I moved to zfs?

      So if I look at my zfs I do see it shows a 1G swap part

      swap1.jpg

      Do I need to enable swap somewhere, is this not really the correct swap partition? Do I really even need swap, do I actually have it and just not showing on the widget?

      Not having any issues, I don't think anything should or would or needs to swap out, etc. Just more curious than anything this morning, maybe just brain still fuzzy from only first cup of coffee..

      But it does seem odd that widget isn't showing anything, if I actually have swap.. And if I don't what are those that say swap on them, etc.

      Maybe its the Irish Whiskey added to my coffee this morning - but only had the 1 cup so far so I don't think thats it ;)

      swapinfo doesn't show anything, but if there is no swap what is gpart show and geom label status showing?

      An intelligent man is sometimes forced to be drunk to spend time with his fools
      If you get confused: Listen to the Music Play
      Please don't Chat/PM me for help, unless mod related
      SG-4860 24.11 | Lab VMs 2.7.2, 24.11

      S JonathanLeeJ A 3 Replies Last reply Reply Quote 1
      • M
        mvikman
        last edited by

        I originally installed 2.6CE with mirrored drives, I don't recall changing anything other than setting stripe -> mirror.
        I remember wondering if I need any swap space because I have 8G RAM, but decided to leave it at the default 1G.

        System Info widget shows swap for me
        70793a77-0c62-462b-a5fc-1ea5c9475761-image.png

        From CLI
        e6b33ff7-0716-4b6c-9818-80b4f0c672db-image.png

        pfSense Plus 24.11-RELEASE (amd64)
        Dell Optiplex 7040 SFF
        Core i5-6500, 8GB RAM, 2x 240GB SSD (ZFS Mirror)
        HPE 561T (X540-AT2), 2-port 10Gb RJ45
        HPE 562SFP+ (X710-DA2), 2-port 10Gb SFP+

        johnpozJ jimpJ 2 Replies Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @mvikman
          last edited by

          @mvikman hmmm

          So your swapinfo shows you have swap, so makes sense your widget shows it.

          And I see the same freebsd-swap in my gpart show, but your label status doesn't show the swap0 mine shows..

          Well this is weird seems my fstab shows da1?

          [23.01-RELEASE][admin@sg4860.local.lan]/root: cat /etc/fstab 
          # Device                Mountpoint      FStype  Options         Dump    Pass#
          /dev/da1p2              none    swap    sw              0       0
          [23.01-RELEASE][admin@sg4860.local.lan]/root:
          

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.7.2, 24.11

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

            I'm guessing that swap doesn't show similarly in label status is because of my zfs mirror...

            [23.01-RELEASE][admin@shodan.phobos.home.arpa]/root: cat /etc/fstab
            # Device                Mountpoint      FStype  Options         Dump    Pass#
            /dev/mirror/swap                none    swap    sw              0       0
            [23.01-RELEASE][admin@shodan.phobos.home.arpa]/root:
            
            [23.01-RELEASE][admin@shodan.phobos.home.arpa]/root: geom mirror status
                   Name    Status  Components
            mirror/swap  COMPLETE  ada1p3 (ACTIVE)
                                   ada0p3 (ACTIVE)
            [23.01-RELEASE][admin@shodan.phobos.home.arpa]/root:
            

            pfSense Plus 24.11-RELEASE (amd64)
            Dell Optiplex 7040 SFF
            Core i5-6500, 8GB RAM, 2x 240GB SSD (ZFS Mirror)
            HPE 561T (X540-AT2), 2-port 10Gb RJ45
            HPE 562SFP+ (X710-DA2), 2-port 10Gb SFP+

            johnpozJ 1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @mvikman
              last edited by

              @mvikman wonder why my fstab is pointing to da1, that would explain why swap not showing on widget I would think.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

              1 Reply Last reply Reply Quote 0
              • S
                SteveITS Galactic Empire @johnpoz
                last edited by

                @johnpoz the ZFS/disk layout changed with 22.01/2.6…in the release notes :
                “The ZFS pool name and datasets have also been updated and optimized. Users who were already using ZFS may want to reinstall as well to ensure they have the most optimal disk layout.”

                Not sure if that’s relevant here but you said “a few versions.”

                Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                Upvote 👍 helpful posts!

                johnpozJ JonathanLeeJ 2 Replies Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator @SteveITS
                  last edited by

                  @steveits yeah I did a clean install on 22.01 because of the layout changes.

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                  1 Reply Last reply Reply Quote 0
                  • JonathanLeeJ
                    JonathanLee @johnpoz
                    last edited by

                    @johnpoz I have the same issue the swap is missing from the widget, even if you turn on ZFS the swap widget is missing

                    e9fbb1d3-4b72-40ea-9374-edeac61c0fbf-image.png

                    Make sure to upvote

                    1 Reply Last reply Reply Quote 0
                    • JonathanLeeJ
                      JonathanLee @SteveITS
                      last edited by

                      @steveits I have a full clean install from the firmware that was sent and it is missing from mine also.

                      Make sure to upvote

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

                        @mvikman

                        Yours doesn't show in the widget because the widget is filtering the swapinfo output looking for a device with a number in it and yours is /dev/mirror/swap which I'm not sure how it ended up with that name.

                        I only have one VM still around with gmirror and it's named /dev/mirror/pfSenseMirrors1b on there, so it shows up because of the 1.

                        That said, mirroring swap is really a bad idea and I'm not sure why it used to do that. It isn't critical data and that will just cause twice the disk activity for no benefit. Slower and wasteful. A fresh ZFS install with mirroring has a separate swap area on both disks (not mirrored) but maybe if someone went out of their way to do it manually it might end up mirrored. It's an option when setting up the mirror but it defaults to off.

                        @johnpoz said in swap not listed?:

                        @mvikman wonder why my fstab is pointing to da1, that would explain why swap not showing on widget I would think.

                        Probably because the disk is daX. When booted from USB that might affect the order of the disks being detected so the USB drive might be da0 and the mmc is da1 but later after install without the USB drive in, the mmc is da0. Usually it would have used a disk label or disk ID in the fstab but it may not have for one reason or another. The installer has changed a lot over time.

                        You can fix that easily enough, just edit the fstab and reboot, or you could manually run the commands to setup the swap but it's best to just reboot and let it happen naturally.

                        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 1
                        • M
                          mvikman
                          last edited by

                          @jimp
                          But mine does show on the widget even though it is /dev/mirror/swap

                          Hmm, maybe I followed some older guide that suggested that the swap should also be mirrored...
                          Is is possible to remove the mirror from the swap or would it require clean re-install?

                          pfSense Plus 24.11-RELEASE (amd64)
                          Dell Optiplex 7040 SFF
                          Core i5-6500, 8GB RAM, 2x 240GB SSD (ZFS Mirror)
                          HPE 561T (X540-AT2), 2-port 10Gb RJ45
                          HPE 562SFP+ (X710-DA2), 2-port 10Gb SFP+

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

                            Not sure there is any easy way to break that mirror. Reinstalling is so quick/easy that's probably the most reliable way to do it.

                            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
                            • M
                              mvikman
                              last edited by

                              Tested with a virtual machine, "/dev/mirror/swap" was created by the 2.6CE installer when selecting "Mirror swap" option
                              Is it using GEOM Mirror for the swap and ZFS Mirror for the rest of the data?

                              pfSense Plus 24.11-RELEASE (amd64)
                              Dell Optiplex 7040 SFF
                              Core i5-6500, 8GB RAM, 2x 240GB SSD (ZFS Mirror)
                              HPE 561T (X540-AT2), 2-port 10Gb RJ45
                              HPE 562SFP+ (X710-DA2), 2-port 10Gb SFP+

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

                                @mvikman said in swap not listed?:

                                Tested with a virtual machine, "/dev/mirror/swap" was created by the 2.6CE installer when selecting "Mirror swap" option
                                Is it using GEOM Mirror for the swap and ZFS Mirror for the rest of the data?

                                It must be, since it's showing in /dev/mirror. That's all a part of the BSD installer and not our code though IIRC.

                                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
                                • M
                                  mvikman
                                  last edited by

                                  What makes mirroring swap a bad idea, other than possible writes to swap are doubled/slower?
                                  Does it really matter if swap is not used at all in normal situations (system has enough RAM not to swap)?

                                  pfSense Plus 24.11-RELEASE (amd64)
                                  Dell Optiplex 7040 SFF
                                  Core i5-6500, 8GB RAM, 2x 240GB SSD (ZFS Mirror)
                                  HPE 561T (X540-AT2), 2-port 10Gb RJ45
                                  HPE 562SFP+ (X710-DA2), 2-port 10Gb SFP+

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

                                    @mvikman said in swap not listed?:

                                    What makes mirroring swap a bad idea, other than possible writes to swap are doubled/slower?
                                    Does it really matter if swap is not used at all in normal situations (system has enough RAM not to swap)?

                                    Those two reasons are more than enough to not do it. Swap is already slow enough compared to RAM, making it even slower is going to be a problem if/when the system needs to hit swap.

                                    If your system never hits swap it's not going to matter much (until it does...) but there is no advantage to it either.

                                    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!

                                    JonathanLeeJ johnpozJ 2 Replies Last reply Reply Quote 0
                                    • JonathanLeeJ
                                      JonathanLee @jimp
                                      last edited by

                                      @jimp In the case of Squid Proxy and content acceleration I have a 15 gb swap set up it's almost 70 percent full. Is this not the same thing, as it is considered a swap under the proxy ?

                                      Make sure to upvote

                                      jimpJ 1 Reply Last reply Reply Quote 0
                                      • johnpozJ
                                        johnpoz LAYER 8 Global Moderator @jimp
                                        last edited by johnpoz

                                        Well manually edit of fstab to be da0 vs da1, finally got around to a reboot of pfsense and now see swap

                                        swap.jpg

                                        I don't really like rebooting my firewall.. Waited for a time when nobody streaming off plex, and wasn't doing anything else, etc.

                                        I will mark as solved, thanks Jim!

                                        edit: just to be complete, swapinfo now shows

                                        [23.01-RELEASE][admin@sg4860.local.lan]/root: swapinfo
                                        Device          1K-blocks     Used    Avail Capacity
                                        /dev/da0p2        1048576        0  1048576     0%
                                        [23.01-RELEASE][admin@sg4860.local.lan]/root: 
                                        

                                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                                        If you get confused: Listen to the Music Play
                                        Please don't Chat/PM me for help, unless mod related
                                        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                                        T 1 Reply Last reply Reply Quote 2
                                        • jimpJ
                                          jimp Rebel Alliance Developer Netgate @JonathanLee
                                          last edited by

                                          @jonathanlee said in swap not listed? [solved]:

                                          @jimp In the case of Squid Proxy and content acceleration I have a 15 gb swap set up it's almost 70 percent full. Is this not the same thing, as it is considered a swap under the proxy ?

                                          That is unrelated. That is about squid's internal memory vs disk cache. This is about OS RAM usage.

                                          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!

                                          JonathanLeeJ 1 Reply Last reply Reply Quote 1
                                          • A
                                            azdeltawye @johnpoz
                                            last edited by azdeltawye

                                            @johnpoz
                                            I'm having the same issue on my brand new 4100; swap partition exists but is not showing in the widget.

                                            I typed in the command: cat /etc/fstab but not sure where to go from here.

                                            a4429c1d-0ad7-43ad-95bd-503c3c7c2782-image.png

                                            gpart show
                                            2fdc999e-6b3c-43c5-ae60-38e22dd898cf-image.png

                                            I'm not sure why it says freebsd-ufs when the disk widget shows zfs...
                                            f53000cd-9712-4510-9a1c-737ac5d0050f-image.png

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