Thursday, June 7, 2012

HPUX commands quick Refrence


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 messagesdmesg
Configuration files/etc/rc.config.d
Unix Kernel/stand/vmunix
All crash files./var/adm/crash

display loaded moduleskmadmin
kmadmin -s
load moduleskmadmin -L
unload moduleskmadmin -U
set kernel parameterskctune (11i)
rebuild kernel
display kernel parameterskctune (11i)
sysdef
kmtune
kmsystem
usr/sam/lbin/getkinfo -f /stand/vmunix -o /tmp/kernel.data
re/build kernelcd /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

System Information
amount of memorydmesg |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:
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 daemonsserver: rpc.mountd, nfsd
client:rpc.statd, lockd

/etc/exports
Time daemonsnetdaemons

/etc/rc.config.d/netdaemons
/etc/ntp.conf

Software
adding packages/patchswinstall -s /var/spool/sw
removing packages/patchswremove
Listing installed packages/patchesswlist -l product PH* (HPUX 10.x)
swlist -l patch (HPUX 11)
verify package/patchesswlist -l -a state
swverify
Adding packages to depotswlist -d @ /dev/rmt/0m
Removing packages to depotswremove -d * @ /var/spool/sw
listing packages from depotswlist -d @ /dev/rmt/0
swlist -d @ /var/spool/sw
copy software from one depot to anotherswcopy -s /dev/rmt/0 @ /var/spool/sw
register softwareswreg
List all files in packageswlist -l
configure softwareswconfig

Log Files
messagesn/a
syslog/var/adm/syslog/syslog.log
mail/var/adm/syslog/mail.log
cron/var/adm/cron/log
boot/var/adm/syslog/syslog.log
sam log/var/sam/log/samlog

Accounts
displaying userscat /etc/passwd
logins
adding a useruseradd
sam
removing a useruserdel
sam
modifying a userusermod
sam
password files/etc/passwd
/tcb/files/auth/r/root (trusted system)

Network
displaying NIC speedsndd -get
setting NIC speedsndd -set 
lanadmin
display routing tablenetstat -rn
displaying network interfaceslanscan (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

NFS Configuration
display nfs sharesshowmount -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 statusps -ef|grep
nfs reloadexportfs -a
nfs performancenfsstat

Sam
Sam Log file location/usr/local/log/samlog

Console
Root only on console/etc/securetty

Boot (ISL)
Boot a particular kernel (standalone)Hpux –is /stand/vmunix
Boot in stanaloneHpux –is boot
Boot multi-userHpux –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 devicesetboot -p 
setboot -a
format floppy driven/a
mount/unmount floppyn/a
mount/unmount CDROMmount -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 drivelssf /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 filesystemnewfs –F
create a exported filesystemexportfs-a
block devicesmkfs –v –C -m
raw devicesmkfs –v –r –C -m

info on disk drivesdiskinfo
df –kbdf
change interleave factormediainit
A number of disk that have to be running in order for a VG to mountquorum

Swap
Display swap informationswapinfo (display in Kb)
swapinfo -m (display in Mb)
swapinfo -tm (total and Mb)
Adding swapCreate logical volume or filesystemswapon |
swapon -p 3 |

update /etc/fstab
Note: -p = priority swap number
Removing swapedit /etc/fstab
reboot

Misc
startup 
shutdownshutdown -h -g0 -y (halt)
shutdown -r -g0 -y (reboot)
init status
0
1
2
3
4
5
6
 
determine the runlevelwho -r
obtain default run level 
start xwindows 
ntp setup 
force a fsck 
page size (memory)4Kb
initialize systemset_parms initial
Timezone/etc/TIMEZONE
update /dev directoryClass:
insf -C tape
Recreate deleted link:
insf -H 0.1.0 -e
remove devicermsf
list device driverslsdev
console login (allow/deny)/etc/securetty

No comments:

Post a Comment