LVM and VxVM
Showing results for 
Search instead for 
Do you mean 

SWAP Extending in HP-UX

SOLVED
Go to Solution
Frequent Advisor

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.
11 REPLIES
Frequent Advisor

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.
Outstanding Contributor Outstanding Contributor

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
Honored Contributor Honored Contributor

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
Frequent Advisor

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.
Super Advisor Super Advisor

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
Frequent Advisor

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.
Respected Contributor Respected Contributor

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
Outstanding Contributor Outstanding Contributor

Re: SWAP Extending in HP-UX

Why not use the available free space in vg00?


Pete

Pete
Highlighted
Outstanding Contributor Outstanding Contributor

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
Frequent Advisor

Re: SWAP Extending in HP-UX

Thanks all for the reply and assistance.
Frequent Advisor

Re: SWAP Extending in HP-UX

The Comments were very useful and finally had followed the Pete procedure. Thankx all for your Help again.