1832617 Members
3576 Online
110043 Solutions
New Discussion

Re: swap increase

 
brian_31
Super Advisor

swap increase

I need to increase the swap from 12g to 18g. here is the current swapinformation.

# swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 3031 1065 74% 0 - 1 /dev/vg00/lvol2
dev 8192 3144 5048 38% 0 - 1 /dev/vg00/lvswap
reserve - 6113 -6113
memory 19248 12554 6694 65%
total 31536 24842 6694 79% - 0 -

How would i accomplish this?

Thanks

Brian

7 REPLIES 7
Jaime Bolanos Rojas.
Honored Contributor

Re: swap increase

Brian, if this thread you will find some good tips on how to increase your swap space:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=905832

Regards,

jaime.
Work hard when the need comes out.
Pete Randall
Outstanding Contributor

Re: swap increase

Set up another LV for swap and enable it using the swapon command.


Pete

Pete
Peter Godron
Honored Contributor

Re: swap increase

Brian,
see
'man 1m lvlnboot'
but I prefer to use SAM.
Ninad_1
Honored Contributor

Re: swap increase

Brian,

From your swapinfo it seems you have 2 swap devices 4 Gb and 8 GB and also have pseudo swap enabled (kernel parameter swapmem_on = 1).
Now If you are asking to have 18G of total swap space or 18GB of physical disk swap space ?
If your answer is 18 GB of swap space [ need not be physical ] then you already have around 31 GB swap space.
If you are asking for 18 GB physical swap space, then you need to add additional of 6 GB physical disk swap space.
For this
1. Determine which volume group you will have your swap space and keep in mind that swap volume needs contiguous disk space.Also you should have swap volume mirrored. So while selecting Volume group you need to have atleast 2 seperate physical disks having 6 GB contiguous space available on each disk.
2. Create lvol for swap
lvcreate -L 6144 -n swap3 -C y -r n /dev/vgname
3. Mirror the swap vol
lvextend -m 1 -s y /dev/vgname/swap3 pv_path
[ pv_path is disk name of the disk which will have the mirror of swap volume]
4. Add entry in /etc/fstab
/dev/vgname/swap3 swap swap defaults 0 0
5. swapon -a

Thats it.

Regards,
Ninad
SGUX
Valued Contributor

Re: swap increase

follow ninad's instruction, this is exactly how i do it and it works fine.
Raj D.
Honored Contributor

Re: swap increase

Brian ,

Create another 6GB lvol , and add this lvol as a swap device.

i] lvcreate ( 6GBlvol say=lvol10 )


ii] add the swap entry in fstab :

/dev/vg00/lvol10 ... swap pri=0 0 0


iii] swapon -a

iv] check ,

# swapinfo -tam
# vmstat 5 20
[ pi/po values should not be non-zero , non-zero value indicates large swapping]

cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Mustafa Gulercan
Respected Contributor

Re: swap increase

you can use sam easyly;
#sam
>disk and file systems>Swap
than Action>Add device swap or Add file system swap

if you wanna extend lvol2 at sam menu;
>disk and file systems>Logical volumes
mark the lvol2 by space key.
Action>Modify and tick the Use Contiguous Allocation.
Action>Increase size

regards;
mustafa