Operating System - HP-UX
1753730 Members
4731 Online
108799 Solutions
New Discussion юеВ

Re: how to increase the primary swap space

 
SOLVED
Go to solution
Animesh Chakraborty
Honored Contributor

how to increase the primary swap space

Hi,
Swap space of my server is configured as :Primary swap /dev/vg00/lvol2 size is 1GB
I want increase it to 2 GB. but while trying to increase swap it gives following error :
The command used to extend logical volumes, /sbin/lvextend, has
failed. The stderr output from the command is shown below. The
logical volume has not been extended.


lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvol2" could not be extended.
Failure possibly caused by contiguous allocation policy.
Failure possibly caused by strict allocation policy

I have enough free space on vg00.

thanks
Animesh
Did you take a backup?
8 REPLIES 8
Tommy Palo
Trusted Contributor

Re: how to increase the primary swap space

Hi,
You could alternatively create a new logical volume for swap eg. lvol9, and set the swap priority lower (probably 1) than the existing swap space.
But ideally, if you have another volume group on another physical disk, you should make the same on that volume group and set the swap priority equal to your existing swap. This would increase swap performance.
Keep it simple
Philip Chan_1
Respected Contributor

Re: how to increase the primary swap space

Hi Animesh,

You have enough free space in your volume group but they're not contiguous, that means consecutive blocks. As I remember one requirement for primary swap is that it must be contiguous, that was the reason why you coudln't extend the swap volume.
CHRIS ANORUO
Honored Contributor

Re: how to increase the primary swap space

As Philip pointed out, the contiguous policy is the reason for not extending the swap space on swap. It is better to create another swap space on the second disk using SAM.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Stefan Schulz
Honored Contributor

Re: how to increase the primary swap space

I agree that this is a problem with the contiguous policy. So you have to add additional swap space instead of extend the existing.

Have a look at swapon(1M), this will tell you all the options you have.

For better swap performance i would recomend using a second swap on a second disk with the same priority.

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Bruce Regittko_1
Esteemed Contributor

Re: how to increase the primary swap space

Hi,

I agree that your best bet is to add secondary swap on another disk rather than increase the size of primary swap. However, if you must, try this:

Use pvdisplay -v on your boot disk and note which extents are used for your primary swap. More importantly, note what logical volume(s) follow the swap extents.

Use pvmove -n to move the other logical volumes onto another disk

Use lvextend to increase your primary swap.

*IMPORTANT* Use pvmove -n to replace the moved logical volumes back onto the boot disk. (Depending on what was moved, you may have an unbootable system if you don't put the lv's back.)

I think these steps will work but I'm not really sure so...

--Bruce
www.stratech.com/training
Animesh Chakraborty
Honored Contributor

Re: how to increase the primary swap space

Hi,
Thanks a lot for your response.
I have created a secondary swap on different VG.

Thanks
Animesh
Did you take a backup?
Stefan Schulz
Honored Contributor
Solution

Re: how to increase the primary swap space

Glad we could help. How about some points?
No Mouse found. System halted. Press Mousebutton to continue.
Bill McNAMARA_1
Honored Contributor

Re: how to increase the primary swap space

you don't want any bad block relocation either.

lvcreate -r n -C y /dev/vgNAME

You need to give points too..
not just to one person!!

Later,
Bill
It works for me (tm)