I'm using two swap disks. Changing the order they are in in /etc/fstab and using "pri" in fstab doesn't have any effect.

This is what it looks like /etc/fstab

#swap on other disk
UUID=90a1550c-84d6-4bde-8bc1-7c15292980f1 none            swap    sw,pri=-1              0       0

#swap on same disk
UUID=13b70e65-f1c3-4728-920f-9e92467d1df0 none            swap    sw,pri=-2              0       0

This is the output of swapon -s

Filename            Type        Size       Used   Priority
/dev/sda1           partition   2562328 176    -1
/dev/sdb1           partition   2562328 0      -2

Its opposite of what it is in fstab, and changes to fstab have no effect.

link|improve this question

74% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Actually, the order doesn't affect priority. However, the pri setting is what you need. Could you add some lines of /etc/fstab that don't work for you?

link|improve this answer
It's been added. – OSX NINJA Aug 8 '10 at 14:49
Hm, everything seems to be ok... What is the actual order of using these swap partitions using the settings above? – eigenein Aug 8 '10 at 18:16
I see that /dev/sda is being used as first that's expected because -1 is higher than -2. Doesn't an exchange of -1 and -2 have any effect? – eigenein Aug 9 '10 at 0:08
Exchanging them doesn't have an effect but if I set one to a positive number it does. – OSX NINJA Aug 9 '10 at 11:47
Accordingly to man page, a priority is a non-negative integer, however two and more swaps with negative priority should work... It's not easy for me to understand why -1 and -2 don't work. – eigenein Aug 9 '10 at 15:01
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.