HP-UX Cheat Sheet
This is a document that can be used for revision purposes for HP-UX.
Kernel| Kernel parms and Hardware. | /usr/sbin/sysdef or ioscan –fn |
| Major numbers (devices) | lsdev |
| Unix device messages | dmesg |
| Configuration files | /etc/rc.config.d |
| Unix Kernel | /stand/vmunix |
| All crash files. | /var/adm/crash |
| display loaded modules | kmadmin kmadmin -s |
| load modules | kmadmin -L |
| unload modules | kmadmin -U |
| set kernel parameters | kctune (11i) rebuild kernel |
| display kernel parameters | kctune (11i) sysdef kmtune kmsystem usr/sam/lbin/getkinfo -f /stand/vmunix -o /tmp/kernel.data |
| re/build kernel | cd /stand/build /usr/lbin/sysadm/system_prep -s system edit system file /usr/sbin/mk_kernel -s ./system mv /stand/system /stand/system.old mv /stand/vmunix /stand/vmunix.old mv /stand/build/system /stand mv /stand/build/vmunix_test /stand/vmunix shutdown -r 0 |
| amount of memory | dmesg |grep -I physical /usr/sam/lbin/getmem /opt/ignite/bin/print_manifest |
cpu (type, number, etc) |
/opt/ignite/bin/print_manifest sam > performance monitors > system properties (detailed) model uname -m |
disk drives |
pvdisplay -v |
disk info serial numbers |
diskinfo -v /dev/rdsk/c0t4d0 (detailed but no serial number) /opt/ignite/bin/print_manifest ioscan -fn -C disk |
Kernel 32 or 64 |
getconf KERNEL_BITS (11.0) (HPUX < 11.00 all 32 bit) Note: determine if system supports 32/64 bits getconf HW_CPU_SUPP_BITS |
Display firmware |
< 10.20: |
trace system calls |
| NFS daemons | server: rpc.mountd, nfsd client:rpc.statd, lockd /etc/exports |
| Time daemons | netdaemons /etc/rc.config.d/netdaemons /etc/ntp.conf |
| adding packages/patch | swinstall -s /var/spool/sw |
| removing packages/patch | swremove |
| Listing installed packages/patches | swlist -l product PH* (HPUX 10.x) swlist -l patch (HPUX 11) |
| verify package/patches | swlist -l swverify |
| Adding packages to depot | swlist -d @ /dev/rmt/0m |
| Removing packages to depot | swremove -d * @ /var/spool/sw |
| listing packages from depot | swlist -d @ /dev/rmt/0 swlist -d @ /var/spool/sw |
| copy software from one depot to another | swcopy -s /dev/rmt/0 @ /var/spool/sw |
| register software | swreg |
| List all files in package | swlist -l <file> |
| configure software | swconfig |
| messages | n/a |
| syslog | /var/adm/syslog/syslog.log |
| /var/adm/syslog/mail.log | |
| cron | /var/adm/cron/log |
| boot | /var/adm/syslog/syslog.log |
| sam log | /var/sam/log/samlog |
| displaying users | cat /etc/passwd logins |
| adding a user | useradd sam |
| removing a user | userdel sam |
| modifying a user | usermod sam |
| password files | /etc/passwd /tcb/files/auth/r/root (trusted system) |
| displaying NIC speeds | ndd -get |
| setting NIC speeds | ndd -set lanadmin |
| display routing table | netstat -rn |
| displaying network interfaces | lanscan (all) ifconfig lan0 (individual) |
| Lan device config (interface name, state, mjr number, Hardware path, mac address) | lanscan |
| Lan Diag tool (like a netstat –I and –s and more) | Landiag or lanadmin |
| setup dns | /etc/resolv.conf |
| name service switch file | /etc/nsswitch.conf |
| display nfs shares | showmount -e localhost cat /etc/xtab |
| create nfs share | /etc/rc.config.d/nfsconf (edit) /etc/exports (edit file & add share) exportfs -a |
| uncreate nfs share | /etc/rc.config.d/nfsconf (edit) exportfs -au (unshare all) exportfs -u /home/vallep /etc/exports (edit file & remove file) |
| nfs start | /sbin/init.d/nfs.core start /sbin/init.d/nfs.server start /sbin/init.d/nfs.client start |
| nfs stop | /sbin/init.d/nfs.client stop /sbin/init.d/nfs.server stop /sbin/init.d/nfs.core stop |
| nfs status | ps -ef|grep |
| nfs reload | exportfs -a |
| nfs performance | nfsstat |
| Sam Log file location | /usr/local/log/samlog |
| Root only on console | /etc/securetty |
| Boot a particular kernel (standalone) | Hpux –is /stand/vmunix |
| Boot in stanalone | Hpux –is boot |
| Boot multi-user | Hpux –lm boot |
| cd /stand/build /usr/lbin/sysadm/system_prem -s system edit system file /usr/sbin/mk_kernel -s ./system mv /stand/system /stand/system.old mv /stand/vmunix /stand/vmunix.old mv /stand/build/system /stand mv /stand/build/vmunix_test /stand/vmunix reboot |
| setting the boot device | setboot -p setboot -a |
| format floppy drive | n/a |
| mount/unmount floppy | n/a |
| mount/unmount CDROM | mount -rF cdfs /dev/mnt |
| create boot disk or recovery tape |
recovery tape (preview): make_tape_recovery -v -I -x inc_entire=vg00 |
| boot cdrom/diskette (single user) |
>boot pri Interact with IPL? Y ISL>hpux -is |
| boot into maintenace mode |
>boot pri Interact with IPL? Y ISL>hpux -lm |
| Display the LIF area (Logical Interchange Format) | lifls -l /dev/dsk/c0t6d0 |
| Display characteristics of a tape drive | lssf /dev/rmt/c4t1d0DESTn |
Logical Volume Manager
see hpux logical volume manager for lvm commands
| mountable drives | /etc/fstab |
| lvm drives | /etc/lvmtab |
| exported drives | /etc/exports |
| mounted exported drives | /etc/xtab |
| create a filesystem | newfs –F <filesystem type> |
| create a exported filesystem | exportfs-a |
| block devices | mkfs –v –C <class> -m <minor #> <device> |
| raw devices | mkfs –v –r –C <class> -m <minor#> <device> |
| info on disk drives | diskinfo |
| df –k | bdf |
| change interleave factor | mediainit |
| A number of disk that have to be running in order for a VG to mount | quorum |
| Display swap information | swapinfo (display in Kb) swapinfo -m (display in Mb) swapinfo -tm (total and Mb) |
| Adding swap | Create logical volume or filesystem
swapon <device>|<logical device> update /etc/fstab Note: -p = priority swap number |
| Removing swap | edit /etc/fstab reboot |
| startup | |
| shutdown | shutdown -h -g0 -y (halt) shutdown -r -g0 -y (reboot) |
| init status 0 1 2 3 4 5 6 |
|
| determine the runlevel | who -r |
| obtain default run level | |
| start xwindows | |
| ntp setup | |
| force a fsck | |
| page size (memory) | 4Kb |
| initialize system | set_parms initial |
| Timezone | /etc/TIMEZONE |
| update /dev directory | Class: insf -C tape Recreate deleted link: insf -H 0.1.0 -e |
| remove device | rmsf |
| list device drivers | lsdev |
| console login (allow/deny) | /etc/securetty |