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

    SG2100 128GB SSD and Swap

    Scheduled Pinned Locked Moved General pfSense Questions
    swapcrashing
    28 Posts 3 Posters 1.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.
    • JonathanLeeJ
      JonathanLee
      last edited by JonathanLee

      Per @jimp on using the MMC as a swap
      “While you could do that with the MMC, I wouldn't. If you have a cheap sacrificial USB thumb drive you could do it to that without worrying about potential harm to the MMC. I don't have the commands handy but you'd format the drive with gpart, add a freebsd-swap partition, then reference that partition in /etc/fstab as the swap parition. Then when you're done, remove the fstab entry, reboot and remove the thumb drive.”

      I am wondering with my 128GB SSD if I could just creat a swap and use it?

      Or should I only use a usb drive to do this?

      I am having system crashes with use of my compex card with increased fiber speeds it didn’t do this with DSL.

      What would be the best way to attack this?

      @jimp do I create the swap on the usb with a system running FreeBSD and or do I create it with pfSense software command line?

      Can I please have those commands on how to do this? I like your usb idea. I just want to know what is causing the crash

      Ref:

      https://www.cyberciti.biz/faq/create-a-freebsd-swap-file/

      Make sure to upvote

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

        The usb storage only lets you mount msdos partitions last time I got a usb drive mounted. If it’s FreeBSD it would mount right? There is non restrictions?

        Make sure to upvote

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

          https://forum.netgate.com/topic/187132/can-users-use-an-external-hdd-for-use-with-boot-environments/

          Make sure to upvote

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

            Screenshot 2024-05-06 at 23.52.33.png

            I show a swap

            Make sure to upvote

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

              Screenshot 2024-05-07 at 00.03.24.png

              Make sure to upvote

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

                Screenshot 2024-05-07 at 00.04.40.png

                Make sure to upvote

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

                  Screenshot 2024-05-07 at 00.07.20.png

                  Make sure to upvote

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

                    So gpart shows it has a 6GB swap however the fstab file does not list it and swapinfo shows incorrect info?

                    Make sure to upvote

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

                      @JonathanLee I should be able to just add a mount point for it right?

                      Make sure to upvote

                      1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        Yes you should just be able to add it to the fstab. Like:

                        [24.03-RELEASE][admin@5100.stevew.lan]/root: cat /etc/fstab 
                        # Device		Mountpoint	FStype	Options		Dump	Pass#
                        /dev/ada0p2		none	swap	sw		0	0
                        

                        Though you need to use /dev/ada0s3b.

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

                          @stephenw10 thanks after setting this the crash reports should show correct? This is new to me so the swap is essentially extra memory for the kernel? How does this help with getting crash reports? I am excited to test this with the compex card. Do I need to disable this or can I leave it enabled after we are done with it.

                          Make sure to upvote

                          1 Reply Last reply Reply Quote 0
                          • stephenw10S
                            stephenw10 Netgate Administrator
                            last edited by

                            Yes it should store crash reports. The SWAP space still exists and is accessible from the debugger so it is able to store the crash report there. pfSense checks for any reports in the swap at boot and shows an alert if it finds any.

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

                              @stephenw10 is it safe to leave it on? It is on the SSD. I am a bit confused with this as why @jimp recommend using a usb for swap. Is that because that is recommended over using MMC but I have a SSD and that is ok to use? Is it essentially extra memory for only crash reports? Or let’s say I use clamAV and enabled the monster signature file would it overflow into the swap for loading? Kind of like Disk based RAM? It shouldn’t use it all the time right? Again with an SSD that can withstand abuse is it ok? 6GB swap, I only have 4GB memory and I can only access around 3.5 of it.

                              Make sure to upvote

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

                                @stephenw10 @jimp

                                It is on the SSD working :)

                                Thanks,

                                Screenshot 2024-05-07 at 07.47.35.png

                                Make sure to upvote

                                1 Reply Last reply Reply Quote 0
                                • stephenw10S
                                  stephenw10 Netgate Administrator
                                  last edited by

                                  Yeah it's safe to leave enabled on an SSD. But, as you say, it should never get used anyway.

                                  We have recommended using a USB drive for SWAP because it's easy to add. In your case it was trivial because the SWAP partition already existed. But on a system with emmc only where there is no SWAP then re-partitioning it to add swap is complex. Easier to reinstall. Or just use a USB drive temporarily.

                                  T 2 Replies Last reply Reply Quote 1
                                  • T
                                    The Party of Hell No @stephenw10
                                    last edited by

                                    @stephenw10
                                    Okay Stephen riddle me this... yesterday I was able to get the swap file to show in the gui under system information by editing the fstab to correct the location of the swap file partition. Today I see my amount of swap is 1024 and "gpart show" says I have 1.06 or "freebsd-swap (1.0G)." What kind of trickery is this!

                                    1 Reply Last reply Reply Quote 2
                                    • T
                                      The Party of Hell No @stephenw10
                                      last edited by

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        Unclear what your question is? You appear to have a 1GB SWAP partition and it's configured correctly if it appears in the gui.

                                        T 1 Reply Last reply Reply Quote 0
                                        • T
                                          The Party of Hell No @stephenw10
                                          last edited by

                                          @stephenw10
                                          Sorry, I was not clear... the gui, system Information says the swap file is 1024mb but the swap file according to gpart is 1.0g. My thinking is these two should match? Am I wrong about that?

                                          JonathanLeeJ 1 Reply Last reply Reply Quote 1
                                          • JonathanLeeJ
                                            JonathanLee @The Party of Hell No
                                            last edited by

                                            @The-Party-of-Hell-No

                                            Your in luck that is 1GB

                                            64MB X 2 = 128MB a fourth of a 1GB

                                            128MB X 2 = 512MB or half a 1GB

                                            512 X 2 = 1024MB or Also known as 1GB :)

                                            Make sure to upvote

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