Hp Ux Cheat Sheet



  1. Cmdref.net - Cheat Sheet and Example. Cmdref.net is command references/cheat sheets/examples for system engineers. Top; OS; Middleware; Protocol. HP-UX Commands Cheat Sheet: How to use LVM on HP-UX: Configuration. Note Configuration Note; Hostname, IP /etc/rc.config.d/netconf.
  2. Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003 isl(1M) isl(1M) Series 800 Only CE06 autoexecute file is inconsistent. Autoboot aborted. CE07 Utility file header inconsistent: SOM values invalid. CE08 autoexecute file input string exceeds 2048 characters. Autoboot aborted.

Hpasmcli stands for HP Server Management Application and Agents Command Line Interface It comes with HP ProLiant Support Pack (PSP) and can be installed in HP ProLiant Servers to view, modify the BIOS / System settings such as hyper-threading, boot sequence control, and UID LEDs, etc. HP-UX virtual Machine Cheat Sheet; VM Server grayed out states explanation: disconne. Step by step RHEL 7 installation (from ISO) Step By Step ESXi 5.5 Install.

UNIX cheat sheet

Find/Zip/Move/Delete files older than x days
find ./ -name “*.ARC” -mtime +1 -exec ls -l {} ;
find ./ -name “*.ARC” -mtime +1 -exec ls -l {} ;

find ./ -name “*.ARC” -mtime +1 -exec rm {} ;
find ./ -name “*.ARC” -mtime +1 -exec rm {} ;

find ./ -name “*.ARC” -mtime +1 -exec gzip {} ;
find ./ -name “*.ARC” -mtime +1 -exec gzip {} ;

find ./ -name “*.arch” -mtime +1 -exec mv {} /u01/andy/;
find ./ -name “*.arch” -mtime +1 -exec mv {} /u01/andy/;

Delete the 500 oldest files
rm -f `ls -tr|head -500`
rm -f `ls -tr|head -500`

Find and grep
find ./ -grep {} ; -print 2>/dev/null
find ./ -grep {} ; -print 2>/dev/null

Or…

find ./ -exec grep -l “string” {} ;
find ./ -exec grep -l “string” {} ;

list all files opened by a process
lsof -p
lsof -p

ls -l sorted by size
ls -l |sort -k 5
ls -l |sort -k 5

du -sk *|sort -n
du -sk *|sort -n

cpio unzip syntax
cpio -idmv <
cpio -idmv <

man commands
man -k -displays the chapters containing the specified
man -shows the page
man -k -displays the chapters containing the specified
man -shows the page

pipes
mknod p
mknod p

Turn off auto indent and bracket matching in vi
:set noai nosm
:set noai nosm

Capture a control charater
ctl-v then press the control key (eg. backspace)

Configure ksh environment
To display the current settings

set -o
set -o

To set HP/UX stylee…

set -o vi
set -o vi-esccomplete
set -o vi
set -o vi-esccomplete

Show routing tables
netstat -r
netstat -r

Check all logs for ORA- errors
grep ^ORA- *log |cut -f2 -d”-“|cut -f1 -d:|awk ‘{print “ORA-” $1}’|sort -u

VM daemons

vxconfigd

Maintains

system configuration in the kernel & disk (private region). If thedaemon is stopped it does not disable any configuration state loadedinto the kernel, it only affects the ability to make configuration

changes until vxconfigd is restarted.

It can be in three states:
Enabl = Normal mode
Disable = Most operations cannot be be used
Booted = Normal startup while using boot disk group

vxrelocd Monitors for failure events and relocates failed subdisks
vxconfigbackupdUsed to backup configuration chnages, the files created can be used with vxmake to restored lost groups.
vxnotifyDisplay vertias volume manager events used with the vxconfigd daemon
Kernel States

The kernel can be in three states:

Enabled - both private and public regions are accessible
Disabled - no private or public regions are accessible
Detached - only private regions are accessible

<tbody></tbody>


VM utilities

VxVM debug

vxconfigd -k -m enable -x <debug option>

-x log log to /var/vxvm/vxconfigd.log
-x logfile = <name> log to filename
-x syslog log to syslog
-x timestamp date and timestamp every entry
-x tracefile=name log all possible tracing to file

vxiod

The

vxiod utility starts, stops, or reports on VERITAS Volume Manager(VxVM) I/O daemons. An I/O daemon provides a process context forperforming I/O in VxVM.Manage extended disk i/o & handles dirty

regions, logging

vxiod set <number> = set number of runnning viod daemon

Note: when run on its own it displays # of vxiod daemons that are running.

vxdctl [option]

