Operating System - HP-UX
1832952 Members
2657 Online
110048 Solutions
New Discussion

Swapon command on HPUX 11iv1

 
SOLVED
Go to solution
Leslie Fischer
Frequent Advisor

Swapon command on HPUX 11iv1

I built a 8 gig lvol (lvol12) in vg00 to use as secondary swap. I am ready to use the swapon command, but was looking for some documentation that would tell me if my system would reboot since it is on the vg00 volume group. My primary swap is on lvol2 and is 8 gig. My system has 16 gig of memory but we are running out of memory and the swap usage is 61% used, using lvol2. I understand that I do not have to specify the priority because the system will take care of that and assign it. What I don't know is what will happen when I issue the swapon command and if I still have to add the info in the /etc/fstab. If I do, then how come the other lvol2 is not in the fstab file?

Thanks for your help.
Leslie
7 REPLIES 7
Tim Nelson
Honored Contributor
Solution

Re: Swapon command on HPUX 11iv1

swapon -t dev /dev/vg00/lvol12

swapinfo -tam to confirm.

To configure for use after a reboot add line to fstab

/dev/vg00/lvol12 ... swap pri=1 0 2

A reboot is only required to remove an enabled swap area.
Sandman!
Honored Contributor

Re: Swapon command on HPUX 11iv1

Check out the URL below for managing your swap space:

http://docs.hp.com/en/B2355-90950/ch06s03.html#gdpri

The primary swap space is recorded in the BDRA of the boot disk so there is no need for its inclusion in the fstab file. Other swap areas that are initialized should be recorded in the the fstab file. If all swap areas are equally fast then they should have equal priority in order to maximize the benefits of interleaving. However filesystem swap should have lower priority than device swap. Read all about it in the link posted above.

~hope it helps
Leslie Fischer
Frequent Advisor

Re: Swapon command on HPUX 11iv1

Tim,

Not sure what ... means in the line for the fstab file. Are you refering to any entry or literally "...".

I have seen this for an entry:

/dev/vg00/lvol12 / swap pri=1 0 2

Will this work for mine?

It seems that serveral replies refer to adding a line to fstab using ... but not many are the same as far as using pri=3 0 3, some use pri=0 2,
what is the difference?

Thanks,
Leslie
James R. Ferguson
Acclaimed Contributor

Re: Swapon command on HPUX 11iv1

Hi Leslie:

As for priority of your swap devices, I'd make the secondary swap device on vg00 a different priority value (e.g. 0, 2 or 3) than the primary device swap which has a priority of one (1). The device with the lower value will have first preference.

While this doesn't matter if you are not actually swapping (and you don't want to come to that!), in the event that actual swap I/O does occur, you will not degrade your vg00 performance as badly as when priorities are equal and I/O to the swap devices is interleaved. Having different priorities means that the device with the higher priority (lower number) will be used first; then the lower priority device.

As Tim noted, if you don't update 'fstab' with the swap declaration, your additional swap will not be activated after a reboot. The primary swap device is NOT declared in 'fstab' --- only secondary ones.

# /dev/vg00/lvol12 ... swap pri=2 0 0

If on the other hand my secondary swap where on a non-vg00 volume group, I might give priority to it over my primary swap on vg00 with:

# /dev/vg01/lvol1 ... swap pri=0 0 0

Giving the secondary swap on a non-vg00 volume group the preference means less I/O to/from vg00 *IF* you actually swap. After all, if you start swapping you don't want to add pain to pain :-)

Regards!

...JRF...
Leslie Fischer
Frequent Advisor

Re: Swapon command on HPUX 11iv1

Ok, but what does ... mean? Is it a place holder or is it represention for other options? Which could be what?

Tried to look at other docs, but still not sure what to put in the fstab?

Thanks,
Leslie
James R. Ferguson
Acclaimed Contributor

Re: Swapon command on HPUX 11iv1

Hi (again) Leslie:

> Ok, but what does ... mean? Is it a place holder or is it represention for other options?

Yes, indeed, '...' is a place-holder. Look at the manpages for 'fstab(4)':

http://www.docs.hp.com/en/B2355-60127/fstab.4.html

Regards!

...JRF...
Leslie Fischer
Frequent Advisor

Re: Swapon command on HPUX 11iv1

Thanks to all of you, my additional swap works.

Leslie