Hi Old-Polack,
You always have very precise and fine explanations. I thank you for this one. (Just one thing : what method do you use to set the priority of the swaps ?)
I have mine set in
fstab. You can change the priority during
run time with the commands;
[root@localhost ~]# swapoff -a <Enter>
if you want
all the swaps turned off at once, or;
[root@localhost ~]# swapoff /dev/<whatever> <Enter>
to turn off a
single swap partition.
To restart with a
priority of 3 as I have;
[root@localhost ~]# swapon -p3 /dev/<whatever> <Enter>
I have my swap partitions
labeled, so use those in the
fstab entries. The settings for
priority, below, are in
blue.
[root@littleboy ~]# cat /etc/fstab |grep swapLABEL=swap200 swap swap
sw,pri=3 0 0
LABEL=swap160 swap swap
sw,pri=3 0.0
LABEL=swap1000 swap swap
sw,pri=3 0 0
LABEL=swap750 swap swap
sw,pri=3 0 0
The actual
priority number used
doesn't really matter, as long as they are
all the same, and a
positive number.
You will note that in the earlier post I had the
swap160 partition turned off when the example was taken, so only the other three were being used. On a reboot, all will start with
equal priority, so there will then be
four heads reading/writing the swap, distributed over the
four drives, rather than the three previously shown. Turning it on now, shows
0 bytes on that partition, as it was
not on when the swapping occurred.
[root@littleboy ~]# swapon -p3 LABEL=swap160[root@littleboy ~]# swapon -sFilename Type Size Used Priority
/dev/sda2 partition 1702880 92976 3
/dev/sdc2 partition 8096752 93056 3
/dev/sde2 partition 6008300 93172 3
/dev/sdb2 partition 1959920 0 3