Make the SWAP Space Span 3 disks With Stripping.

Once the system is installed do not forget to configure the priority of the swap spaces. If the priority is set correctly then all your swap spaces will be used as it they are stripped making it faster.

To see the current swap space setup use the command :

swapon -s

The last column “Priority should be the same for all three areas or you will not see the performance gain. In /etc/fstab for the three swap mount lines replace the none with swap and add pri=1, to the sw. You should end up with something like this,

UUID=34a54a33-3b43-f53d45345 swap swap pri=1,sw 0 0

You can stop and start the swap space with :-

swapon -a
swapoff -a

I found this gem of information, but have lost the original link. I think it was from the Ubuntu forums. Thanks.

If you end up getting a corrupt swap space you can reinitialise it with the following:

sudo swapoff /dev/device
sudo mkswap /dev/device
sudo swapon /dev/device

You can also add a label so you can mount with something like this:

LABEL=swap1 swap swap pri=1,sw 0 0
LABEL=swap2 swap swap pri=1,sw 0 0
LABEL=swap3 swap swap pri=1,sw 0 0

To use labels on swap partitions you need to turn off the swap area add the label and turn it back on

sudo swapoff -a
sudo mkswap -L swap1 /dev/sda2
sudo mkswap -L swap2 /dev/sdb2
sudo swapon -a

Although you CAN do this, I’m not sure why!
If you do this you have created three points where a failure will cause your system to halt or be unreliable point. That is is any of the swap file partitions fails you get problems.
If you are doing this to speed up swap file access, ADD MORE RAM!

Leave a Reply

Your email address will not be published. Required fields are marked *