Occasionally, kernel configuration changes are
made that are undesirable. Also, hardware failures and changes can
ruin a previously acceptable kernel configuration. HP-UX has several
mechanisms available to system administrators who need to recover
from such issues, including:
The Automatic Backup Configuration |
 |
The system automatically maintains a saved configuration
called backup. Generally, any time you use the
kernel configuration tools to make a change to the currently running
configuration, the previous (pre-change) configuration is saved to backup. Therefore the backup configuration is somewhat
like the “undo” command in a word processor. In these
cases, if you load the backup configuration using kconfig -l backup, it will reverse the last change you
made to the currently running configuration using the kernel configuration
commands.
Some changes can be made to the currently running
configuration by calling kernel system calls directly. The backup configuration is not updated when those changes
are made.
There are cases in which you may not want this
automatic backup behavior. For example, if you have made an undesirable
change and are trying to fix it, you do not want the kernel configuration
commands to replace a good backup configuration with the one containing
your undesirable change.
The -b off option (keep the existing
backup) can be given in any kernel configuration command to disable
the automatic update of the backup configuration.
When making changes using HP SMH, you can clear the back
up the current configuration before applying change check
box to disable the automatic backup behavior.
When your system first boots, the backup configuration mirrors the configuration that was in use before the
reboot. You may not want this replaced by the first kernel configuration
change you make, especially since the first kernel configuration change
could be made by a startup script before you even get a login prompt.
For this reason, the first configuration changes
after a boot are handled specially. Instead of automatically replacing
the backup configuration, the kernel configuration commands will ask
you whether or not to do so.[4] They will continue to ask, each time you make a change,
until the first time you say Yes. From that point
on, until next boot, they will automatically replace the backup configuration
with each change as described above.
If you want to disable the automatic replacement
of the backup configuration for a particular change, specify -b off. If you want to force an automatic replacement of
the backup configuration, specify -b on (backup).
These options work with any kernel configuration command that makes
configuration changes.
Booting a Saved Configuration |
 |
In extreme circumstances, a mistaken configuration
change can result in a kernel configuration that won’t boot.
In these cases, you have two options: boot a different configuration,
such as the automatic backup configuration, and/or boot in fail-safe
mode (described in “Booting in Fail-Safe Mode”).
Integrity
To boot a saved configuration on an Integrity
system, interrupt the automatic boot process when it reaches the point
that it has started the HP-UX boot loader. (On most systems, this
is during the second 10-second countdown.) At the HPUX> prompt, type
HP 9000
To boot a saved configuration on an HP 9000 system,
interrupt the automatic boot process when you arrive at the boot console
handler. Tell it to boot from the desired device (typically with a boot pri command). When it asks if you want to interact
with the ISL or IPL, say Yes. (The exact mechanism to get to this
point varies; consult your system’s hardware document or the hpux(1M) manpage for details.) At the ISL> prompt, type
In either case, this will boot the saved configuration
named thursday. When the boot is complete, it will
be the currently running configuration; the previous configuration
is lost (unless it was automatically saved as backup).
Booting in Fail-Safe Mode |
 |
The other alternative for recovering from an unbootable
configuration is to boot in fail-safe mode. When you boot the system
in fail-safe mode, your configuration settings are ignored. All kernel
tunables are given fail-safe values and no kernel modules are dynamically
loaded during boot. This method is particularly useful when a hardware
change or failure has caused all of your saved configurations to be
unbootable.
Integrity
To boot an Integrity system in fail-safe mode,
get to the HPUX> prompt as described in “Booting a Saved Configuration” and enter:
HP 9000
To boot an HP 9000 system in fail-safe mode, get
to the ISL> prompt as described in “Booting a Saved Configuration” and enter:
Some HP 9000 systems that have been updated from
earlier versions of HP-UX have boot loaders that do not support the -tm option. On those systems, enter the following instead:
(The two methods can be combined, if you want
to boot a saved configuration in fail-safe mode. This uses the kernel
executable built for the saved configuration, including all of its
static modules, but none of its dynamically loaded modules.)
When you boot the system in fail-safe mode, the
previous kernel configuration will be automatically saved for you,
with a configuration name something like saved_3DE78FA0. The exact name will be printed for you in the boot messages on
the console.
When you boot the system in fail-safe mode, the
boot will stop when you reach single-user mode. At this time you should
take any necessary steps to repair your system or your configuration
and then reboot onto a valid configuration. HP does not recommend
continuing to boot to multiuser mode after a fail-safe boot.
Modifying Tunable Values at Boot Time |
 |
Tunable values can be changed at boot time by
putting tunable settings at the end of the boot loader command line.
These settings have the form tunablename=value, with no embedded white
space. The value must be an integer in either hexadecimal (prefixed
by 0x) or decimal. This value will replace the
value saved in the configuration being booted. (If the value is invalid,
no change is made.)
For example, to change the value of nproc at boot time, do the following:
Boot
the system and stop at the HPUX> (Integrity) or ISL> (HP 9000) prompt, as described in “Booting a Saved Configuration”.
Execute
the boot (Integrity) or hpux (HP 9000) command with optional options and device file, followed
by the tunable assignments, using the following syntax:
boot [option]... [devicefile] [tunable=value]...
hpux [option]... [boot] [devicefile] [tunable=value]...
For example, to boot the backup configuration and set nproc to 6000, the minimum
commands would be:
HPUX> boot backup nproc=6000
|
ISL> hpux backup/vmunix nproc=6000
|
Guidelines for Recovering from Errors |
 |
If you have an undesirable or unbootable kernel
configuration, HP recommends the following approach to resolving the
problem.
If your system is up:
If you know which configuration
change caused the problem:
If your backup configuration
hasn’t been updated since the bad change:
Load the backup configuration
with kconfig –l backup.
Else (your backup configuration
also has the problem in it):
Try to reverse the change
using kcmodule or kctune.
Always specify the –K option
to preserve the backup configuration.
Else (you don’t
know what change caused the problem, or the above didn’t work):
Load a known good configuration
using kconfig –l.
Try the backup configuration first.
Else (your system is down):
If you have had a hardware
failure and now the system won’t boot or if you need to preserve
the bad configuration:
Try booting in fail-safe
mode (see above).
Repair the configuration
or the hardware, then reboot.
Else (no hardware failure,
no need to preserve bad configuration):
Try booting a known good
configuration, such as backup.
Of course, depending on the level of your support
contract with HP, you can call on HP field service personnel to perform
these steps, if needed.
If you get to a point where you cannot boot any
of your saved configurations, even in fail-safe mode, your last resort
is to boot from the HP-UX installation media. If that succeeds, you
do not necessarily have to reinstall HP-UX; you can open a shell and
try to repair your system.