Operating System - HP-UX
1844122 Members
3147 Online
110227 Solutions
New Discussion

procedures to add swap space

 
Wei_9
Occasional Advisor

procedures to add swap space

Are there any standard steps to add swap space
on a running server?

Thanks.

Wei
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor

Re: procedures to add swap space

If maxswapchunks is big enough to accomodate the additional swap space then you can do this without a reboot but otherwise a new kernel will need to be built.

You then edit /etc/fstab and make an entry for the new swap space. You then simply issue a swapon -a command and the new swap space will be added. Man 1m swapon for details.
If it ain't broke, I can fix that.
Michael Tully
Honored Contributor

Re: procedures to add swap space

A very quick way e.g.:

# lvcreate -n swap1 /dev/myvg
# lvextend -L 1024 /dev/myvg/swap1
# swapon /dev/myvg/swap1

As suggested make sure your 'maxswapchunks' are big enough.

You can also use SAM to do this task.
Anyone for a Mutiny ?
A. Clay Stephenson
Acclaimed Contributor

Re: procedures to add swap space

Note that if you don't make an entry in /etc/fstab that the swap space will not be automatically included upon the next boot; that's why I suggested making the entry in /etc/fstab and then doing a swapon -a --- your fstab syntax will then be checked as well.
If it ain't broke, I can fix that.
Michael Tully
Honored Contributor

Re: procedures to add swap space

Here is an example entry for adding into /etc/fstab

/dev/myvg/swap1 ... swap pri=1 0 0
Anyone for a Mutiny ?
Suresh Patoria
Super Advisor

Re: procedures to add swap space

Hi,

You cann't extend ur current swap logical volume
because it is cotinous space

but you can add the other swap device like ur logical volume or the directory

create the logical volume
use the raw logical volume for the better performance

swapon /dev/vgxx/rlvolx
swapon /<>
And put the entry in /etc/fstab file to enable at boot of the system

Thanx & Regards,
Suresh Patoria
Suresh Patoria
Super Advisor

Re: procedures to add swap space

Hi,

You can check the status of the swap memory using the swapinfo -tm command

Thanx
Ravi_8
Honored Contributor

Re: procedures to add swap space

Hi

#lvcreate -L -n swap1 /dev/vgxx
#swapon -s /dev/vgxx/swap1

make entry in /etc/fstab
/dev/vgxx/swap1 ... swap p=0 0 0
never give up
G. Vrijhoeven
Honored Contributor

Re: procedures to add swap space

Hi Wei,

Like the others have mentioned.

create an lvol and activate swap on this lvol with the swapon command. Add this info in /etc/lvmtab.

You need to check a few things first.
1. The maxswapchunks parameter.. e.g. do you have free chunks to anable in your kernel.
2. Is your disk/lvol ever userd before. if so use the swapon -f flagg check man swapon)
3. Prio. Use this to loadbalance.

HTH,

Gideon