maniu@securebrain.com:~#


maniu@securebrain.com:~# vi hp-ux

 

Directory Mappings   
Root filesystem /
  {/dev/vg00/lvol1}
Home Directory /home    
  {/dev/vg00/lvol4}
tmp Directory /tmp      
  {/dev/vg00/lvol6}
usr Directory /usr
  {/dev/vg00/lvol7}
var Directory /var
  {/dev/vg00/lvol8}
Sample configuration files /usr/newconfig
 
User Accounts  
Password files /etc/passwd
  /tcb/files/auth/r/root
Groups file /etc/group
  /etc/logingroup
Maximum # of user ID 2147483647
Allow/Deny remote login /etc/securetty
  {console}
User nobody's id # -2
Group nobody's id # -2(nogroup)
Recover root password >boot
  Interact with IPL ? Y
  ISL>hpux -iS
  passwd root
Create new user useradd
Delete user userdel
List users logins
Modify user account usermod
General Commands  
Unique host ID uname -i
Administrator sam
Performance monitor top
  glance
System activity reporter sar
Virtual Memory statistics vmstat
I/O statistics iostat
Error logs dmesg
Physical RAM 4TB
Shared Memory 8TB
Process Data Space 4GB
Swap device /dev/vg00/lvol2
Swap file type swap
Display swap size swapinfo -a
Activate Swap swapon -a
 

