HP UX Cheat Sheet by bbrk364

VIEWS: 3,958 PAGES: 7

									HP-UX Cheat Sheet

This is a document that can be used for revision purposes for HP-UX. Kernel Kernel parms and Hardware. Major numbers (devices) Unix device messages Configuration files Unix Kernel All crash files.

/usr/sbin/sysdef or ioscan –fn lsdev dmesg /etc/rc.config.d /stand/vmunix /var/adm/crash kmadmin kmadmin -s kmadmin -L kmadmin -U kctune (11i) rebuild kernel kctune (11i) sysdef kmtune kmsystem usr/sam/lbin/getkinfo -f /stand/vmunix -o /tmp/kernel.data 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

display loaded modules load modules unload modules set kernel parameters

display kernel parameters

re/build kernel

System Information amount of memory dmesg |grep -I physical /usr/sam/lbin/getmem /opt/ignite/bin/print_manifest /opt/ignite/bin/print_manifest sam > performance monitors > system properties (detailed) model uname -m pvdisplay -v diskinfo -v /dev/rdsk/c0t4d0 (detailed but no serial number)

cpu (type, number, etc)

disk drives disk info serial numbers

HP-UX Cheat Sheet

/opt/ignite/bin/print_manifest ioscan -fn -C disk getconf KERNEL_BITS (11.0) (HPUX < 11.00 all 32 bit) Kernel 32 or 64 Note: determine if system supports 32/64 bits getconf HW_CPU_SUPP_BITS < 10.20: 1. At the system prompt, enter "sysdiag" 2. At the DUI prompt, enter "sysmap" 3. At the ENTER MAP prompt, enter "cpumap" 4. Note the PDC Firmware value 5. At the ENTER MAP prompt, enter "exit" 6. At the DUI prompt, enter "exit" 10.20 >: use mstm (tools manger) trace system calls Daemons NFS daemons server: rpc.mountd, nfsd client:rpc.statd, lockd /etc/exports netdaemons Time daemons /etc/rc.config.d/netdaemons /etc/ntp.conf

Display firmware

Software adding packages/patch removing packages/patch Listing installed packages/patches verify package/patches Adding packages to depot Removing packages to depot listing packages from depot copy software from one depot to another register software

swinstall -s /var/spool/sw swremove swlist -l product PH* (HPUX 10.x) swlist -l patch (HPUX 11) swlist -l -a state swverify swlist -d @ /dev/rmt/0m swremove -d * @ /var/spool/sw swlist -d @ /dev/rmt/0 swlist -d @ /var/spool/sw swcopy -s /dev/rmt/0 @ /var/spool/sw swreg

HP-UX Cheat Sheet

List all files in package configure software Log Files messages syslog mail cron boot sam log Accounts displaying users adding a user removing a user modifying a user password files Network displaying NIC speeds setting NIC speeds display routing table displaying network interfaces Lan device config (interface name, state, mjr number, Hardware path, mac address)

swlist -l <file> swconfig

n/a /var/adm/syslog/syslog.log /var/adm/syslog/mail.log /var/adm/cron/log /var/adm/syslog/syslog.log /var/sam/log/samlog

cat /etc/passwd logins useradd sam userdel sam usermod sam /etc/passwd /tcb/files/auth/r/root (trusted system)

ndd -get ndd -set lanadmin netstat -rn lanscan (all) ifconfig lan0 (individual) lanscan

Lan Diag tool (like a netstat –I and –s Landiag or lanadmin and more) setup dns name service switch file NFS Configuration display nfs shares /etc/resolv.conf /etc/nsswitch.conf

showmount -e localhost

HP-UX Cheat Sheet

cat /etc/xtab create nfs share /etc/rc.config.d/nfsconf (edit) /etc/exports (edit file & add share) exportfs -a /etc/rc.config.d/nfsconf (edit) exportfs -au (unshare all) exportfs -u /home/vallep /etc/exports (edit file & remove file) /sbin/init.d/nfs.core start /sbin/init.d/nfs.server start /sbin/init.d/nfs.client start /sbin/init.d/nfs.client stop /sbin/init.d/nfs.server stop /sbin/init.d/nfs.core stop ps -ef|grep exportfs -a nfsstat

uncreate nfs share

nfs start

nfs stop nfs status nfs reload nfs performance Sam Sam Log file location Console Root only on console

/usr/local/log/samlog

/etc/securetty

Boot (ISL) Boot a particular kernel (standalone) Hpux –is /stand/vmunix Boot in stanalone Boot multi-user Hpux –is boot Hpux –lm boot

Build a new kernel 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 Disk setting the boot device

setboot -p

HP-UX Cheat Sheet

setboot -a format floppy drive mount/unmount floppy mount/unmount CDROM create boot disk or recovery tape boot cdrom/diskette (single user) boot into maintenace mode Display the LIF area (Logical Interchange Format) Display characteristics of a tape drive n/a n/a mount -rF cdfs /dev/mnt recovery tape (preview): make_tape_recovery -v -I -x inc_entire=vg00 >boot pri Interact with IPL? Y ISL>hpux -is >boot pri Interact with IPL? Y ISL>hpux -lm lifls -l /dev/dsk/c0t6d0 lssf /dev/rmt/c4t1d0DESTn

Logical Volume Manager see hpux logical volume manager.DOC for lvm commands mountable drives lvm drives exported drives mounted exported drives create a filesystem create a exported filesystem block devices raw devices info on disk drives df –k change interleave factor A number of disk that have to be running in order for a VG to mount Swap Display swap information /etc/fstab /etc/lvmtab /etc/exports /etc/xtab newfs –F <filesystem type> exportfs-a mkfs –v –C <class> -m <minor #> <device> mkfs –v –r –C <class> -m <minor#> <device> diskinfo bdf mediainit quorum

swapinfo (display in Kb)

HP-UX Cheat Sheet

swapinfo -m (display in Mb) swapinfo -tm (total and Mb) Create logical volume or filesystem swapon <device>|<logical device> swapon -p 3 <device>|<logical device> update /etc/fstab Note: -p = priority swap number Removing swap Misc startup shutdown init status 0 1 2 3 4 5 6 determine the runlevel obtain default run level start xwindows ntp setup force a fsck page size (memory) initialize system Timezone update /dev directory remove device list device drivers console login (allow/deny) 4Kb set_parms initial /etc/TIMEZONE Class: insf -C tape Recreate deleted link: insf -H 0.1.0 -e rmsf lsdev /etc/securetty who -r shutdown -h -g0 -y (halt) shutdown -r -g0 -y (reboot) edit /etc/fstab reboot

Adding swap

HP-UX Cheat Sheet


								
To top