From Wiki-UX.info

How to change kernel parameters using CLI
Jump to: navigation, search

How to change kernel parameters using CLI

Abstract

The kernel parameters can be changed using GUI/TUI from SAM, KCWEB or the System Management Homepage. Alternative, the command line can be use. In order to change a kernel parameter is recommended to have good understanding on the resons and consecuences of the changes, since this may impact impact negatively the performance of the server. The steps presented on this document are a quick overview of the process to change kernel parameters, if you need more details on the process it is recommended to check the References.

Contents

HP-UX 11.0 and 11i

The kernel rebuilding process is accomplished through the following steps:

1. Change directory to /stand/build

# cd /stand/build

2. Create a kernel parameter system file from the running system

# /usr/lbin/sysadm/system_prep -s system

A file called system will be created under /stand/build, and that will be the temporary system configuration file.

3. Make changes to the current system configuration using the kmsystem, kmtune or kmadmin commands.

# kmtune -S /stand/build/system -q maxusers
Parameter             Current Dyn Planned                    Module     Version
===============================================================================
maxusers                   32  -  32

For example we will be changing the maxusers paremeter from a value of 32 to 30

# kmtune -S /stand/build/system -s maxusers=30

To verify that this new value has been included in the system file, by checking the difference from the original set:

# kmtune -S /stand/build/system -d
Parameter             Current Dyn Planned                    Module     Version
===============================================================================
maxusers                   32  -  30

4. While you are in the /stand/build directory, build a new kernel using mk_kernel command:

# /usr/sbin/mk_kernel -s ./system
Generating module: krm...
Compiling conf.c...
Loading the kernel...
Generating kernel symbol table...

5. Backup the old kernel and system files, just in case something goes wrong:

# cp /stand/system  /stand/system.old
# cp /stand/vmunix /stand/vmunix.old
# cd /stand
# cp -R dlkm dlkm.vmunix.old

6. Schedule installation of the new kernel using the kmupdate command. Copy the /stand/build/system file to the /stand/system file.

# kmupdate

 Kernel update request is scheduled.

 Default kernel /stand/vmunix will be updated by
 newly built kernel /stand/build/vmunix_test
 at next system shutdown or startup time.

# cp /stand/build/system /stand/system 

7. Reboot the system

# cd /
# shutdown -ry 0 

After the reboot make sure to check that the parameter has been changed successully with either kmtune or kmsystem commands.


HP-UX 11i v2 and 11i v3

The kernel rebuilding process is accomplished through the following steps:

1. Change directory to /stand/build

# cd /stand/build

2. Create a kernel parameter system file from the running system

# /usr/lbin/sysadm/system_prep -s system

A file called system will be created under /stand/build, and that will be the temporary system configuration file.

3. Make changes to the current system configuration using the kmsystem, kmtune or kmadmin commands.

# kctune -S /stand/build/system -q maxusers
Parameter             Current Dyn Planned                    Module     Version
===============================================================================
maxusers                   32  -  32

For example we will be changing the maxusers paremeter from a value of 32 to 30

# kmtune -S /stand/build/system -s maxusers=30

To verify that this new value has been included in the system file, by checking the difference from the original set:

# kmtune -S /stand/build/system -d
Parameter             Current Dyn Planned                    Module     Version
===============================================================================
maxusers                   32  -  30

4. While you are in the /stand/build directory, build a new kernel using mk_kernel command:

# /usr/sbin/mk_kernel -s ./system
Generating module: krm...
Compiling conf.c...
Loading the kernel...
Generating kernel symbol table...

5. Backup the old kernel and system files, just in case something goes wrong:

# cp /stand/system  /stand/system.old
# cp /stand/vmunix /stand/vmunix.old
# cd /stand
# cp -R dlkm dlkm.vmunix.old

Adding or removing kernel modules

1. Check the current module state with "kcmodule" command. For example, to determinate the VxFS modules that are loaded on the system, use:

# kcmodule vxfs vxfs41 vxportal vxportal41
Module      State   Cause
vxfs        unused
vxfs41      static  best
vxportal    unused
vxportal41  static  best

2. Change module state with "kcmodule" command. For example, to enable the VxFS 3.5 modules and disable the VxFS 4.1, use:

# kcmodule vxfs41=unused vxportal41=unused vxfs=static vxportal=static

7. Reboot the system

# cd /
# shutdown -ry 0 

After the reboot make sure to check that the parameter has been changed successully with either kmtune or kmsystem commands.

References

Autors

This page was last modified on 2 November 2008, at 01:16. This page has been accessed 1,968 times.