Project

General

Profile

Actions

Regression #16232

open

Swap fails to activate when multiple swap partitions exist

Added by Grimson Gretzleburg 3 months ago. Updated 20 days ago.

Status:
Feedback
Priority:
Normal
Assignee:
Category:
Operating System
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
25.11
Release Notes:
Default
Affected Version:
2.8.0
Affected Architecture:
All

Description

I have an older pfSense install that I upgraded multiple times. It uses a 2 disk ZFS mirror for the normal data and a basic swap partition on each disk.

/etc/fstap contains:
# Device Mountpoint FStype Options Dump Pass#
/dev/gpt/efiboot0 /boot/efi msdosfs rw 2 2
/dev/ada0p3 none swap sw 0 0
/dev/ada1p3 none swap sw 0 0

This worked fine for 2.7.2 with both swap partitions used. On 2.8.0 it didn't activate swap at all.
So I checked /tmp/fstap.swap and it contained the following:

/dev/ada0p3/dev/ada1p3 none swap sw 0 0

That doesn't seem to be right.

Actions #1

Updated by Grimson Gretzleburg about 2 months ago

This bug still exists on the 2.8.1 beta.

Actions #2

Updated by Steve Wheeler 22 days ago

  • Tracker changed from Bug to Regression
  • Subject changed from Swap fails to activate on updated pfSense 2.8.0 when multiple swap partitions exist to Swap fails to activate when multiple swap partitions exist
  • Target version set to 2.9.0
  • Plus Target Version set to 25.11
  • Affected Architecture All added

Also affects 25.07.(1)

The script change from cut to awk creates an invalid device when multiple SWAP lines are present in the fstab:

[24.03-RELEASE][root@plusdev-4.stevew.lan]/root: swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/ada0p3       1048576        0  1048576     0%
/dev/ada1p3       1048576        0  1048576     0%
Total             2097152        0  2097152     0%
[24.03-RELEASE][root@plusdev-4.stevew.lan]/root: cat /tmp/fstab.swap 
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/efiboot0               /boot/efi       msdosfs rw              2       2
/dev/ada0p3             none    swap    sw              0       0
/dev/ada1p3             none    swap    sw              0       0
[24.03-RELEASE][root@plusdev-4.stevew.lan]/root: /bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1 | /usr/bin/head -n 1 
/dev/ada0p3

[25.07.1-RELEASE][root@plusdev-4.stevew.lan]/root: swapinfo
Device          1K-blocks     Used    Avail Capacity
[25.07.1-RELEASE][root@plusdev-4.stevew.lan]/root: cat /tmp/fstab.swap 
/dev/ada0p3/dev/ada1p3  none    swap    sw      0       0
[25.07.1-RELEASE][root@plusdev-4.stevew.lan]/root: cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/efiboot0               /boot/efi       msdosfs rw              2       2
/dev/ada0p3             none    swap    sw              0       0
/dev/ada1p3             none    swap    sw              0       0
[25.07.1-RELEASE][root@plusdev-4.stevew.lan]/root: /bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1 | /usr/bin/head -n 1
/dev/ada0p3
[25.07.1-RELEASE][root@plusdev-4.stevew.lan]/root: /bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/awk '{ printf $1 }' | /usr/bin/head -n 1
/dev/ada0p3/dev/ada1p3[25.07.1-RELEASE][root@plusdev-4.stevew.lan]/root: 

https://github.com/pfsense/pfsense/commit/025b1ffc374997a9ad832272e566ac4dc0740866

Actions #3

Updated by Steve Wheeler 22 days ago

  • Status changed from New to Pull Request Review
Actions #4

Updated by Anonymous 20 days ago

  • Status changed from Pull Request Review to Feedback
  • % Done changed from 0 to 100
Actions #5

Updated by Jim Pingle 20 days ago

  • Assignee set to Steve Wheeler
Actions

Also available in: Atom PDF