Swap space priorities

Roy P. Turner (roypt@dopamine.com)
Sun, 12 Jan 1997 00:03:00 -0600


I recently aquired a second hard drive, and installed a second swap
partition on the second disk. I set my /etc/fstab as such to set both my
swap partitions to have equal priority when 'swapon -a' runs at boot (per
the swapon man page), and thus have the system swap equally to both
partitions.

/dev/hda2 swap swap sw,pri=-1
/dev/hdc1 swap swap sw,pri=-1

It appears however that swapon (or the kernel?) completely ignores the
fstab's settings for priorities and assigns them as such.

Adding Swap: 66020k swap-space (priority -1)
Adding Swap: 65988k swap-space (priority -2)

I've tried various equal and non-equal negative and positive values in the
fstab and regardless, swapon always assigns the priorities as above. I'm
running kernel 2.1.17 i386 with swapon from mount-2.5p. The reason I'm
asking here is that the behavior is different when using a 2.0.x kernel.
The 2.0.x kernel gives boot output as such.

Adding Swap: 66020k swap-space
Adding Swap: 65988k swap-space

The 2.0.x kernel shows no priority values assigned, so I'm not sure as to
whether it's assigning equal or different priorities. Does Linux support
multiple swap areas with equal priority value, and if so, what am I doing
wrong? Do I even need to worry about the swap space priorities to have the
system swap to both areas equally. The man pages indicated that the system
would use the higher priority area until full and then swap to the lower
priority area. Any ideas or clueing ins would be greatly appreciated.

Thanks,
Roy