1833780 Members
2250 Online
110063 Solutions
New Discussion

swap

 
SOLVED
Go to solution
Maxim Rozin
Frequent Advisor

swap

Hi,

Is it possible to grow a swap lvol online?
Just by "lvextend -L XXXX /dev/vg01/lvolY"?
Or I must create a new lvol and run swapon?

Thanx,
Max.
10 REPLIES 10
Orhan Biyiklioglu
Respected Contributor

Re: swap

http://docs.hp.com/en/5990-8172/ch06s03.html

If you are using logical volumes, you may want to first attempt to extend the disk space allocated for the primary swap logical volume using the lvextend command or SAM. However, you will only succeed if disk space (physical extents) contiguous with the existing swap space is still available, which is unlikely. You must reboot the system for the changes to take effect.

If contiguous disk space is not available, you will need to create a new contiguous logical volume for primary swap within the root volume group, the volume group that contains the root logical volume.
RAC_1
Honored Contributor
Solution

Re: swap

You can not. The lvols /, swap and stand has to be contigous. But why extend that?? You can secondary device swap (better to heve it on seperate disk)
Create a new lvol on seperate disk (seperate than primary swap disk)

lvcreate -L 512 -C y -r n -n devswap /dev/vg01

swapon /dev/vg01/devswap

Edit fstab file.
/dev/vg01/devswap â ¦ swap pri=2 0 0

Priority if set at same as that of primary swap, swapping is done is round robin fashion.
There is no substitute to HARDWORK
Rajesh SB
Esteemed Contributor

Re: swap

Hi,

If your system is installed with OnlineJFS, you can increase swap lvol online using

# fsadm -b

Regards,
Rajesh
Adisuria Wangsadinata_1
Honored Contributor

Re: swap

Hi Max,

The swap need a contigous file system, so the best way is the create a new lvol and run swapon.

Check the document below (docID : KBRC00008533) for your reference about 'Increase swap size - Create a secondary swap' :

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000080021750

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Orhan Biyiklioglu
Respected Contributor

Re: swap

from the same document http://docs.hp.com/en/5990-8172/ch06s03.html

"Two swap areas on different disks perform better than one swap area with the equivalent amount of space. This allows interleaved swapping which means the swap areas are written to concurrently, minimizing disk head movement, thus enhancing performance."
VIKAS AGRAWAL
Frequent Advisor

Re: swap

Hi Maxim ,

Yes it is very much possible to grow the swap lvol online if u are having online JFS.

But I Will not recommand to go for extending the existing swap partion, as system crash chances are there.

so the best option is U can increase the swap size by creating a secoundry swap partion & activate it
Matthew_50
Valued Contributor

Re: swap

recommend to create a new lvol and run swapon.
Maxim Rozin
Frequent Advisor

Re: swap

First of all, thank you all for the quick reply.

I know that it is better to create a new swap lvol. I just want to know if it's possible to grow the swap lvol online.

The swap lvol that I want to increase is a secondary swap device. I created it using "lvcreate -L XXXX /dev/vg01/lvolY" (without -C). There is no filesystem on it.

Some of you, said that it is possible, and some of you said that it's not.
So, is it or is it not?

Max.
Orhan Biyiklioglu
Respected Contributor

Re: swap

Sorry for writing the same thing but it says "You will only succeed if disk space (physical extents) contiguous with the existing swap space is still available, which is unlikely."

Therefore, it is hard to say you can extend it.
Arunvijai_4
Honored Contributor

Re: swap

Check this thread, http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=702002

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"