Re: SWAP Extending in HP-UX (2227 Views)
Reply
Frequent Advisor
Nazaf Khan
Posts: 39
Registered: ‎12-14-2007
Message 1 of 12 (2,227 Views)
Accepted Solution

SWAP Extending in HP-UX

Hi,


I wanted to increase the swap which is 8GB and want to increase to 12GB. Please suggest.


# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 112 8080 1% 0 - 1 /dev/vg00/lvol2
reserve - 4825 -4825
memory 8171 2391 5780 29%
total 16363 7328 9035 45% - 0 -

# lvdisplay -v /dev/vg00/lvol2 | more
--- Logical volumes ---
LV Name /dev/vg00/lvol2
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1 <=== It is mirrored.
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 8192
Current LE 512
Allocated PE 1024
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t0d0s2 512 512
/dev/dsk/c1t1d0s2 512 512

\\\\\\\\ As there is 28.93GB of free space available in the system and as it is mirrored can I use the steps mentioned below.


# vgdisplay -v vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4328
VGDA 4
PE Size (Mbytes) 16
Total PE 8636
Alloc PE 6784
Free PE 1852
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Physical volumes ---
PV Name /dev/dsk/c1t0d0s2
PV Status available
Total PE 4318
Free PE 926
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c1t1d0s2
PV Status available
Total PE 4318
Free PE 926
Autoswitch On
Proactive Polling On


# lvcreate /dev/vg00
# lvcreate /dev/vg00
# lvextend -L 3500 /dev/vg00/lvolN /dev/dsk/c1t0d0s2
# lvextend -L 3500 /dev/vg00/lvolN /dev/dsk/c1t1d0s2
# swapon -p 1 /dev/vg00/lvolN
# swapon -p 1 /dev/vg00/lvolN
# vi /etc/fstab

Add the new swap information to fstab

# swapinfo -tam

Thanks.
Please use plain text.
Frequent Advisor
Nazaf Khan
Posts: 39
Registered: ‎12-14-2007
Message 2 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

I am really sorry. It should be

# lvextend -L 12300 /dev/vg00/lvolN /dev/dsk/c1t0d0s2
# lvextend -L 12300 /dev/vg00/lvol2 /dev/dsk/c1t1d0s2

Am I right.
Please use plain text.
Outstanding Contributor
Pete Randall
Posts: 16,205
Registered: ‎11-03-1996
Message 3 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

It is pretty much impossible to extend primary swap because it needs to be contiguous in itself and contiguous with /stand and /. The easiest way, without reconfiguring your entire system, is to just add secondary swap with a priority equal to primary. Take a look at "man 1m swapon".


Pete

Pete
Please use plain text.
Honored Contributor
Jean-Luc Oudart
Posts: 1,461
Registered: ‎03-10-1998
Message 4 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

Hi

You cannot increase the primary swap space just like that. extents must be contiguous.

Why not just add another swap lvol ?
This can be done online.

Regards
Jean-Luc
fiat lux
Please use plain text.
Frequent Advisor
Nazaf Khan
Posts: 39
Registered: ‎12-14-2007
Message 5 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

Thanks Pete and Jean,

You are correct I cannot increase the Prim-swap as it is. But Can I use the below steps where I am creating the new lvol and will add it to swap with the swapon -p command.

# lvcreate /dev/vg00
# lvcreate /dev/vg00
# lvextend -L 4100 /dev/vg00/lvolN /dev/dsk/c1t0d0s2
# lvextend -L 4100 /dev/vg00/lvolN /dev/dsk/c1t1d0s2
# swapon -p /dev/vg00/lvolN
# swapon -p /dev/vg00/lvolN
# vi /etc/fstab

Add the new swap information to fstab

# swapinfo -tam

Thanks.
Please use plain text.
Super Advisor
ani007
Posts: 219
Registered: ‎02-25-2010
Message 6 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

Create lvol on differnt disk than primary swap disk.

lvcreate -L "xxM" -C y -r n /dev/vgxx

swapon /dev/vgxx/lvolx

Update /etc/fstab as follows.

/dev/vgxx/lvolx . swap pri=x 0 0
Please use plain text.
Frequent Advisor
Nazaf Khan
Posts: 39
Registered: ‎12-14-2007
Message 7 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

Thanks for the reply.

But the issue here is I have 2 VG i.e. Vg01 with 2 internal disk

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t0d0s2 512 512
/dev/dsk/c1t1d0s2 512 512

and Vg01 with only 1 lun which cannot be used to add swap as it cannot be mirrored.


# vgdisplay -v vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4328
VGDA 4
PE Size (Mbytes) 16
Total PE 8636
Alloc PE 6784
Free PE 1852
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Physical volumes ---
PV Name /dev/dsk/c1t0d0s2
PV Status available
Total PE 4318
Free PE 926
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c1t1d0s2
PV Status available
Total PE 4318
Free PE 926
Autoswitch On
Proactive Polling On

\\\\ So shall I get 10GB X2 lun from storage and create a vg02 and then create lv there and then mirror it with lvextend and then add to swap with spapon command as per above command that I had mentioned.
Please use plain text.
Respected Contributor
Bijeesh
Posts: 187
Registered: ‎05-22-2008
Message 8 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

Hi,
You can increase the primary swap space if you have an ignite bakcup(using advanced options).But it requires reboot the server .

To add another LV,refer the below thraed


http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1447356
Please use plain text.
Outstanding Contributor
Pete Randall
Posts: 16,205
Registered: ‎11-03-1996
Message 9 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

Why not use the available free space in vg00?


Pete

Pete
Please use plain text.
Outstanding Contributor
Pete Randall
Posts: 16,205
Registered: ‎11-03-1996
Message 10 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

Just put it in vg00. The only reason to try to spread the I/O load (i.e. better performance through less contention) doesn't make any sense once you start swapping because performance has already degraded so badly.


Pete

Pete
Please use plain text.
Frequent Advisor
Nazaf Khan
Posts: 39
Registered: ‎12-14-2007
Message 11 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

Thanks all for the reply and assistance.
Please use plain text.
Frequent Advisor
Nazaf Khan
Posts: 39
Registered: ‎12-14-2007
Message 12 of 12 (2,227 Views)

Re: SWAP Extending in HP-UX

The Comments were very useful and finally had followed the Pete procedure. Thankx all for your Help again.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation