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

    Installation swapfile question

    Scheduled Pinned Locked Moved General pfSense Questions
    4 Posts 4 Posters 533 Views 4 Watching
    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.
    • J Offline
      jc1976
      last edited by

      I just built a new firewall based upon CE 2.7.2 in which, for redundancy, i installed it as a raidz-1. I wanted both drives to be mirrored incase one fails i can pop it out and install a new ssd (same ssd of course) and go about my business without having to redo anything. I don't know how many pfsense installs i've done... dozens, so yes, i'm pretty well versed, however most have been onto a single ssd.

      here's my question:

      at the screen where we choose which raid level and the sector size, swap file size, whether we want our swap file mirrored, before we commit the settings to disk..

      I chose to have my swapfile 32 Gigs, and when i chose to "mirror my swap" it would error out with a gmirror erro message (or something like that.. couldn't write metadata, blah blah... i don't remember the message exactly).. but my point is, i wanted to mirror my swap.. both drives should be the same so incase (like i said above) one drive fails, the system keeps going until it's replaced.

      choosing the 2nd to last option to mirror my swap causes it to error out.. not selecting to mirror my swap (default) allowed it to install without issue.

      so, while the OS is installed on two drives as raidz-1, is the swap partition raid-0'd (striped) across the swap partitions?

      i'm confused because if i chose to run a raidz-1 on the OS drives, doesn't that automatically mirror the swap as well?

      thanks!

      Dobby_D 1 Reply Last reply Reply Quote 0
      • Dobby_D Offline
        Dobby_ @jc1976
        last edited by

        @jc1976 said in Installation swapfile question:

        i'm confused because if i chose to run a raidz-1 on the OS drives, doesn't that automatically mirror the swap as well?

        Hello, in former days a /swap partition will be able to create only with 4 GB (max.) size. I got a single mSATA running with
        pfSense 2.7.2 with a 8 GB /swap partition. So if the RAM runs full, it will be using the /swap for paging out.

        In your case I would try out to go with a 4 GB and then trying to highing it up.

        #~. @Dobby

        Turris Omnia - 4 Ports - 2 GB RAM / TurrisOS 7 Release (Btrfs)
        PC Engines APU4D4 - 4 Ports - 4 GB RAM / pfSense CE 2.7.2 Release (ZFS)
        PC Engines APU6B4 - 4 Ports - 4 GB RAM / pfSense+ (Plus) 24.03_1 Release (ZFS)

        GertjanG 1 Reply Last reply Reply Quote 0
        • GertjanG Offline
          Gertjan @Dobby_
          last edited by

          @Dobby_ said in Installation swapfile question:

          Hello, in former days a /swap partition will be able to create only with 4 GB (max.) size. I got a single mSATA running with
          pfSense 2.7.2 with a 8 GB /swap partition. So if the RAM runs full, it will be using the /swap for paging out.

          back in the good old days, the swap partition (file) was about the size of the RAM.
          So, if you have 4 Gbytes (and remove 1 Gbytes as the kernel will block the upper part for its own usage) you create a 3 Gbytes swap and you'll be fine.

          That said, if pfSense starts to actually use the swap, consider your firewall severally crippled. The swap file exists merely to enable you to see when to add RAM, or stop using 'big processes'. You should act earlier then soon when this happens.
          A 32 Gbytes swap on pfSense ? That's IMHO, pure BS ;). It doesn't harm, though. It's just 32 Gbytes wasted.
          Btw : here is my pfSense memory usage.

          65b464be-475d-4891-a194-e6c04a5b4ff5-image.png

          That said, if I would need a 32 Gbytes pfSense "because I can" or "because I have to" I would have taken the TNSR train already. After all, I just have a small, less then 50 devices network (3 LANs), one WAN, no gadgets, no bells and whistles system. I don't have any MITM needs etc.

          I've a "4100" that doesn't allow any raid setup (does a Netgate appliance actually propose a raid ready device ?) as, when needed, I install pfSense "from USB drive" (3 minutes ?) and then I import my latest system config backup (1 minutes ?) and I'm up again.
          I do use raid for my NASses, and file server devices etc.

          But again, I don't presume to know every 'firewall' need, I'm a small player, I know.
          For essential devices like the main firewall I prefer the KIS setup - and I have a hot (not powered now, but in working state) spare device.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

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

            Yes, if you're using SWAP in 'normal' use there's probably a problem. The biggest use for SWAP in pfSense is to be able to store crash reports should you ever hit a kernel panic. So I would argue that having it mirrored should not really be that important. Should.

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