HP-UX 10.x System Administration

Source: http://www.uiuc.edu/ccso/workstation_grp/hp_project/system.admin.html
  • Software Mangement
    • Software on localhost

    • /var/adm/sw/products/ - subdirectories for each product installed
      /var/adm/sw/patch/ - subdirectories for each patch installed
      /usr/sbin/swinstall - install software/patches to localhost
      /usr/sbin/swremove - remove software from localhost
      /usr/sbin/swlist - list software depots installed locally or at a remote depot
    • Software to distribute elsewhere

    • /usr/sbin/swcopy - copy software to local depot for distribution
      /usr/sbin/swremove -d - remove software from a local depot
      /usr/sbin/swacl - modify access control lists of local software depots
  • Environment Setup
    • PATH
    • /usr/bin 
      /usr/ccs/bin /usr/contrib/bin
      /usr/dt/bin     CDE only
      /opt/[dir]/bin  for each [dir] that exists
    • /usr/man
      /usr/dt/bin             CDE only
      /opt/[dir]/share/man    for each [dir] that exists.
      /usr/sbin/catman -w creates file /usr/share/lib/whatis that man -k uses
    • Environment config files
    • /etc/profile
  • User account management
  • Disk and File Systems
    • Without LVM
      • Hard partitions are provided only for models of disks that were supported prior to release 10.0. Hard partitions will not be provided on disks introduced with 10.0 or later.
      • You will not be able to use a partitioned disk for your root disk. You will only be able to use a non-partitioned disk or LVM disk for this purpose.
      Special files: /dev/dsk/c0t3d0  - block device  
                                      - c=controller #
                                      - t=SCSI target #
                                      - d=almost always 0
                     /dev/rdsk/c0t3d0 - character device
                     /dev/rmt/0       - tape device
              To set up a new disk for use:
      /usr/sbin/newfs -F FStype /dev/rdsk/c0t3d0
              By default, short or long filenames will be used based on
              whatever the root filesystem is.
      /sbin/mount /dev/dsk/c0t3d0 /filesystem
      Add it to /etc/fstab for automatic mounting during every boot.
    • With LVM
    • /usr/sbin/pv*   
      /dev/[vol_grp]/[log_vol]        - block device
      /dev/[vol_grp]/r[log_vol]       - character device
      i.e.    /dev/vg01/lvol3
      To set up a new disk for use with LVM:
      /usr/sbin/pvcreate /dev/rdsk/c0t4d0
      /usr/sbin/vgextend /dev/vg01 /dev/dsk/c0t4d0
      /usr/sbin/lvcreate -n test -L 600 /dev/vg01     # creates 600Mb volume
      /usr/sbin/newfs -F hfs /dev/vg01/test
      /usr/bin/mkdir /test
      /sbin/mount /dev/vg01/test /test
      Add it to /etc/fstab for automatic mounting during every boot.
    • /etc/fstab



      Fields are: device special file, mount point, FS type, options, backup frequency (unused), fsck pass number.

      Root volume must have pass number 1 and other volumes must have > 1. Allowed FS types are: swap, swapfs, ignore, hfs, vxfs, cdfs, nfs, or lofs.

      # begin /etc/fstab      
      /dev/vg00/lvol1 / hfs defaults 0 1
      /dev/vg00/lvol3 ... swap defaults 0 0
      /dev/vg00/lvol4 /opt hfs defaults 0 2
      /dev/vg00/lvol5 /tmp hfs defaults 0 2
      /dev/vg00/lvol6 /usr hfs defaults 0 2
      /dev/vg00/lvol7 /var hfs defaults 0 2
      /dev/vg01/scratch /scratch hfs rw,suid 0 2
      /dev/vg01/home2 /home hfs rw,suid,quota 0 2
      /dev/vg01/pub /pub hfs rw,suid 0 2
      /dev/dsk/c1t2d0 /lcdrom10 cdfs ro,suid 0 0
      /dev/vg01/www /usr/www hfs rw,suid 0 2
      derf.cso.uiuc.edu:/home /derf/home nfs rw,suid 0 0
      # end
    • NFS filesystems
    • /etc/exports
      /sbin/init.d/nfs.server start
  • Starting and stopping HPUX
    • Booting
      1. ESC to interrupt boot sequence
        [system will do a search for bootable devices]
        Device Selection        Device Path             Device Type and Utilities
        P0                      scsi.6.0                QUANTUM PD210S
        P1                      scsi.5.0                QUANTUM PD210S
        P2                      scsi.4.0 DDS_tape_drive_identifier 
        P3                      scsi.3.0                TOSHIBA CD-ROM DRIVE:XM
        P4                      lan.123456-789abc       homebase
               b) Boot from specified device
               s) Search for bootable devices
               a) Enter boot administration mode
               x) Exit and continue boot sequence
               ?)  Help
                Enter command:
      2. Enter command: b p0 isl
        [whir buzz]
        ISL> hpux -is boot
      3. Enter command: b p3
    • Shutting down
    • /sbin/shutdown -r -y now
      /sbin/shutdown -h -y now
      /sbin/shutdown -y now
  • System V startup scripts
  • /usr/newconfig
    Run levels:
    • s single user
    • 2 multi-user; no NFS server capabilities
    • 3 multi-user with NFS server
    • 4 same as 3, but with HP VUE
    who -r gives current run level
    to change runlevels:
    /sbin/shutdown -y 0     # to go to single user state
    /sbin/init      # bring the system up in the new runlevel
  • Printing

  • Use /usr/sbin/sam to add/remove/configure printers if possible. If not, /usr/sbin/lpadmin would be a good command to read about. There is quite a bit of help in the HP-UX System Administration Tasks manual (available on LROM).