Swap priorities incorrect - they do not match fstab

Last week I performed an upgrade in place on one of my virtual servers that run under z/VM 6.4. I upgraded from SLES 11 SP4 to SLES 12 SP2.

My servers are all set up with at least 2 swap disks. One is a small (256MB) virtual swap disk and a 3390 mod9 (7048MB) swap disk. The virtual swap disk is supposed to be the primary disk. After the upgrade the physical disk is the primary, but /etc/fstab shows that it should not be.

Output of a section of 'lsdasd':
Bus-ID     Status      Name      Device  Type  BlkSz  Size      Blocks
==============================================================================
0.0.0201   active      dasda     94:0    FBA   512    100MB     204800
0.0.0200   active      dasdb     94:4    ECKD  4096   7042MB    1802880
0.0.0202   active      dasdc     94:8    ECKD  4096   7042MB    1802880

Output of a section of /etc/fstab:
/dev/disk/by-path/ccw-0.0.0201-part1  swap      swap       pri=-1                0  0
/dev/disk/by-path/ccw-0.0.0202-part1  swap      swap       pri=-2                0  0

Output of 'swapon -s':
Filename                                Type            Size    Used    Priority
/dev/dasdc1                             partition       7211420 19496   -1
/dev/dasda1                             partition       101536  0       -2

Any idea why SLES 12 is not honoring the values specified in /etc/fstab? What setting(s) do I need to modify to have the swap priorities set as specified in /etc/fstab?

Harley

Comments

  • x0500hlx0500hl Senior Member
    I found the problem! SLES 12 is now enforcing a range limit on the pri= value specified in /etc/fstab.

    From /var/log/messages:
    2017-09-05T18:36:33.401209-05:00 wcs-mf-winxs-db2t systemd[1]: Failed to parse swap priority "pri=-2", ignoring: Numerical result out of range
    2017-09-05T18:36:33.401211-05:00 wcs-mf-winxs-db2t systemd[1]: Activating swap /dev/disk/by-path/ccw-0.0.0202-part1...
    2017-09-05T18:36:33.401214-05:00 wcs-mf-winxs-db2t systemd[1]: Failed to parse swap priority "pri=-1", ignoring: Numerical result out of range
    2017-09-05T18:36:33.401217-05:00 wcs-mf-winxs-db2t systemd[1]: Activating swap /dev/disk/by-path/ccw-0.0.0201-part1...
    

    Unfortunately, it is enforcing the wrong range. Here is the 'pri=' sections from the man page for swapon(8), on SLES 12 SP2:
    -p, --priority priority
                  Specify the priority of the swap device.  priority is a value between -1 and 32767.  Higher numbers indicate higher priority.  See swapon(2) for  a  full  description  of
                  swap priorities.  Add pri=value to the option field of /etc/fstab for use with swapon -a.  When no priority is defined, it defaults to -1.
    


    Harley
Sign In or Register to comment.