The vxdctl utility manages aspects of the state of the volume configuration daemon vxconfigd and also manages aspects of configuration for bootstrapping the rootdg disk group.

mode = what mode the vxconfigd is running in
enable = enable the vxconfigd daemon (reread the db)
disable = disable the vxconfigddaemon
stop = kill the vxconfigd daemon (Use 'vxconfigd -k -m disable' to start again)
license [init] = print out license info or reread licenses
support = display version and components
list = display entries in /etc/vx/volboot
init [dmp] = recreate /etc/vx/volboot

Note: when is disabled or stop mode no VX commands will be able to run

vxinstall

Install volume manger (use /etc/vx/disk to exclude any disks or controllers)

<tbody></tbody>Sheet

Disk Regions

Hp Ux Cheat Sheet Template

Private

This

is were veritas holds the meta data regarding the disk. A copy of theconfiguration database is copied to each private region within the disk

group. Veritas will try and keep 5 copies of the configuration database.

Normally configured as slice 3

Public

This is the area that will store the users data.

Normally configured as slice 4.

Disk Layouts
Sliced Disk layout

private

region and public region slices are on seprate partitions (3 & 4),tis type of disk is not suitable for moving between different O/S's but

are suitable for boot partitions

Can be converted to CDS

CDS (Cross-platform Data Sharing) private

and public regions are one slice (slice 7) , this type is suitable for

moving between different O/S's but not suitable for boot parttions.
Simple

Private and public are the same partition but continuous (slice 3)

Can be converted to CDS

NoneNone partitioning
<tbody></tbody>

VxVM Configuration Database

DB size vxdg list <group> | grep permlen - the size of the configuration db
DB location vxdisk list <disk> | grep -i configs - db location
<tbody></tbody>

File Locations

Sheet
vxinstall has not be run /etc/vx/reconfig.d/state.d/install-db
Host ID's /etc/vx/volboot
backup config files (vxconfigbackupd) /etc/vx/cbr/bk
delete or deported disk group config files /etc/vx/dgcfg/deport
All commands logs /var/adm/vx/veacmdlog
Licenses/etc/vx/licenses/lic
Imported disk groups info

/var/vxvm/tempdb
vxconfigd -k -x cleartempdir - clear the /var/vxvm/tempdb

vxconfigd log file /var/vxvm/vxconfigd.log
<tbody></tbody>

Backup & Restore

Hp Ux Cheat Sheet
Backup

/usr/lib/vxvm/bin/vxconfigbackup -l /var/vxvm/backups

-l = location where to store backup

Restore (precommit/commit)

vxconfigrestore -p <group>

# either one of the below after the precommit
vxconfigrestore -d <group>
vxconfigrestore -c <group>

Note:
-p = when you want to check that the restore is correct (use vxprint to check)
-d = abort the precommit
-c = commit the precommit

Cheat <tbody></tbody>

Disks

Initialize disk

vxdisksetup -i c2t0d0 privlen=768
vxdisksetup -i <device> format=sliced - initialized a disk as a sliced disk

Note: format can be either sliced, simple, cdsdisk or none (see above - Disk Regions)

Uninitialize disk vxdiskunsetup -C c2t0d0
Disk Information vxdisk -g <group> list <disk>
vxdisk -s list
Resize a LUN vxdisk -g <group> resize <disk> length=8G
Add a disk slice to volbootvxdctl add disk <device> type=simple
Add a disk slicevxdisk –f <device> type=simple
Add a diskvxdiskadd c1t0d0 or c1 (all disk on controller)
vxdisksetup -i <device>
Remove a disk totally from VMvxdisk rm <device>
Remove a disk from a volumevxdg -g <group> rmdisk <diskname>
Remove a disk slice from VMvxdctl rm disk <device>
Clear any host ID flags vxdisk clearimport <disk name>
Renaming a diskvxedit -g <disk> rename <old disk name> <new disk name>
Move disk to different disk group vxdg move <source dg> <target dg> <disk>
Offline a disk

vxdisk offline <dev name>

Note: disk must not be in a disk group

Online a disk

vxdisk online <dev name>

Note: disk must have a private region otherwise you need to initialise the disk

Hot sparevxedit –g <group> set spare=on <disk>
NoHotUsevxedit –g <group> set nohotuse=on <disk>
Turn off failing flag vxedit -g <group> set failing=off <disk>
Encapsulate a diskvxdisk define c0t0d0s0 type=nopriv
Reattach disk (SAN)

vxreattach [-br | -c]

-b = Background process
-r = Recover volumes
-c = Checks to see if reattach is possible

