Operating System - HP-UX
1825577 Members
2548 Online
109682 Solutions
New Discussion

Need to Add secondary swap

 
amreek bansal
Frequent Advisor

Need to Add secondary swap

Hi.. I am trying to add additional swap on HP-UX server, but need some help as I am fairly new to HP-UX. The problem is this, The current VG's on the server have no PE's available, so i want to know if I can add another disk into the VG and then extend it and get the swap set up. Does anyone pls tell me how I can check on the server if there are any unused disks on there? Thanks
12 REPLIES 12
avizen9
Esteemed Contributor

Re: Need to Add secondary swap

Hello Amreek,
you can check it through vgdisplay command, before that you should know how much vg are there in your system,
1) strings /etc/lvmtab
this will list out all vg info with physical Hdd path,

2) vgdisplay vgname
this will show you the vg info and also show you how much PE is available there.

3)if you want to add another disk then you have few options

a) add new disk in existing VG and extend existing VG

once you extend you can create new logical volume and swap,
hope this will help





Steven E. Protter
Exalted Contributor

Re: Need to Add secondary swap

Shalom,

Secondary swap can be on any disk with free PE's.

http://docs.hp.com/en/B2355-90950/ch06s03.html

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
amreek bansal
Frequent Advisor

Re: Need to Add secondary swap


Thanks for the reply, its helpful. Going back to the commands 'vgdisplay' and strings /etc/lvmtab, I have ran these commands, the 'vgdisplay' output shows that ther are 3 VG's but no PE left on any of them, so I'm trying to find if there is a unused disk on the server which i could add to the existing VG. I dont know how to find this part out, strings /etc/lvmtab shows alot, but i'm not quite sure on what to look for to see which disk is unused.. ?? pls advise .. thanks.
Sajjad Sahir
Honored Contributor

Re: Need to Add secondary swap



Dear Friend

if u want to check the space availabe in a volume group u can use vgdisplay then volume group name

if u want to see any physical disk is availabe in system but not used

u can use ioscan -funC disk if u are seeing
there is unclaimed disk that means it is not used ok
in volume group once u put the command

vgdisplay then volume group
u can see free physical extent colume multiply with that 4 because each physical extent size is 4 mb
which means 4* free physical extent is free physical extent in that volume group.

lvcreate -C -L size-inMB -n swapname /dev/vgxx
if want to activate swap
use swapon -a command
if u want permanently
make an entry in /etc/fstab file

thanks and regards

Sajjad


amreek bansal
Frequent Advisor

Re: Need to Add secondary swap


Thanks Sajjad. From running 'ioscan -funC disk', I see every disk has 'CLAIMED' on it, so i guess none are available. Is there any aother way around this to increase swap?
blu.karthi
Advisor

Re: Need to Add secondary swap

hi amreek,

use vgdisplay -v to see the used physical volume (disk)by volume groups.


use ioscan -fnkC disk to list disk attached to the machine..

then reduce the disk those who listed on pvdisplay from ioscan...

totaldisk - useddisk = unuseddisk


amreek bansal
Frequent Advisor

Re: Need to Add secondary swap


Hi Blu, Thanks for the reply, WOuld you be able to explian further in details/commands which need to be run as to the below comments,
"use vgdisplay -v to see the used physical volume (disk)by volume groups.


use ioscan -fnkC disk to list disk attached to the machine..

then reduce the disk those who listed on pvdisplay from ioscan..

totaldisk - useddisk = unuseddisk
David P Lavoie
Frequent Advisor

Re: Need to Add secondary swap

Hi Amreek,

What Blu wanted to say is that you should run vgdisplay -v (vg00,vg01, etc) for all vg you got on your system. at the end of each vgdisplay, you'll find the disk used by vgs.

You can also find that information by doing strings /etc/lvmtab. For each entries after /dev/vgxx will list a disk used for that vg.

Also, cat /etc/fstab will list the disk used for a filesystem (if any).

After you've done that, do the ioscan command and select a disk that wasn't listed in previous command. Don't forget that swap space must be continuous. You won't be able to extend your lvol currently used just by adding a disk in you vg00. There are other solutions if you're running on 11.31
Sajjad Sahir
Honored Contributor

Re: Need to Add secondary swap

Dear Bansal

it is very easy

check each volume group
in which volume group u want swap tell us

vgdisply -v /dev/vg##
check space
u know how
see my previous thread

if space there u can create swap space in this volume group
sajjad
Basheer_2
Trusted Contributor

Re: Need to Add secondary swap

Hello Amreek



kctune swchunk=


swchunk values
default = 2048
Recommended for oracle based DB = 4096
MAX = up to 65536 for large RAM

reboot

shutdown -r -y 0

1.pvcreate /dev/rdsk/c29t7d0
2.vgextend /dev/vgswap /dev/dsk/29t7d0
3.lvcreate -L 8192 -n swap2 /dev/vgswap
4.swapon /dev/vgswap/swap2

add the additional swap into /etc/fstab as well so it gets activated automatically at boiot time.

amreek bansal
Frequent Advisor

Re: Need to Add secondary swap


Thanks to everyone who has replied, appreciate your help.

The position I face currently is that by running vgdisplay and strings /etc/lvmtab and ioscan commands all indicate that there is no free disk, all are being used.

So from this, Would you guys suggest to buy another disk ? or perhaps buy some more RAM memory ? or is there another way with the current disks ? Sorry If i'm going over any previous points, But this is my current position I'm facing.. thanks.
avizen9
Esteemed Contributor

Re: Need to Add secondary swap

Hello Amreek,
since you dont have any free space in your vg you can not create new logical volume mean you can not create secondary swap area in this server

my suggestion you can buy new hdd and extend existing vg.

you may can buy RAM but again once you will increase RAM you should have to increase swap accordingly,

Please assign points for all reply, thanks,