Operating System - HP-UX
1836995 Members
2021 Online
110111 Solutions
New Discussion

Re: Need to create swap partiation

 
SOLVED
Go to solution
praveen..
Super Advisor

Need to create swap partiation

Hi,
I have one new HP server.
OS : Hp-ux b.11.23

I have all the OS related file systems under vg00 RAID-1. and each HDDs is of 146GB.

# vgdisplay -v /dev/vg00 | more
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 9
Open LV 9
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4356
VGDA 4
PE Size (Mbytes) 32
Total PE 8702
Alloc PE 1246
Free PE 7456
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Size (Mbytes) 320
Current LE 10
Allocated PE 20
Used PV 2

LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 128
Allocated PE 256
Used PV 2

LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Size (Mbytes) 416
Current LE 13
Allocated PE 26
Used PV 2

LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Size (Mbytes) 224
Current LE 7
Allocated PE 14
Used PV 2

LV Name /dev/vg00/lvol5
LV Status available/syncd
LV Size (Mbytes) 512
Current LE 16
Allocated PE 32
Used PV 2

LV Name /dev/vg00/lvol6
LV Status available/syncd
LV Size (Mbytes) 3296
Current LE 103
Allocated PE 206
Used PV 2

LV Name /dev/vg00/lvol7
LV Status available/syncd
LV Size (Mbytes) 5440
Current LE 170
Allocated PE 340
Used PV 2

LV Name /dev/vg00/lvol8
LV Status available/syncd
LV Size (Mbytes) 4608
Current LE 144
Allocated PE 288
Used PV 2

LV Name /dev/vg00/cims
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 32
Allocated PE 64
Used PV 2


--- Physical volumes ---
PV Name /dev/dsk/c2t1d0s2
PV Status available
Total PE 4346
Free PE 3723
Autoswitch On

PV Name /dev/dsk/c2t0d0s2
PV Status available
Total PE 4356
Free PE 3733
Autoswitch On





and I have a swap partiation of 4GB.

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4095 0% 0 - 1 /dev/vg00/lvol2
reserve - 283 -283
memory 65506 7369 58137 11%
total 69602 7652 61949 11% - 0 -


I want swap partiation should be of 64 GB.

Please suggest.

should i give the below commands:

# lvcreate -C y -r n -L 61440 -n swap2 /dev/vg00

# swapon -p 0 /dev/vg00/swap2

and update the /etc/fstab file.


is it correct and will it be in RAID-1 like other file systems

I want this swap to be RAID-1

Please suggest

Thanks
8 REPLIES 8
Luk Vandenbussche
Honored Contributor
Solution

Re: Need to create swap partiation

You must add the option -m 1 if you want it be a mirrored volume
So the command is

lvcreate -C y -r n -m 1 -L 61440 -n swap2 /dev/vg00
Mark Nieuwboer
Esteemed Contributor

Re: Need to create swap partiation

Hi praveen,

see this tread it's on old one but good.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1000601
it will say what else you have to do to use the swap space even after a reboot.

grtz. Mark
Carlos M.J.
Frequent Advisor

Re: Need to create swap partiation


To do this, you need to create a new logical volume (mirrored).

lvcreate -m 1 /dev/vgXX

SAM is very useful to add a new swap partition using an existing logical volume, you can find it under:

-Disks and Filesystems
--Swap

On "Swap" open "Actions" and then:
Add Device Swap -> Using the logical volume manager...

SAM checks for logical volumes suitable to be a swap partition and modifies /etc/fstab for you.

Hope this helps.

Best regards.
Carlos M.J.
Frequent Advisor

Re: Need to create swap partiation


To do this, you need to create a new logical volume (mirrored).

lvcreate -m 1 /dev/vgXX

SAM is very useful (and comfortable) to add a new swap partition using an existing logical volume, you can find it under:

-Disks and Filesystems
--Swap

On "Swap" open "Actions" and then:
Add Device Swap -> Using the logical volume manager...

SAM checks for logical volumes suitable to be a swap partition and modifies /etc/fstab for you.

SAM also warns you in case you need to modify "maxswapchunks" kernel parameter.

Hope this helps.
Best regards.
praveen..
Super Advisor

Re: Need to create swap partiation

I gave these commands:

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4095 0% 0 - 1 /dev/vg00/lvol2
reserve - 283 -283
memory 65506 7369 58137 11%
total 69602 7652 61949 11% - 0 -

#lvcreate -C y -r n -m 1 -L 61440 -n swap2 /dev/vg00

# swapon -p 0 /dev/vg00/swap2
Unable to add all swap from device: /dev/vg00/swap2.
12744 remaining chunks in swap table, need 25486.
Increase the tunable parameter swchunk to 5888 or more
and re-configure your system.
swapon: The kernel tunable parameter "swchunk"
needs to be increased to completely enable paging
on device /dev/vg00/swap2.root@hostname.com


# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4095 0% 0 - 1 /dev/vg00/lvol2
dev 61440 0 32769 0% 0 - 0 /dev/vg00/swap2
reserve - 290 -290
memory 65506 7497 58009 11%
total 131042 7787 94583 6% - 0 -




it is showing only "dev 61440 0 32769 0% 0 - 0 /dev/vg00/swap2
"

I think i need to change the kernal parameter "swchunck"

current value of swchuck is..
swchunk 2304 2304 no

should i change it to 5888.

after changing this value, Please let me know should i give this command again directly:

# swapon -p 0 /dev/vg00/swap2


Please suggest
Thanks

Patrick Wallek
Honored Contributor

Re: Need to create swap partiation

Yes, you need to update swchunk per the instructions the system gave you.

If you have already added /dev/vg00/swap2 to /etc/fstab, then no you do not need to reactivate it manually after you reboot.

If you don't have it in /etc/fstab, then yes you will need to do a 'swapon' again.
praveen..
Super Advisor

Re: Need to create swap partiation

does it requires a reboot?
praveen..
Super Advisor

Re: Need to create swap partiation

I changed the swchuck value to 5888 & update the fstab file.


and then i restart the server.
now it working fine...

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4094 0% 0 - 1 /dev/vg00/lvol2
dev 61440 0 61439 0% 0 - 1 /dev/vg00/swap2
reserve - 238 -238
memory 65506 7113 58393 11%
total 131042 7351 123688 6% - 0 -



Thanks everybody