Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

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?

share|improve this answer
    
It's been added. –  tony_sid 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. –  tony_sid 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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