1834449 Members
2313 Online
110067 Solutions
New Discussion

Kernel Changes

 
Stephen Young_1
Occasional Advisor

Kernel Changes

Hi,

Is it possible to change kernel paramters and re-boot at a later date to allow them to take effect ?.
I have changed parameters in the past using SAM and seem to remember it automatically
re-booting. (HPUX 11.0)

Cheers in advance
6 REPLIES 6
Frederic Sevestre
Honored Contributor

Re: Kernel Changes

Hi,
You can modify some kernel parameters and reboot your server later even using SAM.
Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?
BFA6
Respected Contributor

Re: Kernel Changes

Hi,

In SAM you usually get the option to build kernel, but not put in place or reboot. Later when you are ready you need to move new kernel into place and reboot. You may need to make a backup copy of the running kernel, can't remember if this is done for you.

Hilary
Marcin Wicinski
Trusted Contributor

Re: Kernel Changes

Hi,
It is not possible using SAM. When you chanage kernel parms in SAM, exiting you will be asked to build a new kernel or not. If you choose not to build a new kernel all chages will be lost.
The only way to do that is to copy /stand/system to system.new, edit system.new and kompile a new kernel in an appropriate time with mk_kernel.
Later,
Marcin Wicinski
Steven Sim Kok Leong
Honored Contributor

Re: Kernel Changes

Hi,

Yes, it is possible.

To use HP-UX commands to reconfigure the kernel:

1) Change directory to the build environment (/stand/build). There, execute a system preparation script, system_prep. system_prep writes a system file based on your current kernel in the current directory. (That is, it creates /stand/build/system.)

# cd /stand/build
# /usr/lbin/sysadm/system_prep -v -s system

2) Use the commands kmsystem and kmtune to modify system parameters.

3) Build the new kernel by invoking the mk_kernel command:
# /usr/sbin/mk_kernel -s /stand/build/system
This builds a new kernel ready for testing: /stand/build/vmunix_test and the associated kernel components.

4) Save the old system file by moving it. Then move the new system file into place.
mv /stand/system /stand/system.prev
mv /stand/build/system /stand/system

5) Prepare for rebooting by invoking the kmupdate command. This sets a flag that tells the system to use the new kernel when it restarts.

# /usr/sbin/kmupdate

6) Schedule a cron job to reboot the system at an appropriate timing via crontab -l eg.

0 0 31 12 * /sbin/shutdown -ry 0

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Marcin Wicinski
Trusted Contributor

Re: Kernel Changes

Of course, with SAM you can just build a new kernel and do not move it into right place. At appropriate time move new kernel with kmupdate command.
Marcin Wicinski
Darrell Allen
Honored Contributor

Re: Kernel Changes

Hi Stephen,

From an earlier thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xf3835220af9bd5118ff10090279cd0f9,00.html

Here's my procedure (and 2 cents worth) for building a kernel with SAM and rebooting later.

Use SAM to modify kernel parameters and build new kernel

After all mods are made use
"Actions"
"Process New Kernel"
"Do Not Move Kernel Into Place; Do Not Shutdown / Reboot Now"

note the message concerning location of the new kernel and system file, and running kmupdate

exit out of SAM

Tell the system you've built a new kernel (/stand/build/vmunix_test) and want to use it at the next boot
/usr/sbin/kmupdate

Move the new kernel parameters file (/stand/build/system.SAM) into place
cd /stand
cp -p /stand/system /stand/system.prev
cp -p /stand/build/system.SAM /stand/system

Everything is now set to utilize the new kernel at the next reboot.
Do not make other kernel modifications until after booting the new kernel. You need to test the new kernel and the only true test is to boot and run off it.
Reboot at your convenience (but I wouldn't wait an extended period).

To schedule the reboot:
echo "/usr/sbin/shutdown -r -y 300 >>some_logfile 2>&1" | at 1900

Of course, I hope you check that the system came up okay before your users try it!

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)