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.

When mounting a swap partition on Linux, what does the mount option pri=42 mean?

fstab:

/dev/hda1   swap      swap  pri=42       0 0
share|improve this question
8  
42 is obviously a reference to the ultimate question of life, the universe and everything else. –  Tadeusz A. Kadłubowski Oct 12 '09 at 10:33
1  
Or the answer thereto... –  Daniel H Oct 12 '09 at 15:39

3 Answers 3

up vote 5 down vote accepted

Not on any linux distro, I believe ubuntu does not set any swap priority by default, some others might.

You may call man swapon to the rescue ... here is an excerpt:

-p priority

Specify the priority of the swap device. This option is only available if swapon was compiled and is used under a 1.3.2 or later kernel. priority is a value between 0 and 32767. Higher numbers indicate higher priority. See swapon(2) for a full description of swap priorities. Add pri=value to the option field of /etc/fstab for use with swapon -a.

As a side note, you might wonder why set swap default priority to 42, I believe it to be just another reference to the Great Answer.

share|improve this answer
    
Thanks, it was a general theory question, so I couldn't specify distro. –  pypmannetjies Oct 12 '09 at 12:38

The pri is short priority and determines the order in which multiple swap partitions are used. Partitions with a higher value for pri are used first.

share|improve this answer

assume you have 2 swap-partitions, with 'pri' you can tell the os, which swap partion to use first:

pri=n Specifies the swap space priority. The n variable can be 0, 1, 2, 3, 4, with 0 being lowest priority, and 4 being highest priority.

share|improve this answer
1  
where's your source for this? i'm curious. note it's not a perfect match as this indicates a max pri=4 and OP's example includes pri=42. –  quack quixote Oct 12 '09 at 11:27
    
tinyurl.com/yzwsd39 –  akira Oct 12 '09 at 11:38
1  
note, that none of the man pages specify that 42 would be a legitimate option... –  akira Oct 12 '09 at 11:40
    
your link comes from HP's documentation for Compaq Tru64 UNIX v4.0F. the swapon(8) man page for that product indicates this version doesn't support the pri parameter (although it may silently ignore it). –  quack quixote Oct 12 '09 at 12:02
    
i am aware of where the quote originates from. i dont see your point yet. the quoted snippet explains the meaning for 'pri' .. the same way it is mentioned in 'man swapon'. –  akira Oct 12 '09 at 14:02

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.