1752796 Members
5957 Online
108789 Solutions
New Discussion юеВ

Re: SwapSpace increase

 
SOLVED
Go to solution
mehul_3
Regular Advisor

SwapSpace increase

Could anybody tell me how to increase a swapspace? Pl send simmple steps to perform with example


Thanks in advance.

Regards
mehul
12 REPLIES 12
Sivakumar TS
Honored Contributor

Re: SwapSpace increase

would create a separate vg for it. After that you can do this to create your addl swap.

Hi Mehul,

You can create and add a secondary SWAP in the system.

Follow the below procedure...

1. # lvcreate -L 400 -n swap1 -C y -r n /dev/vg00

==> this creates a 400MB contigous lv called swap1 in vg00 with bad block reallocation turned off

2. # swapon -p 1 /dev/vg00/swap1

==> enable swap with priority 1.

3. # swapinfo -ta

==> check to see if added swap is enabled.


# vi /etc/fstab
....
/dev/vg01/swap2 ... swap pri=1

==> this makes the change persistent accross reboots,

With Regards,

Siva.
Nothing is Impossible !
mehul_3
Regular Advisor

Re: SwapSpace increase

Ok thanks but few more questions..
We have already swapspace of 6GB installed and this can be shown from the following output and I would like to add an addtional 3GB space on existing one.
# swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 6144 47 6097 1% 0 - 1 /dev/vg00/lvol2
reserve - 3672 -3672
memory 2315 451 1864 19%
total 8459 4170 4289 49% - 0 -

Thanks in advance.
Waiting for your prompt response.

Regards,
Mehul
Yogeeraj_1
Honored Contributor

Re: SwapSpace increase

hi mehul,

easiest way though will be using SAM.

SAM Areas:
Disks and File Systems:
SWAPS

You may as well create additional new swaps!

hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Mark Nieuwboer
Esteemed Contributor

Re: SwapSpace increase

Hi mehul,

You can not easily put more space to you exicting swap.
This is because it's a LV put in place when you install your OS and there for it's protected with a sxtrict allocation policy.
There are ways to go by it but it's not recommanded. There for it's beter to add additional swap as explained. Or ignite your system and make your swap space bigger at the beginning.

Alse when you add additional swap make the kernel change
swapmem=0
tp swapmem=1

Also a document about swap and pseudoswap.
I found it very helpfull.

grtz. Mark
Mark Nieuwboer
Esteemed Contributor

Re: SwapSpace increase

Hi mehul,

You can not easily put more space to you exicting swap.
This is because it's a LV put in place when you install your OS and there for it's protected with a sxtrict allocation policy.
There are ways to go by it but it's not recommanded. There for it's beter to add additional swap as explained. Or ignite your system and make your swap space bigger at the beginning.

Alse when you add additional swap make the kernel change
swapmem=0
tp swapmem=1

Also a document about swap and pseudoswap.
I found it very helpfull.

grtz. Mark
mehul_3
Regular Advisor

Re: SwapSpace increase

Can I simply add space using option add device swap thru SAM. will it allow me to do so?


Regards,
Mehul
mehul_3
Regular Advisor

Re: SwapSpace increase

shall I use modify option thru SAM? instead of doing it by manual command
Mark Nieuwboer
Esteemed Contributor

Re: SwapSpace increase

Yes mehul,

You can do it through sam.
But i'm a prompt geek. i like to do it through the prompt. But no problems to do it by sam.

grtz. mark
mehul_3
Regular Advisor

Re: SwapSpace increase

I have done a following steps to add a swapspace to existing one

$lvlnboot -v /dev/vg00
This will display the current root and swap volumes
(Note: lvol2 is the default primary swap.)
$ lvrmboot -s /dev/vg00
# remove the swap link to the current primary swap.
REBOOT the system into lvm maintenance mode:
$ shutdown -r 0
# reboot

at ISL> boot -lm (;0)/stand/vmunix

$ lvextend -L 12000 /dev/vg00/lvol2 # YYY is new size of lvol
$ lvlnboot -s lvol2 /dev/vg00
# recreate a swap link with the lvol.
$ lvlnboot -R /dev/vg00
# to relink everything
$ shutdown -r 0
# reboot

We have already a enough free space of 15GB in dev/vg00 but surprisingly enough I was unable to extend logical volume giving error message as there is no contigious space.Is it a fragmentation problem.
Pl, guide me in this regard

Thanks
Mehul