Discover new disks vxdisk scandisks [new | fabric ]
Disk Comment vxedit -g <group> set comment='.......' <disk>
<tbody></tbody>

Disk Group

Create a disk groupvxdg init group <disk>=<device>
vxdg init <group> <disk>=<device> cds=off - initialize a non-cds disk group
Remove a groupvxdg destroy <group>
Add a disk to a groupvxdg –g <group> adddisk <disk>=<device>
Remove a disk from a groupvxdg –g <group> rmdisk <disk>
Replace failed disk

vxdg -k -g <group> adddisk <disk>=<device>

-k = forces vxvm to take media name of the failed disk & assign it to the new disk

Import a group

vxdg import <group>

Import group (clear any flags)

vxdg import -C <group>

-C - clears any exist host flags

Depot a groupvxdg deport <group>
vxdg -n <new-group-name> deport <old_group_name>
List no hot use on diskvxdg –g <group> nohotuse <disk>
List spare space on diskvxdg –g <group> spare <disk>
Display free spacevxdg –g <group> free
Backup disk group (vxvm 4.0) vxconfigbackup
Restore disk group (vxvm 4.0) vxconfigrestore [-p|-d|-c]
Diskgroup Version vxdg list <group> | grep -i version
Upgrade disk version vxdg upgrade <group> - upgrade to current version
vxdg -T 50 init <group> <disk>=<device> - creater new group @ version 50
Boot/Default DG vxdg bootdg
vxdctl defaultdg <group> - set defaultdg
<tbody></tbody>

Volume

Adding mirror to root /etc/vx/bin/vxrootmir <alternate> create rootvol, swap vol,
Create a simple volume

vxassist make <volume> <size> <disk>
vxassist -g <group> make <vol> <size> !ctrl:c2 - don't use controller 2

vxassist make <volume> <size> <disk> layout=[stripe-mirror|concat-mirror|mirror-concat|mirror-stripe]

stripe-mirror = layered volume
concat-mirror = layered volume
mirror-concat = non-layered volume
mirror-stripe = non-layered volume

Mirror a simple volume vxassist mirror <volume> >disk>
vxassist -g <group> remove mirror <vol> !disk01 - remove the disk01 mirror
Create a stripped volume

vxassist make <volume> <size> layout=stripe

vxassist-g <group> -o ordered make <vol> <size> layout=stripencol=3 <disk1> <disk2> <disk3>

Create mirrored volume with log vxassist make <volume> <size> layout=mirror, log nmirror=# nlog=#
Create a raid volume vxassist make <volume> <size> layout=raid5
Remove a volume

vxedit –rf rm <volume>
vxassist -g <group> remove volume <vol>

Note: you must disable the volume first

Initializing a volume vxvol init state <volume> [plex]state=clean,enable,active
Online Relayout

vxassist -g <group> relayout <vol> layout=stripe ncol=2
vxassist -g <group> convert <vol> layout=stripe-mirror

# Display the relayout operation
vxrelayout -g <group> [status|reverse|start] <vol>
vxtask list

Starting a volume vxvol start <volume>
Start a disabled volume

vxrecover –sb <volume>

-s = start volume after recovery
-b = background the recovery task

Disable a volume vxvol -g <group> stop <volume>
Evacuate a volume vxevac -g <group> <from-disk> <to-disk>
Maintenance mode vxvol maint <volume>
Not clean vxmend mirror clean <plex>
No kernel state vxplex att <vol_name> <plex>
Extending a volume size vxresize <volume> <new length>
vxresize -g <group> <volume> +100m - increase the volume by 100Mb
Shrinking a volume size vxresize <volume> <new length>
vxresize -g <group> <volume> -100m - decrease the volume by 100Mb
add a DRL log to a volume vxassist addlog <volume>
remove a DRL log from a volume vxassist remove log <volume>
Extending log size vxvol set loglen = 2m <volume/log>
Detering volume sizevxassit -g <group> maxsize layout=mirror - the maximum size you can create a mirror
vxassist -g <group> maxgrow <volume> - the maximum size the volume can grow too
Recover a volume

Vxmend fix clean <plex>

Change volumes permissions vxedit -g <group> set owner=<user> group=<group> mode=<perms> <vol>
<tbody></tbody>


Plexs

Creating a plexvxmake plex <plex> sd =<sub disk name>
Remove a plexvxplex –o rm dis <plex>
vxedit -g <group> -rf rm <plex>
Moving a plexvxplex mv <original plex> <new plex>
Copying a plexvxplex cp <volume> <new plex>
Attaching a plexvxplex att <volume> <plex>
Detaching a plex vxplex det <plex>
Offlining a plex vxmend off vol01-02
<tbody></tbody>

