HP-UX

 

HP-UX

 


Overview

  1. Overview
  2. Booting
  3. Mounting CD-ROM
  4. Swap
  5. Perl for HP 10.2
  6. Install Q+A
  7. vi editor
  8. CDE
  9. Backups

 


Booting

To boot into single user mode:

  1. Method #1
    1. Log in as root
    2. Run init 1

  2. Method #2
    1. Interrupt the automatic boot when asked by the system.

    2. At the next prompt, tell the system to boot to the primary boot path. For example, in 10.x, give the command bo pri to boot to the primary boot disk.

    3. It will then ask if you want to interact with the ISL. You reply y.

    4. At the ISL prompt, type: hpux -iS disc(;0)/hp-ux.

    5. The system will now boot into single user mode.

If during the startup procedure, the systems hangs, to move on, press all three of the keys below at the same time:

<Ctrl> <Enter> |

Where "|" is the pipe key. If, after startup, you are unable to reach internet:

route -f
route add default Gateway_IP_Address


Mounting CD-ROMs

Method #1

  1. Run:

    sam | Disks and Filesystems | File Systems | Actions | Create a New Filesystem

  2. Choose non-lvm filesystem. A list will pop up showing the configured disks on the system, one of which will be your CD-ROM.

  3. Fill in the required fields. Use /cdrom for the mount directory.

Method #2

ioscan -fnCdisk
mount -o cdcase /dev/dsk/Cxxxxx /cdrom

Method #3

  1. Determine the device address for the CD-ROM:

    ioscan -fnCdisk

  2. Create a new directory called /cdrom at the root of the file system.

  3. Determine whether the pfs daemon is running by entering the following command:
    # ps -ef | grep pfs

    If the pfs daemon is running, go to step 6. If the pfs daemon is not running, complete steps 4 and 5

  4. Edit the file /etc/pfs_fstab. Add a line similar to the following:

    /dev/dsk/device /cdrom pfs-rrip ro,suid 0 0

  5. Enter the following commands.

    nohup /usr/sbin/pfs_mountd &
    nohup /usr/sbin/pfsd &

  6. Place the CD-ROM and mount:

    # /usr/sbin/pfs_mount /cdrom

  7. To unmount:

    # /usr/sbin/pfs_umount /cdrom

To unmount a CD-ROM

  1. Run umount()
  2. Kill the pfsd and pfs_mountd processes


Swap

Use 2 times amount of RAM for swap.

Every time hpux assigns real memory, it reserves it in swap as well. So if you have a one to one ratio (mem <-> swap), and your memory is almost full (then the swap is almost fully reserved), and a process suddenly asks for a lot of memory, more than what's left in physical, then you get in trouble.

So let's say that you have 1GB of RAM, and you have two processes neding 700 MB of memory each, then you need at least 1.4 GB of swap.

What limits the amount of memory a process uses?

The first limiting factor is probably swap space. The combined virtual data space of all running processes can't exceed swap size. Run /etc/swapinfo -t and look at the total line. That's all you have left.


Perl

To set up perl HP-UX 10.2 respond to the configuration questions as follows:
  1. Use an optimization flag of -O

  2. For additional flags to cc, type in -DJMPCLOBBER.

  3. On additional libraries, only put in -lndbm -lm. Ignore any other libraries that may show up. You can also add -lBSD if you want to add the BSD signal semantics.

  4. When asked to use perl's malloc, you can answer y, but in HP-UX 8.07 and above, HP's malloc will work just fine.

  5. When asked on which boundary a double must be aligned, answer 8 if you are on a 9000/800 or a 9000/700 (server or workstation) series machine, or 2 for a Motorola 68k (Motorola CPU-based architecture) machine. Respond to the configuration questions as follows:


Install Q+A

  1. How do I get swinstall to work with the CD-ROM disk?

    1. Mount the CD-ROM to directory /cdrom.
    2. Run swinstall and specify the software depot as /cdrom.

  2. How do I get swinstall to work with a downloaded distribution residing in /tmp?

    While in the swinstall window, specify the software depot as:

    /tmp/distribution_name.depot.

  3. I used swinstall to install a Java JDK. Why does a "java -version" return nothing?

    First check that the software was actually installed by running swlist. Then verify that the software is in your path by running

    echo $PATH

    If it is not there, set using something like:

    PATH=/path_to_Java:$PATH
    export PATH

  4. Why can't I do anything with the default C compiler?

    The C compiler that is shipped with HP-UX is intended only to rebuild the kernel. It was not intended for use with program development. To get a full blown C compiler, buy the ANSI C program development bundle. Or, you could just get a copy of gcc.

    To verify ANSI C is installed

    swlist | grep ANSI

    If nothing comes back, you don't have ANSI C installed.


vi

Error:
Trying to edit a log file with vi. Process dies with a "line too long" error. One of the lines is 2086 chars long, which is greater than the 2048 value of LINE_MAX as declared in /usr/include/limits.h. Any way of increasing LINE_MAX without rebuilding vi?

Fix: Not a direct solution, one can use the fold(1) command. Other options include using "vis -n" and "inv -n".

Why can't I type an @ character?
You probably have the @ key set to a kill character. To check this, run the command stty -a to see the settings. If it is set to kill, you can reset the kill character by running the command stty kill ^C

In addition, you should add this line to your .profile or .cshrc file to get this option every time you log in.


Backups

  1. To backup your entire system
    make_recovery -AvC -d /dev/rmt/tape-device
    The make-recovery tape creates a bootable backup image of your system that can recover the entire system if necessary.

  2. To backup root's vg00 volume group:
    /opt/ignite/bin/make_recovery -Av -d /dev/rmt/tape-device
    Logging information for the above command goes to: /var/opt/ignite/logs/makrec.log1

  3. To recover from a destroyed "root" vg00:

    1. Put root's vg00 backup into tape drive.
    2. Reboot. On bootup do an interrupt
    3. Choose sea. This will search for all bootable devices.
    4. Choose Change Primary Path.
    5. Choose the tape device.
    6. Type bo to boot

  4. To do file system hot backup with Mirror/Disk

    1. Break the mirror, so the original disk is being used by the system, and the mirror copy is 'frozen'.
    2. Back up the mirror.
    3. When the backup finishes, reconnect the mirror, which will then resync with the original filesystem until they are exact copies again.

  5. To clean up processes to enable file system admin:

    If, while using SAM or doing other system administration work, you are unable to manipulate a file system, it might be because there are open files (processes) currently running on that file system. Use fuser -cu to determine which process ids have open files on or below each mount point. Example

    # fuser -c /DB
    /DB: 6696o 6631o 6695o 6633o

You might want to download and install IgniteUX, a free backup utility. It can be found in the "Software Depot" at the HP web site.