Professional Documents
Culture Documents
VG COMMANDS
lsvg
lsvg -o
lsvg rootvg
lsvg -l rootvg
lsvg -o |lsvg -il
lsvg -p rootvg
mkvg -s 8 hdisk1
mkvg -s 8 -y sivg hdisk1
mkvg -s 4 -t 2 -y sivg hdisk1
chvg -a y newvg
chvg -a n newvg
chvg -t 2 newvg
chvg -Q n newvg
reorgvg newvg
extendvg newvg hdisk3 hdisk4
exportvg newvg
importvg -V 44 -y newvg hdisk2
redcucevg newvg hdisk3
varyoffvg newvg
varyonvg newvg
syncvg -v sivg
mirrorvg -S -m sivg hdisk2
unmirrorvg sivg hdisk2
FS COMMANDS
lsfs
Lists all filesystems in the /etc/filesystems entry
lsfs -q
List all filesystems with detailed info
lsfs -a
To list all filesystems (default)
lsfs -l
Specify the output in list format
lsfs -c
Specify the output in column format
lsfs -v jfs
Lists all jfs filesystems
chfs -a size=24576 /si
Change size of FS /si to 24576 x 512 bytes blocks (12 MB)
chfs -a size=+24576 /si
Add 24576 x 512 byte blocks to FS /si
chfs -m /si /bi
Change the mount point from /si to /bi
chfs -A /si
To auto mount the filesystem si
chfs -d account /si
Remove account attribute of /si. ( from /etc/filesystems file)
chfs -a splitcopy=/backup -a copy=2 /oracle This will mount the 2nd copy of mirrored filesystem
oracle to /backup in read-only mode
crfs -v jfs -g testvg -a size=64465 -m /siju Creates FS /siju of type jfs in VG testvg of blocksize
64465
crfs -v jfs -d /dev/lv00 -m /siju
Create FS /siju of type jfs on device /dev/lv00
rmfs /siju
Deletes FS /siju and associated LV
rmfs -r /siju
Deletes FS /siju its mount point and associated LV
defragfs /sifs
To defragment the file system /sifs
defragfs -q /sifs
Display the current defrag status of the file system
fsck -y n /dev/lv00
To fsck the filesystem associated to /dev/lv00 assuming response "yes"
fsck -p /dev/lv00
To restore superblock from backup superblock
1
AIX COMMANDS
PV COMMANDS
lspv hdisk0
Display status and characteristics of the PV
lspv -p hdisk0
Display PP usage of hdisk0
lspv -l hdisk0
To list all logical volumes on PV hdisk0
chpv -v r hdisk1
Close the PV (Used while removing PV without varyon)
chpv -v a hdisk1
Open the PV
chpv -c hdisk0
Clear the master boot record on PV hdisk0
migratepv hdisk1 hdisk2
To move PPs from PV hdisk1 to hdisk2
migratepv -l silv hdisk1 hdisk2
To migrate LV silv from PV hdisk1 to hdisk2
LV COMMANDS
lslv -l lv00
Display info about LV by PV
lslv -p hdisk1
Display LV allocation map for hdisk1
chlv -t copy lv00
To change the lv00 to copy type
chlv -p r lv00
To change the lv00 to readonly mode
rmlv silv
To remove silv
rmlv -f silv
To remove silv without user intervention
mklv -s n -c 3 silv hdisk1
To make LV silv with three copies on hdisk1
extendlv silv 5
To extend the LV silv with 5 LPs
mklvcopy -s n lvsi 2 hdisk1 To mirror LV lvsi on same PV with 2 copies
mklvcopy lvsi 3 hdisk1 hdisk2
To mirror LV lvsi on PV hdisk1 and hdisk2 with 3 copies
rmlvcopy lvsi 2 hdisk1
Will remove one copy of LV lsvi from hdisk1
mklv -t jfslog -y log00 newvg 2
To create a jfslog with name log00 on VG newvg with 2LPs
logform /dev/log00
To format jfslog volume log00
BLV COMMANDS
bootlist -m normal -o
To see the boot sequence in normal mode
bootlist -m service -o
To see the boot sequence in service mode
bootlist -m normal cd0 hdisk0
To change boot sequence to cd0,hdisk0 in normal mode
bootlist -m service cd0 rmt0 hdisk0 To change boot sequence to cd0,rmt0,hdisk0 in service mode
bosboot -ad /dev/hdisk1
To create boot image on PV hdisk1
mkboot -cd /dev/hdisk1
To clear the boot image
bootinfo -b
Specifies the bootable disk
bootinfo - t
Specifies the type of boot
bootinfo -e
Check the machine can boot from tape
bootinfo -T
To see the machine type
bootinfo -s hdisk0
To see the size of hdisk0
bootinfo -r
To see the size of memory
PAGE SPACE COMMANDS
lsps -a
lsps hd6
chps -a y paging00
chps -a n paging00
chps -s4 paging00
mkps -a -n -s4 sivg
rmps paging00
AIX COMMANDS
swapon -a
swapon /dev/paging00
AIX COMMANDS
chcons -a login=enable /dev/tty3
swcons /dev/tty3
AIX COMMANDS
Backup commands
mksysb -i -X /dev/rmt0
mksysb -m /dev/rmt0
mksysb -e /dev/rmt0
mkszfile
mkcd -d /dev/cd1
mkcd -d /dev/cd1 -v vg00
mkcd -d /dev/cd1 -G
savevg -i -f /dev/rmt0 vg00
savevg -ef /dev/rmt0 vg00
/etc/exclude.vg00
find / -print | backup -ivf /dev/rmt0 Backup entire system to rmt0
backup -0vf /dev/rmt0 /home
Backup /home directory to rmt0 with backup level 0
restore -Tvf /dev/rmt0
List the archive in rmt0
restore -xvf /dev/rmt0 /home
Restore /home from archive in device rmt0
find ./home -print |cpio -ocvumB > /dev/rmt0
Archives /home directory
cpio -icvdumB < /dev/rmt0
Restores cpio archive from rmt0
cpio -ivt < /dev/rmt0
List the contents of cpio archive from rmt0
cpio -icvd < /dev/rmt0 /home
Restores /home directory from rmt0
tar -cvf /dev/rmt0
/home
Archives /home to rmt0 device
tar -tvf /dev/rmt0
List the archives in rmt0
tar -xvf /dev/rmt0 /home
Extract /home from rmt0
dd if=si of=si1 conv=ebcdic
Convert and copy ascii file si to ebcdic si1
dd if=/dev/rmt0 ibs=512 obs=1024 of=/dev/rmt1
To copy blocks from rmt0 with 512 blocks to rmt1 with 1024
blocks
tctl -f /dev/rmt0 rewind
To rewind the tape
tctl -f /dev/rmt0 offline
To eject the tape
tctl -f /dev/rmt0 status
To show the status of tape
chdev -l rmt0 -a block_size=512
To change the block size of the tape to 512
Print commands
qchk -q
qchk -P lp0
qchk -# 123
qchk -A
AIX COMMANDS
qcan -x 123
qcan -X -P lp0
qpri -#570 -a 25
qhld # 569
qhld -r -#569
qmov -m lpa -#11
enable psq
disable psq
cancel -#111
lpstat
lpstat -p lp0
lpstat -u root
lpq -P lp0
last
last |grep shutdown
uptime (w -u )
Licensing commands
oslevel
lslicense
chlicense -u30
chlicense -f on
User commands
id
id -gn
id -Gn
lsuser root
lsuser ALL
lsuser -a HOME ALL
lsuser -a ALL
lsuser -a auth1 auth2 ALL
lsuser -a expires ALL
lsuser -a account_locked ALL
chuser -a login=true san
chuser -a rlogin=true san
mkuser si
mkuser su=false
si
rmuser si
rmuser -p si
who
who /var/adm/wtmp
who -r
who am i /who -m
mkgroup dcm
chgroup users=u1,u2,u3 dcm
AIX COMMANDS
rmgroup dcm
chauthent
Subsystem Commands
lssrc a
lssrc -h node1 -a
lssrc -s kadmind
lssrc -g tcpip
mkssys
rmssys -s kerberos
chssys -s kerb -s kad
startsrc -s kadmin
startsrc -g tcpip
stopsrc -s kadmin
stopsrc -g tcpip
refresh -s nfsd
refresh -g tcpip
Scheduling commands
crontab -l
crontab -e
crontab -l > /si
crontab -r
crontab -v
/var/adm/cron/cron.allow
/var/adm/cron/cron.deny
at -l
at -r root.dfjdhjdh.21
/var/adm/cron/at.allow
/var/adm/cron/at.deny
batch
atq joe
ODM Commands
odmget sm_menu_opt
To get the objects from class sm_menu_opt
odmget -q "id=licenses" sm_menu_opt
To list objects that matches query id=licenses from object
sm_menu_opt
odmdelete -o sm_menu_opt -q "id=licenses"
To delete the entries from class sm_menu_opt which agrees the
query id=licenses
odmshow sm_menu_opt
To show the object class definition
odmdrop -o sm_menu_opt
To drop sm_menu_opt object class
odmchange -o sm_menu_opt -q "id=licenses" file1
To change the attributes from file1
AIX COMMANDS
errpt
To display complete summary of report
errpt -a
To list complete detailed report
errpt -d H
To list all hardware related errors
errpt -d S
To list all software related errors
errpt -a -j 34564423
To list detailed error report of error id 34564423
chitab tty002:23:respawn:/usr/sbin/getty /dev/tty
To enter the entry tty002:23:respawn:/usr/sbin/getty /dev/tty in
inittab
lssrc -g portmap
To start tcpip
HACMP Commands
logs
/tmp/hacmp.out
Detailed event script output logged in 7 day rolling history
/var/adm/cluster.log
High level view of cluster events (No clean up on this file)
/usr/sbin/cluster/history/cluster.mmdd
Day by day view of cluster events. (one file / day of
month)
/tmp/cm.log
Clstrmgr messages
/tmp/cspoc.log
Output from C-SPOC commands (similar to smit.log)
/tmp/emuhacmp.out
Output from event emulation
rdist -b -f /etc/disfile1
To distribute the files in disfile1 to all nodes in disfile1 in binary
mode
Sample entry for disfile1
HOSTS = ( root@node1 root@node3 )
FILES = ( /etc/passwd /etc/security/passwd)
${FILES} -> ${HOSTS}
clstart -m -s -b -i -l
clstop -g -N
clstop -gr -N
cldare -t
cldare -t -f
cldare -r
cldare -r -f
clverify
cllscf
cllsclstr
cllsnode
cllsnode -i node1
cllsdisk -g shrg
cllsnw
clstop -f -N
AIX COMMANDS
cllsnw -n ether1
cllsif
cllsif -n node1_service
cllsvg
cllsvg -g sh1
cllslv
cllslv -g sh1
cllsdisk -g sh1
cllsfs
cllsfs -g sh1
cllsnim
cllsnim -n ether
cllsparam -n node1
cllsserv
claddclstr -i 3 -n dcm
To add a cluster definition with name dcm and id 3
claddnode
To add an adapter
claddnim
To add network interface module
claddgrp -g sh1 -r cascading -n n1 n2 To create resource group sh1 with nodes n1,n2 in cascade
claddserv -s ser1 -b /usr/start -e /usr/stop
Creates an application server ser1 with startscript as
/usr/start and stop script as /usr/stop
clchclstr
-i 2 -n dcmds
To change cluster definitions name to dcmds and id to 2
clchclstr -s enhanced
To change the clustur security to enhanced
clchnode
To change the adapter parameters
clchgrp
To change the resource group name or node relationship
clchparam
To change the run time parameters (like verbose logging)
clchserv
To change the name of app. server or change the start/end
scripts
clrmclstr
clrmgrp -g sh1
clrmnim
ether
clrmnode -n node1
clrmnode -a node1_svc
clrmres -g sh1
clrmserv app1
clrmserv ALL
clgetactivenodes -n node1
AIX COMMANDS
SP Commands
Daemons
hats
hags
haem
hr
pman
Topology services
hatsd
Group services
hagsd
Event management haemd
Host responds
hrd
Problem management pmand,pmanrmd
kadmind
kerberos
kpropd
hardmon
install_cw
setup_authent
( /usr/sbin/rsct/bin/hatsctrl script)
(/usr/sbin/rsct/bin/hagsctrl script)
(/usr/sbin/rsct/bin/haemctrl script)
(/usr/sbin/rsct/bin/hrctrl script)
(/usr/sbin/rsct/bin/pmanctrl script)
10
AIX COMMANDS
setup_server
splst_versions -G -t
spmon_ctest
spmon_itest
SYSMAN_test
CSS_test
SDR_test -l si
SDRListClasses
SDRArchive si
ngcreate
-s 1:1 si
ngcreate -n 1 2 3 si
ngcreate -N ng1,ng2 si
ngcreate -w n1,n2 si
ngcreate -ae n1,n2 si
nglist
nglist -G
ngfind si
ngnew si1 si2 si3
ngnew -G si1 si2 si3
ngresolve -G -n si
ngresolve -w si
11
AIX COMMANDS
ngresolve -d si
ngclean -Ga
ngaddto si 1 2
ngaddto si 1 2 ng1
ngdelfrom si 1 2
ngdelfrom si 1 2 ng1
spled -G
spled or spmon -L
hmmon -V 1:1
hmmon -Q -s 1:1
hmmon -q -s 1:1
hmreinit
ngdelete si si1
ngdelete -u si
cshutdown -F node1
AIX COMMANDS
cshutdown -h node1
cshutdown -g si
cshutdown -G -N 1 3 4-7
cshutdown -X -N 1 2 3
hostlist -av
hostlist -avd
hostlist -dw node1
hostlist -N si
hostlist -s 1-4:4
nodecond -n 1 1
nodecond 1 1
splstdata -h
splstdata -i
splstdata -v
splstdata -t
splstdata -b
splstdata -n
splstdata -s
splstdata -d
splstdata -p
splstdata -e
amd_config
Efence
Efence 193.9.1.2 193.9.1.5
Efence node1 node3
Efence -autojoin node1
Estart
Estart -autounfence -0
To start sp switch
To start sp switch and turn off autounfence feature
(1 for autounfence enabled)
Eunpartition
delnimclient -l 1 2 3
mknimmast -l 1 17 33
lshacws
ntpdate 90.1.2.1
mknimclient -l 1 2 3
delnimmast -l 1 17 33
13
AIX COMMANDS
spbootlist -l 1 2
nodecond 1 4
nodecond -n 1 4
sphrdwrad 1 3 2
setup_authent
kdb_destroy
create_krb_files
ext_srvtab -n node1
ext_srvtab -n SPbgAdm
spsetauth -d k4 std
chauthpar k4 std
kpasswd
lsauthent
k4init siju
k4init -v siju
k4init -i siju
k4init -r siju
k4init -l siju
rcmdtgt
node
k4list
k4list -srvtab
chkp -l 6 siju
chkp -e 2001-5-23 siju
lskp -p
lskp -s
lskp -c
lskp siju abc
rmkp siju
rmkp -n siju
rmkp -v siju
kdb_edit
kdb_edit -n
kdb_util dump /si.bak
14
AIX COMMANDS
kdb_util load /si.bak
kdb_util new_master_key
kadmin
kadmin ank
kadmin cpw
kadmin cap
kadmin get
kadmin dest
kstash
kdb_init
ksrvutil list
ksrvutil -f /etc/srvtab.bak list
ksrvutil change
ksrvutil delete
ksrvutil -f /etc/srvtab.bak delete
spacs_cntrl block user1
spacs_cntrl unblock user1
spacs_cntrl deny user1
spacs_cntrl allow user1
spacs_cntrl -f /tmp/si deny
cw_allowed
cw_restrict_login
To list the principals and version number in the server key file
To list the principals in the file /etc/srvtab.bak
To change the key version in the default srvtab file
To delete the keys in the /etc/krb-srvtab file
To delete the keys in the /etc/srvtab.bak file
To block user1 on the node
To unblock user1
To deny user1
To allow user1
To deny the list of the users in the file /tmp/si
List of users to be allowed to login to CWS
Script which will deny user to login to cws and allow them to
change the passwd (files are /usr/lpp/ssp/config/admin
directory and entry for second file will be in /etc/profile file)
AIX COMMANDS
supper update user.admin
supper diskinfo
sysctld
/etc/sysctl.conf
sysctl -h node1
Opens a sysctl command interface for node node1
sysctl -h node1 aclcheck siju
To check entry for siju in the default acl file (sysctl.acl)
sysctl -h node1 -f /etc/si.acl siju
To check entry for siju in the acl file /etc/si.acl
sysctl -h node1 info commands
To list the authorized commands for the current principal
sysctl -h node1 acladd -p siju
To add the principal siju to the default ACL file
sysctl -h node1 -f /etc/si.acl acladd -p siju
To add the principal siju to /etc/si.acl ACL file
sysctl -h node1 acldelete -p siju
To delete the principal siju to the default ACL file
sysctl -h node1 -f /etc/si.acl acldelete -p siju
To delete the principal siju to /etc/si.acl ACL file
16
AIX COMMANDS
Create the client application substart in /usr/bin directory of cws with following contents
if [ $# -gt 2 ]
then echo "Arguments exceed the limit"
exit 1
fi
/usr/lpp/ssp/bin/hostlist -n $1 | /usr/bin/sysctl -c - substart_proc $2
In the above script if condition will check for the number of arguments and execute procedure
on corresponding host
2)
3)
Create server application substart.tcl with a procedure substart_proc with following contents
create proc substart_proc {SubSystem} AUTH {
global SCUSER
if [ aclcheck -f /etc/substart.acl $SCUSER ] {
exec /etc/substart.srv $SubSystem
return
}
}
if condition in the above example checks for kerberos user in the acl file /etc/substart.acl
If the condition is true it execute the command /etc/substart.srv with arguments passed by
substart command
17
AIX COMMANDS
4)
startsrc -s $2
This script execute the command startsrc with the argument passed by the substart command
5)
6)
Create acl file substart.acl with the entry for user siju
#acl#
_PRINCIPAL siju.adm@CWS
7)
Add the application to the sysctl by adding following line to sysctl.conf file
include /etc/substart.tcl
8)
9)
Restart the sysctld daemon to get the new information on cws and on all nodes
10)
Get the kerberos ticket for user siju and execute following command
substart 3 lpd
This should start the lpd daemon on node 3
11)
Try the above command with any other kerberos ticket. Result should be negative
NIM Commands
nimconfig -a pif_name=en0 -a netname=net1
To initialise the NIM master with network name net1
nimconfig -r
To rebuild /etc/niminfo file which contains the variables for NIM
nim -o define -t lpp_source -a source=/dev/cd0 -a server=master -a
location=/export/lpp_source/lpp_source1 lpp_source1
18
AIX COMMANDS
19