Sub-disks

Creating sub-diskvxmake sd <sub-disk> <disk>, offset, len
Removing sub-disk vxedit rm <sub-disk>
Moving sub-disk vxsd mv <old sub-disk> <new sub-disk>
Associating with a plexvxmake plex <plex> sd=<sub-disk>, …
i.e vxmake plex home-1 sd= disk02-01, disk02-00, disk02-02
Dissociatingvxsd dis <sub-disk>
Splittingvxsd –s<size> split sd<new sub><newsub2>
Joiningvxsd join <sub-disk1><subdisk2><new subdisk>
relocating a sub disk vxassist -g <disk group> move !disk05 disk02
relocating a whole disk sub disks

vxprint -g rootdg -se 'sd_orig_dmname='disk02'

<tbody></tbody> <tbody></tbody>
Display all the physical disks

vxdisk list
vxdisk -o alldgs list

Display detailed disk info vxdisk list <disk>
Check for disk failuresvxstat –g <group>–ff –d
Disk Group
Display group propertiesvxdg list
Display detailed group info vxdg list <group>
vxinfo -p -g <group>
Display volume infovxprint –Aht <vol>
Display volume propertiesvxprint –vl
Display unstartable volume vxinfo -g <group> <vol>
Check for volume failuresvxstat –g <group>–ff -v
Plex
Display plex propertiesvxprint –vp
Check for plex failuresvxstat –g <group>–ff -p
Display sub-disk propertiesvxprint –st
Veritas Tasks
Display tasks

vxtask list
vxtask monitor - continuously monitor

States:
r = running
p = pause
a = aborting

Iostats vxstat -g <group> -r –d <disks> - reset all stats on disk
vxstat -g <group> -i 10 -c 5 -d - display 5 sets @ 10 secs intervals
Tracing vxtrace -d <filename> -o dev,disk <vol>
vxtrace -f <filename> -o dev,disk <vol> | more

Licensing

Addvxlicinst - versions greater than 3.5
vxlicense -c - versions below 3.5
Viewvxlicrep - versions greater than 3.5
vxlicense -p - versions below 3.5
Paths

/etc/vx/licenses/lic - versions greater than 3.5
/etc/vx/elm - versions below 3.5

Reload new license vxdctl license init
<tbody></tbody>

VEA

Start/Stop/etc/init.d/isisd [start|stop|restart]
Status

vxsvcctrl status
vxsvc [-m|-k|-v]

-m = status
-k = kill
-v = version

Daemons/opt/VRTSob/bin/vxsvc
/opt/VRTSob/bin/vxsvcctrl
Start VEA GUI

/opt/VRTSob/bin/vea

You must have X-windows running

<tbody></tbody>

Logging

Sheet

Logging help in recovery and can speed it up dramatically, the mainform of logging in veritas is the DRL (dirty region log) which performsthe following

  • log keeps track of changed regions
  • if system fails only the changed regions of the volume are recovered
Addvxassist -g <group> addlog <vol> logtype=drl
vxassist -g <group> addlog <vol> - used for raid logs (no type)
Removevxassist -g <group> remove log <vol> [nlog=n] <vol>
<tbody></tbody>

Volume Read Policy

Policies can be used if you have slower disks within a volume and you wish to use the faster disks.

Round Robin vxvol -g <group> rdpol round <vol>
Preffered Plex vxvol -g <group> rdpol prefer <vol> <plex>
Selected Plex vxvol -g <group> rdpol select <vol>
<tbody></tbody>

Storage Expert (vxse)

Veritas have created some scripots that can check the integrity ofthe vxvm setup i.e mirrored volumes, spares, etc. The scripts are basedon rules and there are a number of differents rules veritas has set,look in the rules directory to see all of them.

Display Description vxse_raid5log1 info
Check rules vxse_raid5log1 -g <group> check
List spare rules vxse_spares list
Run spare run

vxse_spares run

Note: you need to run '/etc/init.d/isisd start' to start the necessary daemons first

VXSE Paths
Rules/opt/VRTS/vxse/vxvm
Default Parameters /etc/default/vxse
<tbody></tbody>

VxDMP

see <a href='veritas_vxdmp.htm'>VxDMP</a> for more information

Veritas links

Hp Ux Glance Cheat Sheet

Recovery features <a href='http://prefetch.net/articles/veritasrecoveryfeatures.html'>http://prefetch.net/articles/veritasrecoveryfeatures.html</a>
<tbody></tbody>

Hp Ux Cheat Sheet

Retrieved from 'http://wiki-ux.info/w/index.php?title=VxVM_Cheat_Sheet&oldid=9489'