UNOFFICIAL GUIDE: RUN SWAP OVER USB DRIVE IN PFSENSE
-
@JonathanLee FreeBSD has this idea of "device withering".
If your swap partition is NOT mounted/in use, you will likely see a "/dev/da0p2" AND a "/dev/gpt/whateverlabelyougaveit".
Then the first exclusive reference (think mount) makes everything else disappear.
if you do "swapon /dev/da0p2" the /dev/gpt disappears.
If you do "swapon /dev/gpt/whatever" the /dev/da0p2 will likely disappear (not always since this is basically raw device)
Your swapinfo showing both /dev/gpt/swapUSB.eli and /dev/label/swap0 indicate to me they are on 2 different physical devices.
If they are not different physical devices, you have something very odd going on. -
Yes swapusb is a usb and the other is the SSD on the device itself. Two different devices, also .Eli is in use so dump can not use that device only swap can
-
@mer I wonder if I do a cron job on it and swapon set it to be specific for usb if it would work, I opened a redmine as the current rc.dumpon does not include a if Eli and or if usb for situations like this. It was not closed right away so it could be fixed with a simple if else situation on the code.
-
Fix is to set swapoff on the other drive with a cron job no code is adapted. I am going to update my unofficial guide
-
@JonathanLee Keep in mind "swapoff" may not immediately free up swap space. I think items in swap need to wind up getting released (basically the VM system recognizes no longer needed) before the swap device is actually taken offline.
-
The unofficial guide for running swap over a USB drive in pfSense explains how to configure a USB drive as swap space. While it can help with memory shortages, it risks reduced performance and potential wear on the USB drive due to frequent read/write cycles. Use cautiously and consider alternatives like increasing RAM.
-
@castleapp your right. Again with how affordable usb sticks are why not have that hypothetical emergency gas tank. If you are worried about usb flash drive damage from overuse why not utilize a usb HDD for added longevity. Some systems can’t add memory as it is embedded. Merry Christmas
-
Hmm @castleapp's reply reads like chatgpt, i.e. spam incoming....
-
@stephenw10 I agree it is a little bit off.
-
@stephenw10 I reported it as (possible) spam (category 'other) yesterday.