- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Configure additional swap ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2006 11:29 AM
09-28-2006 11:29 AM
####################################
Hello All,
I have (2) questions :
first question :
I have been using SAM to add swap in the past. I noticed the following (2) commands used by some admins. Do these commands seem safe to use :
1)
lvcreate -l 256 -n swap2 -m 1 /dev/vg00
swapon -a
or
2)
lvcreate -r N -C y -s y -n swap2 -L 8192 /dev/vg00
lvextend -m 1 /dev/vg00/swap2 /dev/dsk/c2t1d0
second question :
If you view the following lvdisplay, there is a lv ( swap1 ) listed, but it does not show up in the swapinfo. Why is this, and can I add it so it will display in the swapinfo.
Thanks Jerry
####################################
current :
# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/swap
reserve - 4096 -4096
memory 41897 23716 18181 57%
total 45993 27812 18181 60% - 0 -
###################################
# vgdisplay -v /dev/vg00 | more
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 11
Open LV 11
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4384
VGDA 4
PE Size (Mbytes) 16
Total PE 8748
Alloc PE 4116
Free PE 4632
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
--- Logical volumes ---
LV Name /dev/vg00/stand
LV Status available/syncd
LV Size (Mbytes) 400
Current LE 25
Allocated PE 50
Used PV 2
LV Name /dev/vg00/swap
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 256
Allocated PE 512
Used PV 2
LV Name /dev/vg00/swap1
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 256
Allocated PE 512
Used PV 2
##########################################
# cat /etc/fstab
# System /etc/fstab file. Static information about the file systems
# See fstab(4) and sam(1M) for further details on configuring devices.
/dev/vg00/root / vxfs delaylog 0 1
/dev/vg00/stand /stand hfs defaults 0 1
/dev/vg00/home /home vxfs delaylog 0 2
/dev/vg00/opt /opt vxfs delaylog 0 2
/dev/vg00/scif /SCIF vxfs delaylog 0 2
/dev/vg00/tmp /tmp vxfs delaylog 0 2
/dev/vg00/usr /usr vxfs delaylog 0 2
/dev/vg00/var /var vxfs delaylog 0 2
/dev/vg00/crash /var/adm/crash vxfs delaylog 0 2
/dev/vg01/u00 /u00 vxfs delaylog 0 2
/dev/vg01/u01 /u01 vxfs delaylog 0 2
/dev/vg01/u02 /u02 vxfs delaylog 0 2
/dev/vg01/u03 /u03 vxfs delaylog 0 2
/dev/vg01/u04 /u04 vxfs delaylog 0 2
/dev/vg01/u05 /u05 vxfs delaylog 0 2
/dev/vg01/u06 /u06 vxfs delaylog 0 2
/dev/vg01/backup /backup vxfs delaylog 0 2
###################################
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2006 12:03 PM
09-28-2006 12:03 PM
SolutionThe commands:
# lvcreate -r N -C y -s y -n swap2 -L 8192 /dev/vg00
# lvextend -m 1 /dev/vg00/swap2 /dev/dsk/c2t1d0
...are quite safe. The first one creates a logical volume that has no bad-block relocation; uses contiguous allocation; and uses strict allocation to keep mirror copies on separate physical volumes. This is what is needed for device swap space. The second command creates a mirrored copy of the logical volume just created. After all, you don't want a failure in a single copy of a swap file to crash your system.
With regard to the second question, the 'swap1' secondary swap device doesn't appear in the 'swapinfo' output because it wasn't included in '/etc/fstab' and thus wan't (re)activated during a boot.
You can activate immediately and in an on-going way (across boots) by doing:
# swapon -p 0 /dev/vg00/swap1
# echo "/dev/vg00/swap1 ... swap pri=0 0 0" >> /etc/fstab
See the manpages for 'lvcreate' and 'swapon' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2006 02:43 PM
09-28-2006 02:43 PM
Re: Configure additional swap ?
First of all I appreciate how well you have put all the information required to answer your questions. This shows that you have taken the effort to read through and understand what you need and are asking for the team to confirm that and guide you.
JRF has already provided asnwers to your questions and there cannot be any further additions to that. Except that I would like to make you aware of few more things while adding swap - you need to check your kernel params - maxswapchunks (and swchunk ) to see if maxswapchunks * swchunk is greater than the actual swap area that you wish to allocate. If not increase the maxswapchunks parameter.
If the above conditions are satisfied, since you already have swap1 defined you can go ahead and add it online and make entry in /etc/fstab for it to get activated each time system boots.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 05:11 AM
09-29-2006 05:11 AM
Re: Configure additional swap ?
1)
# lvcreate -r N -C y -s y -n swap2 -L 8192 /dev/vg00
2)
# lvextend -m 1 /dev/vg00/swap2 /dev/dsk/c2t1d0
3)
# swapon -p 0 /dev/vg00/swap2
4)
# echo "/dev/vg00/swap2 ... swap pri=0 0 0" >> /etc/fstab
****** I plan on lvremoving the swap1 *****
################################
question :
Why do some admins use "swapon -a" ?
################################
These are the (4) kernel parms I plan to change
current :
# kmtune | egrep "dbc|maxswapchunk|swchunk"
dbc_max_pct 5 - 5
dbc_min_pct 20 - 20
maxswapchunks 4096 - 4096
swchunk 2048 - 2048
new:
dbc_max_pct=5
dbc_min_pct=2
maxswapchunk=16384
swchunk=4096
question:
I heard you could kmtune to change kernel parms? I tried the following, but received an error for the "kmtune -u -s dbc_min_pct=2"
# kmtune -l -q dbc_min_pct
Parameter: dbc_min_pct
Current: 20
Planned: 20
Default: 5
Minimum: -
Module: -
Version: -
Dynamic: No
# kmtune -u -s dbc_min_pct=2
kmtune: dbc_min_pct cannot be set dynamically.
Does this mean I have to use SAM ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 05:30 AM
09-29-2006 05:30 AM
Re: Configure additional swap ?
>Why do some admins use "swapon -a" ?
This is the way you activate, or if you prefer enable device on which paging is to take place...
Do a
man 1m swapon
Next question:
Yes you can use kmtune but it doesnt tune all the parametersn only the one that can be done dynamically, the same is true with SAM:
if you change a "static" kernel parameters, sam will ask you a new kernel build and a reboot...
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 05:35 AM
09-29-2006 05:35 AM
Re: Configure additional swap ?
The swapon -a command is explained in the swapon man(1):
"-a Cause all devices marked as swap and all file systems marked as swapfs in the file /etc/fstab to be made available to the paging system"
And to the second question, yes, kmtune is used to set, modify kernel parameters, but there is a sequence of commands to follow to change static kernel parameters, your best option is to go with SAM.
Regards,
Jaime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 05:42 AM
09-29-2006 05:42 AM
Re: Configure additional swap ?
Im the one not clear here!
>kmtune: dbc_min_pct cannot be set dynamically.
>Does this mean I have to use SAM ?
Not necessarily but its the safest (It will check for inconsistencies)
The other option would be modify a system file and generate a new kernel:
My method (standard... maybe obsolete?)
cd /stand/build
/usr/lbin/sysadm/system_prep -s system #generate a system file
vi system # and modify the parameters you wanted
/usr/sbin/mk_kernel -s system
mv /stand/vmunix /stand/vmunix.prev
mv /stand/system /stand/system.prev
mv vmunix_test /stand/vmunix # the new kernel you just done!
mv system /stand/.
Then you reboot
You can use kmupdate also (but I wanted to describe all the process...)
So do a man kmupdate
All the best
Victor