Operating System - HP-UX
1753317 Members
5129 Online
108792 Solutions
New Discussion юеВ

Re: HOW TO INCREASE SWAP SPACE

 
SOLVED
Go to solution

HOW TO INCREASE SWAP SPACE

Am doing an installation on rx 3600 running HP-UX B.11.31 but the installation cannot continue since the recommended swap space is 49 GB and yet the server has 23GB. I cannot extend the swap space and when i try to extend i get the below error:
# lvextend -L 50000 /dev/vg00/lvol2
Warning: rounding up logical volume size to extent boundary at size "50016" MB.
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
.........................................
Yet i have still have about 125GB unused space:

File System layout

LVM Device file mount point size fs type
/dev/vg00:
/dev/vg00/lvol1 /stand 1792 vxfs
/dev/vg00/lvol2 swap 8192
/dev/vg00/lvol3 / 1024 vxfs
/dev/vg00/lvol4 /tmp 1024 vxfs
/dev/vg00/lvol5 /home 6144 vxfs
/dev/vg00/lvol6 /opt 7040 vxfs
/dev/vg00/lvol7 /usr 10240 vxfs
/dev/vg00/lvol8 /var 8704 vxfs
/dev/vg00/lvol9 /oracle 307200vxfs
/dev/vg00/lvol10 /sapmnt 10016 vxfs
/dev/vg00/lvol11 /dump 70016 vxfs
/dev/vg00 unallocated 125888

Again swapinfo -ta has the following information:
# swapinfo -ta
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
reserve - 459264 -459264
memory 15927756 2007980 13919776 13%
total 24316364 2467244 21849120 10% - 0 -
...............................................

How can i increase this space to be able to do the installation.Any assistance!
Thanks
Regards,
Eric.
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: HOW TO INCREASE SWAP SPACE

Hi Eric:

You don't need to extend primary swap --- and as you have found, you can't easily do it. Generally you would re-ignite your server and choose a larger primary swap then.

Device swap space must be allocated contiguously. That is, without intervening disk extents used or free for another logical volume.

All this is moot. All you need to do is allocate secondary device swap somewhere. Whether or not it resides on vg00 is immaterial.

Secondary or primary device swap are equivalent. Simply add secondary device swap.

Do something like:

# lvcreate -C y -r n -L 32768 -n lvolN /dev/vgXX
# swapon -p /dev/vgXX/lvolN

See the manpages for more information. You can do this without a reboot. Remember to add activation of the secondary device swap so built to '/etc/fstab':

/dev/vgXX/lvolN ... swap pri=0 0 0

As you can see, the secondary device swap can be on any volume group you choose.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: HOW TO INCREASE SWAP SPACE

Just add another swap device. That will be the easiest. You cannot increase primary swap (vg00/lvol2) without reinstalling the OS (well, you can but it is quite involved).

AVV
Super Advisor

Re: HOW TO INCREASE SWAP SPACE

Hi,

Note that root,/stand,swap volumes must be continuous allocation. Normally, when we create the 4th partition, Continuous allocation space ends as this volume occupy the next available PE. So, it is hard to do a swap extension but surely possible.

In this scenario, you can go ahead by creating a new lvol and enable as a swap fs as mentioned above. While creating lvol for swap , do remember to use switches with lvcreate command -C y and -r n (enabling continuous allocation and bbr disabling.)

Do a swapon on that. Never do fsadm or mkfs on that raw lvol.

Cheers
Tingli
Esteemed Contributor

Re: HOW TO INCREASE SWAP SPACE

Adding a new device for swap actually will have a better performance than expanding the main swap space. It can be done easily in sam in not time as far as the device is available.
James R. Ferguson
Acclaimed Contributor

Re: HOW TO INCREASE SWAP SPACE

Hi (again):

> Tingli: Adding a new device for swap actually will have a better performance than expanding the main swap space.

Not really. You don't want to do swap I/O ever. When you do, your performance is already degraded. Too, if you put a secondary swap device on vg00 with the same priority as the primary device, *and* you actually force I/O, you may see lots of disk head movement which will further degrade performance. But then to paraphrase a friend of mine --- if the ship is sinking, who cares where you sit? :-)

Regards!

...JRF...
Johnson Punniyalingam
Honored Contributor

Re: HOW TO INCREASE SWAP SPACE

TRC member since: July 22, 2006
Last contribution date: January 19, 2010
I have assigned points to 0 of 22 responses to my questions.<<<

It would be nice and appreciate for the people who gave their advice & suggestion on your problems by assign points, so far you assigned 0 - points
Problems are common to all, but attitude makes the difference
Johnson Punniyalingam
Honored Contributor
Solution

Re: HOW TO INCREASE SWAP SPACE

Since your primary swap lvolxx2 already exists in vg00 and the fact that the swap must be contiguous on the physical disk, the better way to increase the size of the swap is to add an other disk and use it to
create a secondary swap. Here is the procedure to do it:


please see below steps to creating / adding secondary swap


Create the physical volume on the disk:

# pvcreate /dev/rdsk/cxtxdx

Create vg directory:
# mkdir /dev/vgxx

Create the device file for your new character device:

# mknod /dev/vgxx/group c 64 0x014000

NOTE: "vgnn: nn" is the vg number in decimal, "c" = character device, "64"
= driver number, "0xnn0000: nn" is the vg number in hexadecimal)

Create the volume group which will contain your secondary swap:
# vgcreate /dev/vgxx /dev/dsk/cxtxdx

Create the logical volume for your secondary swap:
# lvcreate -L 128 /dev/vgxx

NOTE: "-L 128" is the size of desired swap

Verify the physical volume:

# pvdisplay /dev/dsk/cxtxdx

Verify the physical volume assigned to volume group:
# vgdisplay -v

Verify the logical volume:
# lvdisplay /dev/vg14/lvolxx15

Use SAM to declare your new secondary swap or use the command line:
# swapon /dev/vg14/lvolxx15

Verify it has been added in "/etc/fstab" when using SAM, or add it manually when using the command line.

Example:
/dev/vg14/lvolxx15 . swap defaults 0 0
Problems are common to all, but attitude makes the difference

Re: HOW TO INCREASE SWAP SPACE

James R. Ferguson,
I managed to create the space -it worked.
Created the secondary swap. The below were the procedure:
#lvcreate -C y -n lvol14 -n lvol14 /dev/vg00
#lvextend -L 50000 /dev/vg00/lvol14 /dev/dsk/c2t3d0
Added the below entry to the /ect/fstab to enable automatic swap activation at boot time:
/dev/vg00/lvol14 /swap swap defaults 0 0
Manually activated the space for swap devices defined in /etc/fstab with the command:
#swapon -a
The confirmed that it has been activated by:
#swapinfo -tm and it was ok and everything worked.
Thanks alot James plus the rest of the members who participated and assisted. James have already awarded you poitns.
Regards,
Eric.

Re: HOW TO INCREASE SWAP SPACE

Thanks alot to the memmbers who gave wonderful solution ideas, James it was ok.
Great.
ERic.