Operating System - HP-UX
1834298 Members
1984 Online
110066 Solutions
New Discussion

how to extend the swap after i add memory

 
SOLVED
Go to solution
Rambo_1
Regular Advisor

how to extend the swap after i add memory

Hi ,
The memory in my host is 2GB now ,but i will add it to 6GB, how to extend the swap after i add the memory ?
(it's impossible to re-install the system!)

Thanks
6 REPLIES 6
Stefan Farrelly
Honored Contributor
Solution

Re: how to extend the swap after i add memory

The normal procedure after adding more RAM is add a new swap area. You cant extend the primary swap area (you can but its very difficult and not recommended).

so create a new lvol in vg00 to the size of the extra RAM you just added, add in /etc/fstab set it to swap, then do swapon -a and youre done! (see man swapon)
Im from Palmerston North, New Zealand, but somehow ended up in London...
Jeff Schussele
Honored Contributor

Re: how to extend the swap after i add memory

Hi Rambo,

Assuming that your kernel parameters (maxswapchunks & swchunk) will allow the extra space without extension, all you need to do is:

1) Create a swap LV - create VG if necessary.
2) Add the swap entry to /ets/fstab - this will enable this swap at boot. Entry will look like:
/dev/vg_name/swap_lv_name ... swap pri=0 0 0
3) Run swapon -a

That's it.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bernhard Mueller
Honored Contributor

Re: how to extend the swap after i add memory

Hi,

if you want make it 4GB mirrored and put it in vg00:

create lvol:
lvcreate -L 4196 -m 1 -r n -C y -n lv_swap vg00

add into /etc/fstab:
/dev/vg00/lv_swap swap swap pri=3 0 0

activate:
swapon -a

check
swapinfo -mt

Regards
Bernhard
Thierry Poels_1
Honored Contributor

Re: how to extend the swap after i add memory

hi,

Stefan is correct (as always? :), but if you're unsure about the procedure you can use SAM to add new swap LVOLs.

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
T G Manikandan
Honored Contributor

Re: how to extend the swap after i add memory

rambo,

With the addition of RAM check the utilization of memory and swap.
If the swap which is configured now is not fully used then you can stay with the present amount of memory.

Also,It is not that you need to extend your primary swap size.

You can add secondary swap on a non-system vg and enable it to add to swap area.

Another thing is to note if you are configuring a dump then your swap should be more than the RAM on the machine.

Just add a secondary swap on teh machine.There is no need to extend the primary
Jeff Schussele
Honored Contributor

Re: how to extend the swap after i add memory

Hi Bernhard,

I'm of the belief that secondary swap *especially* on non-vg00 VGs should *always* be given a higher (i.e. lower pri #) simply to keep the traffic off vg00.

My 2 cents,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!