AIX (Advanced Interactive eXecutive) is the operating system from IBM for RS/6000, pSeries and the latest p5 & p5+ systems based on UNIX System V with 4.3BSD-compatible command and programming interface xtensions.Currently, it is called "System P". AIX/5L the 5L addition to AIX stands for version 5 and Linux affinity.
Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts
Wednesday, January 20, 2010
NIM related Commands in AIX
lsnim To list the nim resources
lsnim -l dcmds To list the detailed info about the object dcmds
lsnim -O dcmds To list the operation dcmds object can support
lsnim -c resources dcmds To list the resources allocated to the machine dcmds
nimclient The client version of nim command (User can obtain same results of nim in server )
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 To define lpp_source1 image in /export/lpp_source/lpp_source directory from source cd0
nim -o define -t mksysb -a server=master -a location=/resources/mksysb.image mksysb1 To define mksysb resource mksysb1, from source /resources/mksysb.image on master
nim -o remove inst_resource To remove the resource inst_resource
nim -o check lpp_source1 To check the status of lpp_source lpp_source1
nim -o allocate -a spot=spot1 -a lpp_source=lpp_source1 node1 To allocate the resources spot1 and lpp_source1 to the client node1
nim -o bos_inst node1 To initialise NIM for the BOS installation on node1 with the allocated resources
nim -o dkls_init dcmds To initialize the machine dcmds as diskless operation
nim -o dtls_init dcmds To initialize the machine dcmds for dataless operation
nim -o cust dcmds To initialize the machine dcmds for customize operation
nim -o diag dcmds To initialize the machine dcmds for diag operation
nim -o maint dcmds To initialize the machine dcmds for maintenance operation
nim -o define -t standalone -a platform=rspc -a if1="net1 dcmds xxxxx" -a cable_type1=bnc dcmds To define the machine dcmds as standalone with platform as rspc and network as net1 with cable type bnc and mac address xxxxx
nim -o unconfig master To unconfigure nim master
nim -o allocate -a spot=spot1 dcmds To allocate the resource spot1 from machine dcmds
nim -o deallocate -a spot=spot1 dcmds To de allocate the resource spot1 from machine dcmds
nim -o remove dcmds To remove machine dcmds after removing all resources associated to it
nim -o reboot dcmds To reboot ther client dcmds
nim -o define -t lpp_source -a location=/software/lpp1 -a server=master -a source=/dev/cd0 lpp1 To define lppsource lpp1 on master at /software/lpp1 directory from source device /dev/cd0
********************
Monday, December 21, 2009
Useful HACMP Commands
clstart -m -s -b -i -l To start cluster daemons (m-clstrmgr, s-clsmuxpd, b-broadcast message, -i-clinfo, -l cllockd)
clstop -f -N To force shutdown cluster immediately without releasing resources
clstop -g -N To do graceful shutdown immediately with no takeover
clstop -gr -N To do graceful shutdown immediately with takeover
cldare -t To sync the cluster toplogy
cldare -t -f To do the mock sync of topology
cldare -r To sync the cluster resources
cldare -r -f To do the mock sync of resources
clverify cluster verification utility
cllscf To list clustur topology information
cllsclstr To list the name and security level of the cluster
cllsnode To list the info about the cluster nodes
cllsnode -i node1 To list info about node1
cllsdisk -g shrg To list the PVID of the shared hard disk for resource group shrg
cllsnw To list all cluster networks
cllsnw -n ether1 To list the details of network ether1
cllsif To list the details by network adapter
cllsif -n node1_service To list the details of network adapter node1_service
cllsvg To list the shared vgs which can be accessed by all nodes
cllsvg -g sh1 To list the shared vgs in resource group sh1
cllslv To list the shared lvs
cllslv -g sh1 To list the shared lvs in the resource group sh1
cllsdisk -g sh1 To list the PVID of disks in the resource group sh1
cllsfs To list the shared file systems
cllsfs -g sh1 To list the shared file systems in the resource group sh1
cllsnim Show info about all network modules
cllsnim -n ether Show info about ether network module
cllsparam -n node1 To list the runtime parameters for the node node1
cllsserv To list all the application servers
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 To remove the cluster definition
clrmgrp -g sh1 To delete the resource group sh1 and related resources
clrmnim ether To remove the network interface module ether
clrmnode -n node1 To remove the node node1
clrmnode -a node1_svc To remove the adapter named node1_svc
clrmres -g sh1 To remove all resources from resource group sh1
clrmserv app1 To remove the application server app1
clrmserv ALL To remove all applicaion servers
clgetactivenodes -n node1 To list the nodes with active cluster manager processes from cluster manager on node node1
clgetaddr node1 returns a pingable address from node node1
clgetgrp -g sh1 To list the info about resource group sh1
clgetgrp -g sh1 -f nodes To list the participating nodes in the resource group sh1
clgetif To list interface name/interface device name/netmask associated with a specified ip label / ip address of a specific node
clgetip sh1 To get the ip label associated to the resource group
clgetnet 193.9.200.2 255.255.255.0 To list the network for ip 193.9.200.2, netmask 255.255.255.0
clgetvg -l nodelv To list the VG of LV nodelv
cllistlogs To list the logs
clnodename -a node5 To add node5 to the cluster
clnodename -o node5 -n node3 To change the cluster node name node5 to node3
clshowres Lists resources defined for all resource group
clfindres To find the resource group within a cluster
xclconfig X utility for cluster configuration
xhacmpm X utility for hacmp management
xclstat X utility for cluster status
HACMP 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}
/usr/es/sbin/cluster/utility/* (All commands)
***************
Friday, December 4, 2009
Useful TIVOLI Commands
q sess To see currently working sessions
can sess ( sess no) To cancel a session
q eve domainname schedulename To see schedule time,nodename, scgedule name and progress of the scheeduled backup. ( q eve * * to see all scheduled backups)
cancel process (process no) To cancel a process
q node To view assigned nodes in a Tivoli server
q filespace To check backup space utilized for each file system of a server, filesystem type...
q actlog To view activity log
q act begind=mm/dd/yyyy begint=hh:mm:ss endd=mm/dd/yyyy endt=hh:mm:ss To view activity log for a specified period by begining date and end date
q act begind=today-1 begint=00:00 To view activity log from yesterday 12:00 am
q act search=transferred begint=00:00 To see all completed backup size of servers from 12:00 am
q act search=nodename To view activity log for a node
q drive f=d To get detailed report of drive, it's status ...
q library f=d To get detailed information about tape library
q libvol To see volumes in the tape library and it's status
q vol To see volumes and it's storage pool name, capacity, status
q req To see requests
reply (request no) To continue request
q sched To show schedule name domain, action , start date & time
q sched f=d To show detailed report about schedules including schedule backup path
UPDATE LIBVOLUME TS3200 L41117L4 STATUS=SCRATCH To change a library volume ( L41117L4 ) status to scratch from private
update node nodename "admin" domain=domainname forcepwreset=Yes To change a tivoli login password of a node
define vol storagepoolname L41116L4 Add new tape L41116L4 to a storagepool
delete volume L41116L4 discarddata=yes To delete data inside a tape media L41116L4
To create a new schedule backup (incremental ) for a node
========================================
UPDATE SCHEDULE domainname nodename desc="daily incremental backup for a server" action=Incremental options=-subdir=yes objects=""/fs1/*" "/fs2/*" "/home/user1/*"" priority=5 startdate=mm/dd/yyyy starttime=hh:mm duration=1 duru=Hou period=1 perunits=Day dayofweek=Any expiration=never
UPDATE SCHEDULE domainname nodename desc="daily incremental backup for a server" action=Incremental options=-subdir=yes objects=""/fs1/*" "/fs2/*" "/home/user1/*"" priority=5 startdate=mm/dd/yyyy starttime=hh:mm duration=1 duru=Hou period=1 perunits=Day dayofweek=Any expiration=never
To start tivoli services in an AIX client
========================
#cd /usr/tivoli/tsm/client/ba/bin
nohup dsmc sched & To start scheduled backup service
nohup dsmcad & To start BA client ( webmode backup i.e. http://ip.address.of.server>:1581)
#cd /usr/tivoli/tsm/StorageAgent/bin
#cd /usr/tivoli/tsm/StorageAgent/bin
nohup ./dsmsta & To start storage agent ( LANFREE BACKUP= backup directly from SAN to Tape library )
To update drive status of a server to online
==============================
update path sourceservername TAPE0 srct=server destt=drive libr=ts3200 online=yes
To set serial number of a drive in tape library
==============================
UPDATE DRIVE TS3200 TAPE0 ELEMENT=autodetect ONLINE=Yes WWN="2002000E11107B6C" SERIAL=autodetect
To detect label of a tape in tape library
==========================
label libvol t3200 checkin=scratch labelsource=barcode search=bulk waittime=0
To remove tape media from tape library
===========================
checkout libvol ts3200 VOLLIST=A00015L3,A00019L3 CHECKLABEL=YES REMOVE=YES
To add and label new tapes into library
===========================
LABEL libvol TS3200 search=yes labelsource=barcode overwrite=NO checkin=SCRATCH WAITTIME=0
To take full backup of Tivoli database manually to a file in local disk
=============================================
backup db dev=FILECLASS type=full
to assign a tape drive to a server
=======================
UPDATE PATH servername TAPE0 SRCTYPE=SERVER DESTTYPE=DRIVE LIBRARY=TS3200 DEVICE=\\.\Tape0 ONLINE=YES AUTODETECT=no
Important
=======If you are not able to take backup through any of Tivoli backup methods ( BA client, dsmc , schedule ) then check any NFS mounted filesystems are there in the server and that server is available or not. If that server is not powered on, either unmount the NFS filesyatem or make that server available...
****************
Thursday, December 3, 2009
SRC (System Resource Controller)commands in AIX
lssrc -a To list the status of all subsystems
lssrc -h node1-a To list the status of all subsystems on foreign host node1
lssrc -s inetd To list the status of the subsystem inetd
lssrc -g tcpip To get the status of the subsystem group tcpip
startsrc -s inetd To start the subsystem inetd
startsrc -g tcpip To start the subsystem group tcpip
stopsrc -s inetd To stop the subsystem inetd (if process is under srcmstr. ie PPID of process=PID of srcmstr)
stopsrc -g tcpip To stop the subsystem group tcpip
refresh -s nfsd To refresh nfsd subsystem
refresh -g tcpip To refresh tcpip subsystem group
lssrc -p [PID of process]
kill
mkssys To add a subsystem
rmssys -s kerberos To remove the subsystem kerberos
chssys -s kerb -s kad To rename the subsystem kerb to kad
*************
Wednesday, December 2, 2009
User related commands in AIX
id To list all system identifications for current user
id -gn To list the default group for current user
id -Gn To list all system groups for current user
lsuser root To list the attribute of user root
lsuser ALL To list the attributes of all users
lsuser -a ALL To list all usernames
lsuser -a HOME ALL To list the home directory of all users
lsuser -a auth1 auth2 ALL To list the authentication method for all users
lsuser -a expires ALL To list expiry date
lsuser -a account_locked ALL To check account lock status of all users
chuser -a login=true praveen To enable the user praveen
chuser -a rlogin=true username Enable user to login remotely to server
mkuser praveen Creates user si with default values in /usr/lib/security/mkuser.default
passwd To change password of current user
passwd username To change password of a user
pwdadm username To change password of a user by security (admin) member
mkuser su=false username Create user without su facility
rmuser username To remove a user
rmuser -p praveen To remove user praveen and his all attributes
who List users with tty nos and ip numbers
who /var/adm/wtmp Lists history of login logout system startup and shutdown
last root All previous login and logoff time of root user
who -r To list the current run level ( cat /etc/.init.state )
whoami show current user
who am i To list the exact user (who -m) ( ie. difference between su and su - After su shows previous username bcoz environment not set for current user and su - shows current username bcoz environment has been set)
mkgroup dcm To create the group dcm
chgroup users=user1,user2,user3 dcm To add users user1,user2 and user3 to dcm group
rmgroup dcm To delete the group dcm
chauthent To change the authentication methods
chuser unsuccessful_login_count=0 username To change the unsuccessful login count
pwdck -t ALL / Username To verify user passwords ( Report error and ask to fix it)
usrck -t ALL / Username To verify user definition.
grpck -t ALL / groupname To verify a group
*************
Print commands in AIX
switch.prt -d to Display current print subsytem (AIX, System V, BSD)
switch.prt -s AIX to change current print subsytem to AIX
switch.prt -d systemV to change current print subsytem to systemV
qprt -P qname filename To submit print jobs (AIX Printing)
qprt -P
qprt -N
qchk -q To display the default q
qchk -P lp0 To display the status of the printer lp0
qchk -# 123 To display the status of job number 123
qchk -A To display the status of all queues (AIX Printing)
qcan -x 123 To cancel the print job 123 (AIX Printing)
qcan -X -P lp0 To cancel all jobs submitted to lp0 (AIX Printing)
qchk -L to show job priorities
qpri -#570 -a 25 To change the priority of the job to 25
qhld -# 569 To hold the job 569
qhld -r -#569 To remove holding job 569 (release)
qmov -m pq1 -#11 To move the job 11 to queue pq1
enable psq To enable queue psq
disable psq To disable queue psq
lp -d qname filename To submit printjob (System V printing)
lp -n
lpstat To display the status all queues (System V printing)
lpstat -p lp0 To display the status of print queue lp0
lpstat -u root To display the jobs submitted by user root
cancel -#111 To cancel job 111 (System V printing)
lpq -P lp0 To display the status of queue lp0 ( BSD Printing )
************
Backup commands in AIX
mksysb -i -X /dev/rmt0 Creates image.data and system backup (-X expands /tmp if required)
mksysb -m /dev/rmt0 Creates image.data file with map file and system backup
mksysb -e /dev/rmt0 Creates system data but excludes the files listed in /etc/exclude.rootvg
mkszfile Creates /image.data file
mkcd -d /dev/cd1 Creates system boot backup to the CD-R device /dev/cd1 (mksysb)
mkcd -d /dev/cd1 -v datavg Creates backup of VG datavg to CD-R device /dev/cd1 (savevg)
savevg -i -f /dev/rmt0 datavg Creates datavg.data image file and backup vg datavg (path = /tmp/vgdata/datavg/datavg.data)
savevg -ef /dev/rmt0 datavg Creates datavg backup but excludes files listed in the /etc/exclude.datavg
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
restore –xvf /export/mksysb ./etc/sshd.conf Restores particular file from /export/mksysb image
restore -Pa -vf /dev/rmt0 ./etc/passwd Restore only a file attribute from tape
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=file1 of=file2 conv=ebcdic Convert and copy ascii file to ebcdic file2
dd count=1 bs=4k skip 31 seek=1 if=/dev/hd4 of=/dev/hd4 copy 31st block and paste to 1st block in the hd4 ( ie.to fix currupted superblock by restoring it's backup copy to original location)
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
tcopy /dev/rmt0.0 /dev/rmt1.0 to copy contents of 1st tape(tape0) to 2nd tape(tape1). It is useful when the size of the tapes are different.
tcopy /dev/rmt0 to show no. of files and block size in the tape
chdev -l rmt0 -a block_size=512 To change the block size of the tape to 51201
******************
Tuesday, October 13, 2009
Network Related commands in AIX
host 193.9.200.1 Resolves ip to host name (from /etc/hosts file)
host ibm Resolve ibm to ip address (from /etc/hosts file)
hostname ibm To change the host name to ibm
entstat en0 To the status of ethernet device en0
entstat -d en0 To list the detailed status of device en0
no -a To list all net configurable attributes and their values
no -d thewall To change thewall parameter to its default value
no -o ipforwarding=1 To make the machine as router in tcpip networks
traceroute ibm To trace the route to ibm
ping ibm To tcp ping to the machine ibm
ifconfig -a To show the status of all network interfaces
ifconfig en0 To show the status of en0
ifconfig en0 up Turns on network card en0
ifconfig en0 down Turns off network card en0
ifconfig en0 detach Removes en0 card from the network interface list
ifconfig en0 inet 194.35.52.1 netmask 255.255.255.0 up configure en0 and starts immediately
ifconfig en0 inet 194.35.52.1 netmask 255.255.255.0 up configure en0 and starts immediately
mktcpip -h ibm -a 10.0.2.40 -m 255.255.255.0 -i en0 assign hostname as ibm, IP as 10.0.2.40 subnetmask 255.255.255.0 to en0 interface
ifconfig en0 alias 195.60.60.1 Create alias ip address for en0
route add 0 192.100.13.7 To make 192.100.13.7 as default gateway for entire network
route add 192.100.12.0 192.100.13.7 To make 13.7 as gateway for 12.0 network
route -f To clear the gateway table
chdev -l inet0 -a hostname=ibm To change the host name to ibm permanently
netstat -a To show the state of all sockets
netstat -c To show the network buffers cache
netstat -D To show the net drops of packets
netstat -i To display interface statistics
netstat -r To show the routing table
netstat -rn To show routing table (ip will be given instead of host names)
netstat -s To show the statistics of the protocols
route add 0 192.100.13.7 To make 192.100.13.7 as default gateway for entire network
route add 192.100.12.0 192.100.13.7 To make 13.7 as gateway for 12.0 network
route -f To clear the gateway table
chdev -l inet0 -a hostname=ibm To change the host name to ibm permanently
netstat -a To show the state of all sockets
netstat -c To show the network buffers cache
netstat -D To show the net drops of packets
netstat -i To display interface statistics
netstat -r To show the routing table
netstat -rn To show routing table (ip will be given instead of host names)
netstat -s To show the statistics of the protocols
netstat -s -p <> To show the statistics of respective protocols
********
Installation specific commands in AIX
lslpp -l To see the details of installed file sets
lslpp -ha bos.net.* To list the installation history of all file set in bos.net packages
lslpp -f bos.rte To list the files in the bos.rte package
lslpp -w /etc/hosts To list the file set which contain /etc/hosts file (parent fileset)
lslpp -p bos.net.nfs.server To list the pre requisites for bos.net.nfs.server file set
lslpp -d
installp -L -d /dev/rmt0.1 To list the installable products on the device rmt0
installp -aX -d /dev/rmt0.1 bos.net To install all filesets within bos.net and expands file system if it requires
installp -u bos.net To remove bos.net
installp -r To reject the applied software
installp -c -f To commit the applied fileset
installp -C To cleanup an incomplete installation
lppchk -c To check the fileset items and verifies that the checksum and filesize are consistent with SWVPD
installp -aX -d /dev/rmt0.1 bos.net To install all filesets within bos.net and expands file system if it requires
installp -u bos.net To remove bos.net
installp -r To reject the applied software
installp -c -f To commit the applied fileset
installp -C To cleanup an incomplete installation
lppchk -c To check the fileset items and verifies that the checksum and filesize are consistent with SWVPD
lppchk -v verify that all filesets have required requisites and are completely installed
instfix -k IX9999 -d /dev/rmt0.1 To install the file set associated with fix IX9999 from rmt0
instfix -ik IX9999 To verify fix IX9999 installed
************
Console Emulation commands in AIX
lscons To list the current console
lscons -b To list the console at next boot
chcons /dev/tty3 To change the console to tty3
chcons -a login=enable /dev/tty3 Redirect console to tty3 and provide login prompt
swcons /dev/tty3 To change system console to tty3 temporarily
************
Device Related Commands in AIX
cfgmgr To configure devices and installs device software in system
cfgmgr -l vscsi0 To configure the components connected to the vscsi0 interface
lscfg To display config, diagnostics and vital product definition info
lscfg -l mem0 Display info about device mem0
lscfg -l ent* Display info about all Ethernet cards
lscfg -v Display vpd
lscfg -v -l hdisk0 Display vpd of hdisk0
mkdev -l rmt0 To change device rmt0 from defined state to available state
lsdev -P To lists all supported devices
lsdev -P -c disk To list all supported disks
lsdev -P -r class To display supported class
lsdev -P -r subclass To display all sub class
lsdev -C To lists all configured devices
lsdev -C -l mem0 To display the properties of mem0
chdev -l sys0 -a maxproc=100 To change default maxproc value to 100/user
chdev -l rmt0 -a blocksize=512 To change the block size to 512
chdev -l rmt0 -a ret=no To avoid tape retension
rmdev -l rmt0 To remove the device rmt0
rmdev -dl rmt0 To remove the device totally from database
rmdev -l rmt0 -S To change the state of the device stopped
lsparent -C -k rs232 To display possible parent devices which accept rs232 devices
lsparent -C -l hdisk0 To display parent devices which accept child device hdisk0
lsattr -Dl rmt0 To see the default values of the device rmt0
lsattr -El rmt0 To see the current values of the device rmt0
lsattr -El tty0 -a login -R To see all possible values of the login attribute of tty0
lsconn -p scsi0 To list all possible connection scsi0 can accept
lvlstmajor To list the available major numbers
mknod /dev/null c 2 2 Create null device with major (2) and minor (2) nos. (c - char device)
****************
System Dump commands in AIX
sysdumpdev -l To list the current dump destination
sysdumpdev -L List the details of the previous dump
sysdumpstart -p Starts dump in the primary dump device
sysdumpstart -s Starts dump in the secondary dump device
sysdumpdev -p /dev/lv00 To make lv00 as primary dump device tempararly
sysdumpdev -P -p /dev/lv00 To make lv00 as primary dump device permanently
sysdumpdev -s /dev/rmt0 To make rmt0 as secondary dump device
sysdumpdev -z To determine a new system dump occurred
**************
Paging Space Commands in AIX
lsps -a To list out all paging spaces
lsps hd6 To display the details of the paging space hd6
chps -a y paging00 To turn on the paging space paging00 on next reboot
chps -a n paging00 To turn off the paging space paging00 on next reboot
chps -s4 paging00 To increase the size of the paging space in 4 LP blocks
mkps -a -n -s4 newvg To create a paging space on VG newvg of 4 LP size (-s4) and activate it immediately (-n) and activate it at every restarts
rmps paging00 To remove the paging space paging00
chps -a y paging00 To turn on the paging space paging00 on next reboot
chps -a n paging00 To turn off the paging space paging00 on next reboot
chps -s4 paging00 To increase the size of the paging space in 4 LP blocks
mkps -a -n -s4 newvg To create a paging space on VG newvg of 4 LP size (-s4) and activate it immediately (-n) and activate it at every restarts
rmps paging00 To remove the paging space paging00
swapon -a To invoke all entries in /etc/swapspaces file
swapon /dev/paging00 To make available swap space paging00
swapoff /dev/paging00 To disable swap space paging00
swapon /dev/paging00 To make available swap space paging00
swapoff /dev/paging00 To disable swap space paging00
***********
BLV commands in AIX
Bootlist, Bosboot and Bootinfo commands in AIX
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 hdisk0 hdisk1 To change boot sequence to hdisk0, hdisk1 in normal mode
bootlist -m service cd0 rmt0 hdisk0 To change boot sequence to cd0,rmt0,hdisk0 in service mode
bosboot -a To create Boot image on default boot logical volume on the hard disk, from where the system is booted.
bosboot -ad /dev/hdisk1 To create boot image on specified PV hdisk1
mkboot -cd /dev/hdisk1 To clear the boot image from hdisk1 (as chpv -c hdisk1)
bootinfo -b To show the last boot device
bootinfo -e Check the machine can boot from tape
bootinfo -k To check the type of boot (1=secure,2=service,3=normal)
bootinfo -K To check whether the 32 or 64 bit kernel is active
bootinfo -m To display machine model code
bootinfo -o hdisk0 To display the device location or disk device name of hdisk0
bootinfo -p To see the machine platform
bootlist -m service -o To see the boot sequence in service mode
bootlist -m normal hdisk0 hdisk1 To change boot sequence to hdisk0, hdisk1 in normal mode
bootlist -m service cd0 rmt0 hdisk0 To change boot sequence to cd0,rmt0,hdisk0 in service mode
bosboot -a To create Boot image on default boot logical volume on the hard disk, from where the system is booted.
bosboot -ad /dev/hdisk1 To create boot image on specified PV hdisk1
mkboot -cd /dev/hdisk1 To clear the boot image from hdisk1 (as chpv -c hdisk1)
bootinfo -b To show the last boot device
bootinfo -e Check the machine can boot from tape
bootinfo -k To check the type of boot (1=secure,2=service,3=normal)
bootinfo -K To check whether the 32 or 64 bit kernel is active
bootinfo -m To display machine model code
bootinfo -o hdisk0 To display the device location or disk device name of hdisk0
bootinfo -p To see the machine platform
bootinfo -r To see the size of memory
bootinfo -s hdisk0 To see the size of hdisk0
bootinfo -P 0 -s hdisk0 To see the physical partition(PP) size of hdisk0
bootinfo -P 0 -s hdisk0 To see the physical partition(PP) size of hdisk0
bootinfo -t Specifies the type of boot
bootinfo -T To see the machine type
bootinfo -y To see whether the hardware in use is 32 bit or 64 bit
LV commands in AIX
lslv -l lv00 Display info about LV lv00 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 testlv To remove testlv
rmlv -f testlv To remove testlv forcefully (without confirmation)
mklv -s n -c 3 testlv hdisk1 To make LV testlv with three copies on hdisk1
extendlv testlv 5 To extend the LV silv with 5 LPs
mklvcopy -s n testlv 2 hdisk1 To mirror LV testlv on same PV with 2 copies
mklvcopy testlv 3 hdisk1 hdisk2 To mirror LV testlv on hdisk1 and hdisk2 with 3 copies
rmlvcopy testlv 2 hdisk1 To remove one copy of LV testlv from hdisk1
mklv -t jfslog -y log00 newvg 2 To create a jfslog with name log00 on VG newvg with 2LPs
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 testlv To remove testlv
rmlv -f testlv To remove testlv forcefully (without confirmation)
mklv -s n -c 3 testlv hdisk1 To make LV testlv with three copies on hdisk1
extendlv testlv 5 To extend the LV silv with 5 LPs
mklvcopy -s n testlv 2 hdisk1 To mirror LV testlv on same PV with 2 copies
mklvcopy testlv 3 hdisk1 hdisk2 To mirror LV testlv on hdisk1 and hdisk2 with 3 copies
rmlvcopy testlv 2 hdisk1 To remove one copy of LV testlv from hdisk1
mklv -t jfslog -y log00 newvg 2 To create a jfslog with name log00 on VG newvg with 2LPs
mklv -t boot -y hd5 rootvg 1 To create logical volume, type as boot with 1 LP (BLV)
logform /dev/log00 To format jfslog volume log00
PV commands in AIX
lspv show all PV's in the system and their status
lspv hdisk0 display status and characteristics of the PV hdisk0
lspv -p hdisk0 display PP usage of hdisk0 and their location
lspv -l hdisk0 To list all logical volumes on PV hdisk0 and their distribution
chpv -v r hdisk1 make unavailable the PV (Used while removing PV without varyoffvg)
chpv -v a hdisk1 make PV available.(Open the PV)
chpv -c hdisk0 Clear the master boot record on PV hdisk0 (CAREFULLY..!!)
migratepv hdisk1 hdisk2 To move PPs from hdisk1 to hdisk2
migratepv -l newlv hdisk1 hdisk2 To migrate LV newlv from hdisk1 to hdisk2
**************
FS commands in AIX
lsfs Lists all filesystems in the /etc/filesystems entry
lsfs -a To list all filesystems (default)
lsfs -q List all filesystems with detailed info (shows size of FS and LV in it. so we can check wheather size of LV=size os FS)
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 /test Change size of FS /test to 24576(blocks)x 512 bytes (12 MB)
chfs -a size=+24576 /test Add 24576(blocks)x512 byte to FS /test
chfs -a size=+64M /test Add 64 MB to /test
chfs -a size=10G /test fix size of the FS /test to 10 GB
chfs -m /test /new Change the mount point from /test to /new
chfs -a size=10G /test fix size of the FS /test to 10 GB
chfs -m /test /new Change the mount point from /test to /new
chfs -A /test To auto mount the filesystem test
chfs -d account /test Remove account attribute of /test.(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 for backup purpose
crfs -v jfs2 -g newvg -a size=100M -m /test Creates FS /test of type jfs in VG newvg of size 100 MB with default LV.
crfs -v jfs -d /dev/lv00 -m /test Create FS /test of type jfs on device /dev/lv00
rmfs /test Deletes FS /test and associated LV
rmfs -r /test Deletes FS /test its mount point and associated LV
defragfs /test To defragment the file system /test
chfs -d account /test Remove account attribute of /test.(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 for backup purpose
crfs -v jfs2 -g newvg -a size=100M -m /test Creates FS /test of type jfs in VG newvg of size 100 MB with default LV.
crfs -v jfs -d /dev/lv00 -m /test Create FS /test of type jfs on device /dev/lv00
rmfs /test Deletes FS /test and associated LV
rmfs -r /test Deletes FS /test its mount point and associated LV
defragfs /test To defragment the file system /test
defragfs -q /test Display the current defrag status of the file system
fsck -y n /dev/lv00 To check the filesystem associated to /dev/lv00 assuming response "yes"
fsck -p /dev/lv00 To restore superblock from backup superblock
*************
VG commands in AIX
lsvg Display all VGs
lsvg -o Display all active VGs
lsvg rootvg Display info about rootvg
lsvg -l rootvg Display info about all LVs in rootvg
lsvg -o |lsvg -il Display info about all LVs in all VGs
lsvg -p rootvg Display info about all PVs in rootvg
mkvg -s 8 hdisk1 Create VG with name vgxx on hdisk1 with partition size 8MB
mkvg -s 8 -y newvg hdisk1 Create VG with name newvg on hdisk1 with partition size 8MB
mkvg -s 4 -t 2 -y newvg hdisk1 Create sivg on hdisk1 with PP size 4 and no of partions 2 * 1016
chvg -a y newvg To automatically activate newvg at startup
chvg -a n newvg To deactivate the automatic activation at startup
chvg -t 2 newvg To change maximum no. of PP / PV to 2032 on vg newvg i.e 2*1016 ( so max no. of hdisk in newvg is 16 as in this case in normalvg)
chvg -Qn newvg To disable quorum on VG newvg
reorgvg newvg Reorganises PP allocation of VG newvg
extendvg newvg hdisk3 hdisk4 Add PV hdisk3 and hdisk4 to VG newvg
exportvg newvg Exports the VG newvg
importvg -V 44 -y newvg hdisk2 Import the hdisk2 with name newvg, and assign major number 44
redcucevg newvg hdisk3 Remove PV hdisk3 from VG newvg
varyoffvg newvg To deactviate VG newvg (after unmounting filesystems in newvg)
varyonvg newvg To activate VG newvg
syncvg -v newvg To sync the mirrored LV in the VG newvg
mirrorvg -S -m newvg hdisk2 To mirror LVs of newvg with hdisk2 (-m for exact mirror, -S for forbackground mirror)
unmirrorvg newvg hdisk2 To remove the mirrored PV from the newvg
***********
lsvg -l rootvg Display info about all LVs in rootvg
lsvg -o |lsvg -il Display info about all LVs in all VGs
lsvg -p rootvg Display info about all PVs in rootvg
mkvg -s 8 hdisk1 Create VG with name vgxx on hdisk1 with partition size 8MB
mkvg -s 8 -y newvg hdisk1 Create VG with name newvg on hdisk1 with partition size 8MB
mkvg -s 4 -t 2 -y newvg hdisk1 Create sivg on hdisk1 with PP size 4 and no of partions 2 * 1016
chvg -a y newvg To automatically activate newvg at startup
chvg -a n newvg To deactivate the automatic activation at startup
chvg -t 2 newvg To change maximum no. of PP / PV to 2032 on vg newvg i.e 2*1016 ( so max no. of hdisk in newvg is 16 as in this case in normalvg)
chvg -Qn newvg To disable quorum on VG newvg
reorgvg newvg Reorganises PP allocation of VG newvg
extendvg newvg hdisk3 hdisk4 Add PV hdisk3 and hdisk4 to VG newvg
exportvg newvg Exports the VG newvg
importvg -V 44 -y newvg hdisk2 Import the hdisk2 with name newvg, and assign major number 44
redcucevg newvg hdisk3 Remove PV hdisk3 from VG newvg
varyoffvg newvg To deactviate VG newvg (after unmounting filesystems in newvg)
varyonvg newvg To activate VG newvg
syncvg -v newvg To sync the mirrored LV in the VG newvg
mirrorvg -S -m newvg hdisk2 To mirror LVs of newvg with hdisk2 (-m for exact mirror, -S for forbackground mirror)
unmirrorvg newvg hdisk2 To remove the mirrored PV from the newvg
***********
Monday, October 12, 2009
Important AIX commands
lsitab init : to display default runlevel of an AIX system
cat /etc/.init.state : to get current runlevel of an AIX system
lslpp : display installed softwares on AIX
/usr/lib/errdemon : to start error login ( errpt ) in AIX
procwait -v
procsig
chuser fsize=-1
lppchk -l : to verify that the symbolic links assoiciated with a file set are correct as indicated in the SWVPD.
shutdown -F : fast shutdown AIX system
shutdown -Fr : fast reboot AIX system
shutdown -Fm : reboot an AIX system to maintenance mode
telinit 2 : reboot an AIX system to normal mode
teleinit q : read nittab file
oslevel -s : display the currently installed service pack level in AIX
find /apps -print | backup -i -v -f /dev/rmt0 : copy the contents of /apps to tape in AIX
who : display currently logged users
ln -sf /usr/lib/boot/unix_64 /unix
ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
bosboot -ad /dev/ipldevice
shutdown -Fr : reconfigure an AIX system from a 32-bit kernel to a 64-bit kernal.
oslevel -rl 5300-06 : show which filesets still need to get new technology level 5300-06 after AIX upgradation
chnfs -n 100 -B : increase the number of system threads allowed to access NFS mounts to 100
./myscript > /tmp/myoutput 2>1 : run myscript and redirect stdout and stderr to /tmp/myoutput
installp -C : to cleanup improperly applied filesets ( interrupted)
lppchk -c : to verify all the filesets installed completely
lppchk -v : verify that the operating system(AIX) is in a consistent state after installing AIX technology level ( to verify all filesets are installed completely)
refresh -s inetd : to restart TCP/IP
chvg -Qn testvg : disable quorum in testvg
smit update_all : to apply system to latest technologic level from CD.
migratepv -l /dev/testlv hdisk1 hdisk2 : move (migrate) testlv from hdisk1 to hdisk2
migratepv hdisk1 hdisk2 : move all data from hdisk1 to hdisk2
lsfs -q /testfs : to check the size of /testfs and the LV mounted on it. i.e how much space required by the FS to reach as that to LV in it.
last To list all the records in the /var/adm/wtmp file (all successful logins)
last shutdown To show the time of previous shutdown of server.
last reboot To show the time of previous reboot of server.
uptime To show how long the system has been up ( w -u )
oslevel To list the operating system level
lslicense To see the number of license
chlicense -u30 To change the fixed user license to 30
chlicense -f on To enable floating user license
lsmcode To check system firmware version (sys0)
invscout To get firmware of all peripheral devices. It will generate the output in /var/adm/invscout/invs.mrp containing the firmwares of all peripheral devices.
****************
Sunday, August 23, 2009
Advanced AIX commands
PV commands in AIX
FS commands in AIX
LV commands in AIX
BLV commands in AIX
Paging Space Commands in AIX
System Dump commands in AIX
Device related commands in AIX
Console emulation commands in AIX
Installation specific commands in AIX
Network Related commands in AIX
Backup commands in AIX
Print commands in AIX
User related commands in AIX
SRC (System Resource Controller) commands in AIX
TIVOLI related Commands
HACMP related Commands
NIM Commands in AIX
Useful AIX commands
Subscribe to:
Posts (Atom)