HP-UX Tips & Tricks
Gotta confess that installing HP-UX 11i on my Series 9000/856 E55 was not much of a problem after I managed to setup the Mux controller and the terminal correctly. In fact I didn't manage to make the HP terminal communicate with the Mux controller, so I just got a FreeBSD powered PC and used 'cu' for the serial communication. After powering on the HP machine, you should get a message like "To discontinue, press any key within 10 seconds", moment in which you need to press a key. Then it's time to search for the possible boot devices (with the search command). The results (on my computer) look like:
Path Number Device Path Device Type
----------- ----------- -----------
P0 56/36.0 (dec) LAN Module
P1 56/52.2 (dec) Random access media
P2 56/52.5 (dec) Random access media
P3 56/52.6 (dec) Random access media
P4 60/6.0 (dec) LAN Module
Obviously, the "Random access media" devices are the HDDs and the CDROMs, in my case the CDROM being P1. So I can boot from the cdrom using 'boot p1'. The rest of the installation process was relatively painless...
When you want to install via network from another HP-UX box running Ignite-UX, you have to: "boot lan.192.168.0.1 install", where "192.168.0.1" is the IP of the server running Ignite-UX.
As for configuring the machine, I have mostly used 'sam', which is pretty nice.
- Booting HP-UX in single user mode: press enter @ boot time, type in 'boot', and then choose 'interact with IPL. At the IPS prompt type 'hpux -iS' and press enter.
- If the HP box doesn't start by it's own, but rather 'halts' in the boot main menu, then go to IPL and set 'autoboot' to 'on'. This way, the boot process will start automatically (and the HP box will not 'hang' with the 'Attention' led on).
Compiling a new kernel
- First step is to 'cd /stand/build' and to run '/usr/lbin/sysadm/system_prep -s system'. Then you will have to guide yourself by reading the infos generated by 'sysdef' and 'ioscan (-f)' about what kind of drivers you might need for your special hardware. This changes are done through 'kmsystem' (driverswise) and 'kmtune' for the kernel parameters. The 'mk_kernel -s system' creates the new kernel, which will replace the old one by 'kmupdate /stand/build/vmunix_test' (make sure to backup '/stand/system', the rest of the important files like '/stand/vmunix' and '/stand/dlkm' will be backed up for you. Then reboot...
Volume manager/filesystem tips
- When playing around with direct access utilities, like pvcreate, mediainit or so, make sure you are using the 'raw' devices (ex. disks) from "/dev/rdsk", and not the usual disk devices from "/dev/dsk".
- After you have extended a logical volume, with 'lvextend', the 'lvdisplay' will show the new size, but in 'bdf' you will see the old size. For the new size to take effect, you have to 'extendfs' on that logical volume (this needs to be unmounted before 'extendfs' is run).
- A nice tool is Ignite-UX, which can be obtained from http://www.software.hp.com/products/IUX/index.html. It includes an utility, make_recovery, with which you can actually make a bootable tape from which you can restore the operating system. BE CAREFUL: this utility doesn't backup the whole directory tree by default, only the files critical to the OS; you will have to either specify the '-A' flag to it, in order to backup everything, or specify some other files that you'd like backed up. There are two ways of inserting new files that need to be put onto the backup, first way is to edit the file "/var/opt/ignite/recovery/makrec.append" and to add the file path/name, the directory or the software distributor product name that you want included on the backup. Second way is to run make_recovery in preview mode with the '-p' option, and to add/remove files from the archive, and then to resume the make_recovery with the '-r' option. Another useful utility is 'check_recovery', with which you can see if your backup tape is up-to-date or not -- also very useful for seeing the differences in the filesystem (files, directories, permissions) between the backup and the actual layout. In order to use check_recovery, you must have passed the '-C' parameter to 'make_recovery' (unfortunately, HP has dropped support for check_recovery, and of course the '-C' flag for the new 'make_tape_recovery'). Ignite has also a user-interface, see ignite(5) for details.
Tuning & performance
- Majority of kernel counters, which should be consulted when doing the performance analisys are to be found in '/usr/include/sys/vmmeter.h'. One can access these counters directly through '/dev/kmem' or through pstat(2). Of course, the second alternative is better, since reading variables from '/dev/kmem' is not a trivial task. Acquiring the variables' values from '/dev/kmem' implies:
- Determine the matric names by perusing the numerous system include files.
- Call nlist() for each metric name to find the address in the kernel.
- Open the '/dev/kmem' special device file.
- For each of the matrics position the driver to the address and read the variable or structure.