swap not listed? [solved]
-
@mvikman wonder why my fstab is pointing to da1, that would explain why swap not showing on widget I would think.
-
@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.”
-
@steveits yeah I did a clean install on 22.01 because of the layout changes.
-
@johnpoz I have the same issue the swap is missing from the widget, even if you turn on ZFS the swap widget is missing
-
@steveits I have a full clean install from the firmware that was sent and it is missing from mine also.
-
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 the1
.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 beda0
and the mmc isda1
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.
-
@jimp
But mine does show on the widget even though it is /dev/mirror/swapHmm, 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? -
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.
-
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? -
@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.
-
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)? -
@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.
-
@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 ?
-
Well manually edit of fstab to be da0 vs da1, finally got around to a reboot of pfsense and now see swap
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:
-
@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.
-
@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.
gpart show
I'm not sure why it says freebsd-ufs when the disk widget shows zfs...
-
@azdeltawye said in swap not listed? [solved]:
I'm having the same issue on my brand new 4100; swap partition exists but is not showing in the widget
See Netgate 4100 disk : my 4100 MAX came with 22.01 pre installed and had a swap partition, but not shown in the GUI dashboard widget.
Had to edit the /etc/fstab/ as mentioned above.This is mine right now :
[23.01-RELEASE][admin@pfSense.brit-hotel-fumel.net]/root: cat /etc/fstab # Device Mountpoint FStype Options Dump Pass# /dev/nvd0p3 none swap sw 0 0
NOte ; back then, see other thread, I had a first line :
/dev/msdosfs/EFISYS /boot/efi msdosfs rw,noatime,noauto 0 0
Now, it is 't there anymore.
@azdeltawye said in swap not listed? [solved]:
freebsd-ufs when the disk widget shows zfs
Can't tell ...
I did do a complete re install with an fresh "22.05" image from Netgate, last September just to complete my 'crash test formation'. -
The 4100 MAX I have here appears to be OK, it was freshly installed recently with 23.01, though. It's possible there was an issue in the older installer.
I'm curious though if anyone can reproduce that with a fresh 23.01 install.
: cat /etc/fstab # Device Mountpoint FStype Options Dump Pass# /dev/gpt/efiboot0 /boot/efi msdosfs rw 2 2 /dev/nvd0p3 none swap sw 0 0
: swapinfo Device 1K-blocks Used Avail Capacity /dev/nvd0p3 1048576 0 1048576 0%
: gpart show -p => 40 234441568 nvd0 GPT (112G) 40 532480 nvd0p1 efi (260M) 532520 1024 nvd0p2 freebsd-boot (512K) 533544 984 - free - (492K) 534528 2097152 nvd0p3 freebsd-swap (1.0G) 2631680 231809024 nvd0p4 freebsd-zfs (111G) 234440704 904 - free - (452K)
-
@gertjan
Thanks for the link to the applicable thread. I am in the exact same situation.
I will reply there with any updates. -
OK, problem solved.
I did a fresh install of 23.01 on my 4100-MAX and now the SWAP partition is recognized!
Before:
Shell Output - cat /etc/fstab # Device Mountpoint FStype Options Dump Pass# /dev/msdosfs/EFISYS /boot/efi msdosfs rw,noatime,noauto 0 0 /dev/gptid/1fa4f543-c6a2-11ec-93d9-90ec772a1255 none swap sw 0 0 Shell Output - gpart show -p => 3 234441637 nvd0 GPT (112G) 3 409600 nvd0p1 efi (200M) 409603 222504511 nvd0p2 freebsd-ufs (106G) 222914114 11527521 nvd0p3 freebsd-swap (5.5G) 234441635 5 - free - (2.5K)
After:
Shell Output - cat /etc/fstab # Device Mountpoint FStype Options Dump Pass# /dev/gpt/efiboot0 /boot/efi msdosfs rw 2 2 /dev/nvd0p3 none swap sw 0 0 Shell Output - gpart show -p => 40 234441568 nvd0 GPT (112G) 40 532480 nvd0p1 efi (260M) 532520 1024 nvd0p2 freebsd-boot (512K) 533544 984 - free - (492K) 534528 16777216 nvd0p3 freebsd-swap (8.0G) 17311744 217128960 nvd0p4 freebsd-zfs (104G) 234440704 904 - free - (452K)