Printers

 
Printer Queues /etc/lp/interface/*
Stop LP  lpshut
Start LP lpsched
Submit print jobs lp
LP statistics lpstat
Remove print jobs cancel
Add printer queue lpadmin -p pq
Remove Printer queue lpadmin -x pq
Make default printer lpadmin -d pq
 

TCP/IP

 
Network IP configuration /etc/rc.config.d/netconf
Hosts IP addresses /etc/hosts
Name service switch /etc/nsswitch.conf
Network parameters ndd -h
Routing daemon gated
NIC Configurations lanscan -v
Secondary IP Address ifconfig lan0:1 IP 
Login prompt telnetd -b /etc/issue 
Increase the # of pseudo-terminals rebuild your kernel with these new values NPTY=# 
  NSTRPY=#
  reboot
  insf -d ptys -n #
  insf -d ptym -n #
  insf -d pts -s # -e -v
Maximum # of ptys {MAXUSERS}
Remote Shell remsh
YP/NIS service binder /usr/lib/netsvc/yp/ypbind 
 

System Files

 
NFS exported /etc/exports
NFS Client mounted directories /etc/xtab
Max File System 128 GB
Max File Size 128 GB
Max # File Descriptors 60~ K
 

DISK/LVM Commands

 
Filesystem table /etc/fstab
Free disk blocks bdf
Device listing /sbin/ioscan
Disk information diskinfo /dev/rdsk/c#t#d#
Disk Label pvdisplay -v /dev/dsk/C#t#d#
LVM Concepts logical extents
  logical volume
  volume group
Journal Filesystem type vxfs
Default volume group /dev/vg00
Display volume group vgdisplay -v vg00
Modify physical volume pvchange
Prepare physical disk pvcreate
List physical volume pvdisplay
Remove disk from volume group vgreduce
Move logical volumes to another physical volumes pvmove
Create volume group vgcreate
Remove volume group vgremove
Volume group availability vgchange
Restore volume group vgcfgrestore
 

DISK/LVM Commands

 
Exports volume group vgexport
Imports volume group vgimport
Volume group listing vgscan
Change logical volume characteristics  lvchange
List logical volume lvdisplay
Make logical volume lvcreate
Extend logical volume lvextend
Reduce logical volume lvreduce
Remove logical volume lvremove
Prepare boot volumes lvlnboot
Remove boot volumes lvrmboot
Extend File system extendfs /dev/vg00/lvol8
  fsadm -F vxfs -b {LE * 1024} /mt
Reduce/Split mirrors lvsplit
Merge mirrors lvmerge
Create mirrors lvcreate -m 1
Add mirrors lvextend -m 1
Create striped volumes lvcreate -i 3 -I 64
System recovery tape /opt/ignite/bin/make_recovery
Backup fbackup
Restore frecover
 

MISC

 
Startup script /sbin/rc
Kernel /stand/vmunix
Kernel Parameters sysdef
  kmtune
  kmsystem
Reconfigure the kernel cd /stand/build
  /usr/lbin/sysadm/system_prep -v -s system
  vi system
  mk_kernel -s system
  cd /stand
  mv system system.prev
  mv vmunix vmunix.prev
  mv dlkm dlkm.prev
  mv /stand/build/system system
  kmupdate /stand/build/vmunix_test
List modules kmadmin -s
Load module kmadmin -L
Unload module kmadmin -U
Initialize system set_parms initial
Physical RAM grep -i Physical /var/adm/syslog/syslog.log
Kernel Bits getconf KERNEL_BITS
Crash utility adb
Trace System Calls tusc
Machine model model
  uname -m
OS Level uname -r
Run Level who -r
Core dump files /var/adm/crash
Boot single user >boot
  Interact with IPL ? Y
  ISL>hpux -iS
Maintenance mode >boot
  Interact with IPL ? Y
  ISL>hpux -lm
Interrupt Key control-B
Return to console co
Timezone Management /etc/TIMEZONE
NTP Daemon /etc/rc.config.d/netdaemons
  /sbin/init.d/xntpd

Software

 
Install Software swinstall
Uninstall software swremove
List installed software swlist
Verify installed software swlist -l fileset -a state
List all files swlist -l file fileset
List installed patches swlist -l patch
  what /stand/vmunix
Package owner swlist -l file | grep path
SW Directory /var/adm/sw/

 

Devices

 
Devices /dev
Install devices for attached peripherals insf -e
Remove device rmsf
Device drivers lsdev
CPU ioscan -fnC processor
List Terminal ioscan -fnC tty
Diagnostics stm
Whole Disk /dev/dsk/c#t#d0
CDROM /dev/dsk/c#t2d0
CDROM file type cdfs
Rewinding tape drive /dev/rmt/0m
Non-rewinding tape drive /dev/rmt/0mn
 

Links

Free Software

HP-UX Ports


 

 

 

Comandi Vari SO HP

 

Per rimuovere un disco dal VG

 

  1. Smontare il FS “umount /pippo/pluto”
    NON si può eliminare un LV dal VG se prima non si smonta il FS

  2. Rimuovere il LV da VG “lvremove /dev/vg01/lv01”

  3. Rimuovere il disco dal VG “vgreduce /dev/vg01 /dev/dsk/c1t4d0”

  4. Rimuove il VG (se si vuole) “vgremove /dev/vg01”

 

Eliminando il LV/VG si devono aggiornare le informazioni contenute nel file /etc/fstab

 

Per Creare un nuovo PV/VG/LV/FS

 

  1. creare il PV “pvcreate /dev/rdisk/c1t4d0”
    Quando si creano i PV la definizione di dischi si dà come rdevice

  2. creare il VG “vgcreate –n vg01 /dev/dsk/c1t4d0”
    Se non si passa il nome del VG “-n vg01” il nome verrà assegnato automaticamente

  3. creare il LV “lvcreate –n lv01 /dev/vg01”
    Se non si passa il nome del LV “-n lv01” il nome verrà assegnato automaticamente

  4. estendere il LV “lvextend –L 3300 /dev/vg01/lv01 /dev/dsk/c1t4d0”
    l’opzione « -L 3300 » è la dimensione del LV espressa in Mb
    se il disco è mirrorato si deve aggiungere il anche l’altro disco

  5. creare il FS “newfs –F vxfs –b 8192 /dev/vg01/rlv01”
    vxfs
    à tipo del FS « veritas File System »
    8192
    à block size in Kb

  6. Inserire il FS creato nell'fstab per il mount ( nel caso che il FS deve essere gestito dal cluster NON si deve inserire nell'fstab,
    ma nel file di configurazione del package che nel nostro caso si trova in /etc/cmcluster/ (qui dentro si trovano i package installati nel cluster)

per ridurre/ingrandire il FS si deve eseguire il comando
“fsadm -F vxfs -b 8388608 /xxx/yyy”
8388608 = 8192*1024  “deve essere la dimensione totale del fs”
vxfs
à tipo del FS « veritas File System »

dischi ioscan -fnC disk

 

Mirror/Smirror LV

 

Per eseguire il mirror di un LV lvextend -m 1 /dev/vg01/lv01 /dev/dsk/c1t4d0”

/dev/dsk/c1t4d0 à è il disco di destinazione

/dev/vg01/lv01 à è il lv di origine

 

Per eseguire lo smirror di un LV “lvreduce –m 0 /dev/vg01/lv01 /dev/dsk/c1t4d0”

/dev/dsk/c1t4d0 à è il disco da cui si vuole togliere il mirrror

 

N.B. Si posso eseguire max 2 copie di mirror

Se non si specifica il disco di destinazione il mirror verrà effettuato all’interno del vg nel primo disco libero.

Si può controllare se il mirror con lvdisplay

 

Creare lost+found

 

mklost+found

 

Controlli

 

Per essere sicuri di sostituire il disco corretto si può procede con il seguente comando:

dd if=/dev/dsk/c2t12d0 of=/dev/null

in questo modo si vede il led dell’hdd che si accende.

 

Swap space

 

Per creare una nuova Swap space e attivarla

  1. Crea la Swap space “lvcreate -C 8192 –L 3300 -n lvolxx /dev/vgxx”
    8192 à block size
    3300
    à dimensione della swap space in Mb

lvolxx à nome  swap

  1. Attiva la swap space “swapon –p 1 /dev/vgxx/lvolxx”

 

Per creare/attivare un’area di swap di devono controllare se i seguenti parametri siano impostati correttamente:

 

Se dobbiamo fare un’area di swap di 8Gb, si deve impostare il MaxSwapChunks a 8192

 

DimensioneTotaleAreaSwap / SwChunks = MaxSwapChuhnks  ”8192/2=4096”

 

Es: Se dobbiamo fare un’area di swap di  8Gb “8192/2=4096”

    Se dobbiamo fare un’area di swap di 16Gb “16384/2=8192”

    Se dobbiamo fare un’area di swap di 32Gb “32768/2=16384”

Questi parametri vanno modificati da SAM (alla fine si deve ricompilare il kernel sempre da SAM)

 

 

Creare /dev/null

 

Per creare /dev/null

 

mknod null c 3 0x000002

 

ls -la null*

crw-rw-rw-   1 root       sys          3 0x000002 Jul 17 07:39 null

-rw-r--r--   1 root       sys              0 Mar  7  2000 null2

chown bin:bin null

 

ls -la null*     

crw-rw-rw-   1 bin        bin          3 0x000002 Jul 17 07:39 null

-rw-r--r--   1 root       sys              0 Mar  7  2000 null2





SWCOPY

assuming all your depot files are under /tmp
#mkdir /tmp/patch_depot
#swcopy -s /tmp/patch1_name.depot patch1_name @ /tmp/patch_depot

eg; for patch PHKL_16957
swcopy -s /tmp/PHKL_16957.depot PHKL_16957 @ /tmp/patch_depot
(repeat the same for all patches)
#swreg -l depot /tmp/patch_depot
#swinstall -s /tmp/patch_depot
after patch installation is over
#swreg -u -l depot /tmp/patch_depot.
This will install all your patches.

 


:q!