46
USEFUL TIPS IN AIX ls -l /home | sort -rn This displays files and directoris inside /home as per their size, larger file on top. ls -l /home/* sort -rn This displays files and also the subdirectories in the /home/ directories as per their size, larger one on top. Note: If /home dir. contains more than one dir. then it first shows all the directiory name and then the files inside the directories as per the directory order. The order is symlink, Directory name, file name. du /home | sort -rn This also displays the subdirectories inside /home as per their size but not files. du -m /home/test/smit.log This shows the size of the smit.log in MB. -g=GB, -k=KB, without flag=shows in Block size. ls -lrt | grep 'Jan 10' | awk '{print$9}' > namefile This is used to get only the file names dated Jan 2010 in a namefile rm `cat namefile` To delete filenames mentioned in the namefile created by the above command. To execute a command in a loop, i.e. in a certain intervals, put the small script in the shell while i= do

Useful Tips in Aix099

Embed Size (px)

DESCRIPTION

ghghkjhkjhjkhlkhjkl

Citation preview

Page 1: Useful Tips in Aix099

USEFUL TIPS IN AIX

ls -l /home | sort -rn        This displays files and directoris inside /home as per their size, larger file on top.

ls -l /home/* sort -rn        This displays files and also the subdirectories in the /home/ directories as per their size, larger one on top.

Note:  If /home dir. contains more than one dir. then it first shows all the directiory name and then the files inside the directories as per the directory order. The order is symlink, Directory name, file name.

du /home | sort -rn          This also displays the subdirectories inside /home as per their size but not files.

du -m /home/test/smit.log     This shows the size of the smit.log in MB. -g=GB, -k=KB, without flag=shows in Block size.

ls -lrt | grep 'Jan 10' | awk '{print$9}' > namefile          This is used to get only the file names dated Jan 2010 in a namefile

rm `cat namefile`           To delete filenames mentioned in the namefile created by the above command.

To execute a command in a loop, i.e. in a certain intervals, put the small script in the shell

while i=dodf -g /backupsleep 3done

in the above example this will show the size of /backup filesystem in each 3 seconds interval.

stty erase ^?       To use backspace button to clear previous letters.

set -o vi      To see previous executed commands using vi style

Page 2: Useful Tips in Aix099

i.e. esc+ j=up, h=down, l=go right, g=go left, /string= search the command from history,

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

Page 3: Useful Tips in Aix099

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

Useful HACMP Commands

Page 4: Useful Tips in Aix099

 

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

Page 5: Useful Tips in Aix099

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

Page 6: Useful Tips in Aix099

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 groupclgetnet 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

Page 7: Useful Tips in Aix099

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)

***************

Difference between Ethernet Interface(en0) and Ethernet adapter (ent0)

Page 8: Useful Tips in Aix099

AIX differentiates between hardware adapters, their interfaces and protocols standards associated.

To recognize interface card AIX uses three notations:ent, en and et.All are different and are described below and the sake of completeness I am using 0 at the end:ent0:The notation ent0 is used to specify the hardware adapter. It has nothing to do with the TCP/IP address. The parameters associated with ent0 can be seen as below:# lsattr –El ent0It will show parameters related to card. It shows adapter_names, alt_addr, auto_recovery, backup_adapter, hash_mode, mode, netaddr, noloss_failover, num_retries, retry_time, use_alt_addr, use_jumbo_frame.en0:en0 represents the interface associated with hardware adapter ent0. The notation en0 is used for Standard Ethernet(inet). The TCP/IP address is associated with this interface. The parameters associated with en0 can be seen as below:#lsattr –El en0 It'll shows all the parameters related with the interface en0 of the adapter ent0.It shows alias4, alias6, arp, authority, broadcast=1500, mtu, netaddr, netaddr6, netmask, prefixlen, remmtu, rfc1323, security, state, tcp_mssdflt, tcp_nodelay, tcp_recvspace, tcp_sendspace.Rest everything is same except mtu(Maximum Transfer Unit) value. Which is 1500 as per the standard ethernet protocol.et0:et0 represents the interface associated with hardware adapter ent0. The notation et0 is used for IEEE 802.3 Ethernet(inet). If you are using standard ethernet protocol then it will not have TCP/IP address. The parameters associated with et0 can be seen as below:#lsattr –El et0 It'll shows all the parameters related with the interface et0 of the adapter ent0. It shows alias4, alias6, arp, authority, broadcast, mtu=1492, netaddr, netaddr6, netmask, prefixlen, remmtu, rfc1323, security, state, tcp_mssdflt, tcp_nodelay, tcp_recvspace, tcp_sendspace.Note here as well that the MTU shown will be 1492 as per IEEE 802.3 standard. Rest all parameters will be same. Also, netaddr, netmask fields will be empty fr et0.

Are these terms interchangable or is there a difference between them? I always get confused with these terms. What does en0 and ent0 mean and the difference between these?

AIX differentiates between a network adapter and network interface:

Network adapter Represents the layer-2 device, for example, the Ethernet adapter ent0 has a MAC address, such as 06:56:C0:00:20:03

Network interface Represents the layer-3 device, for example the Ethernet interface en0 has an IP address, such as 9.3.5.195

Typically, a network interface is attached to a network adapter, for example, an Ethernet interface en0 is attached to an Ethernet adapter ent0.

There are also some network interfaces in AIX that are not attached to a network adapter, for example, the loopback interface lo0 or a Virtual IP Address (VIPA) interface, such as vi0, if defined.

Hhow to disable first time password change in AIX

Page 9: Useful Tips in Aix099

Clear the ADMCHG flag of the user account with "pwdadm -c <user>".

Example:

# pwdadm –c username

How can I directly read out the VGDA of a PV (hdisk)?

Information about VGx, LVx, filesystems, etc. are stored in the ODM. But these information are also written to the VGDA of the disks itself. You can read the information directly from the disk's VGDA with a command like this:  # lqueryvg -Atp hdisk100

You can use  # redefinevg -d hdisk100 myvg

to synchronize the ODM with the information of the VGDA. You can also synchronize the VGDA with the information stored in the ODM:  # synclvodm myvg

How to set a static routes in AIX

You can use the route command to set a static route. But this way you don't get it back after reboot. To make a route persistent you need to change inet0. First check which routes are already set:  # lsattr -El inet0 -a route route net,-hopcount,0,,0,192.168.1.1 Route True route net,-hopcount,255.255.255.128,,,,,192.168.3.155,192.168.2.1 Route True

These routes would be set with:  # chdev -l inet0 -a route=net,-hopcount,0,,0,192.168.1.1 # chdev -l inet0 -a route=net,-hopcount,255.255.255.128,,,,,192.168.3.155,192.168.2.1

To remove these specific static routes:  # chdev -l inet0 -a delroute=net,-hopcount,0,,0,192.168.1.1 # chdev -l inet0 -a delroute=net,-hopcount,255.255.255.128,,,,,192.168.3.128,192.168.2.1

In this route string 255.255.255.128 is the netmask, 192.168.3.128 the destination net, and 192.168.2.1 the gateway. For hostroutes the keyword net has to be replaced with host.

How to replace a failed disk in VIOno comments

by admin in AIX

Page 10: Useful Tips in Aix099

Scenario:1. There is a Single path VIO which is having a VG with 3 hdisks(hdisk1, hdisk2,hsisk3) of same size.2. An lv (lpar1_rootlv) has been createdon hdisk1 and mapped to client lpar1.3. An lv (lpar2_rootlv) has been created on hdisk2 and mapped to client lpar24. Hdisk3 is free5. Hdisk2 is about to fail and showingerror in errpt in client partition lpar2, which is rootvg of lpar26. Present Lpar2 is up and running7. Now hdisk2 has to be replaced with hdisk3 with all the data.

Solution:

Approach 1:

Create a LV on hdisk3 and map it to client LPAR2

on VIO:

# extendvg cl_rootvg hdisk3# mklv -lv lpar2-2_rootlv <<same_size_as_lpar2_rootlv>> hdisk3# mkvdev -vdev lpar2-2_rootlv -vadapter vhost#

On Client:

# cfgmgr# extendvg rootvg hdisk1# mirrorvg rootvg hdisk1# unmirrorvg rootvg hdisk0# bootlist -m normal hdisk1# bosboot -a -d /dev/hdisk1# mklv -t sysdump -y sysdump1 rootvg 4 hdisk1# sysdumpdev -Pp /dev/sysdump1# reducevg -d -f rootvg hdisk0# rmdev -dl hdisk0

or  you can mirror the lpar2_rootlv only on vio via command mklvcopy

# oem_setup_env# mklvcopy lpar2_rootlv hdisk3# After this command LV state must be “open/syncd”. If not use syncvg -l lpar2_rootlv command.# rmlvcopy lpar2_rootlv 1 hdisk2

Approach 2: migrate the data from bad disk to another one on vio server:

Page 11: Useful Tips in Aix099

on VIO# oem_setup_env# migratepv hdisk2 hdisk3

And, That’s it.The rest is the same on both cases:on VIO:

# rmvdev -vtd vtscsi## reducevg <<vg_name>> hdisk2# oem_setup_env# rmdev -dl hdisk2

Disk can be removed/replace from machine.

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

Page 12: Useful Tips in Aix099

lssrc -p [PID of process]  To get  status of the subsystem by process ID 

kill  [PID of process]   To kill a process that not started by srcmstr 

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

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

Page 13: Useful Tips in Aix099

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

Page 14: Useful Tips in Aix099

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:lp1 filename   To submit a print job if multiple queue / printer is there 

qprt -N   No. of print copy required 

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)

Page 15: Useful Tips in Aix099

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   No. of print copy required

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)

Page 16: Useful Tips in Aix099

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

Page 17: Useful Tips in Aix099

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

Page 18: Useful Tips in Aix099

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

******************

Posted by Praveen K at 12/02/2009 05:15:00 AM 0 comments Email This BlogThis! Share to Twitter Share to Facebook Share to Google Buzz Labels: AIX, Commands

Tuesday, December 1, 2009

How to's in AIX

1) How to disable telnet in AIX

  #vi /etc/inetd.conf

comment out telnet from this file (#telnet ... ... .. )

save it and

#refresh -s inetd

Then telnet session will be disabled in that server from now.

Page 19: Useful Tips in Aix099

Short forms related to IBM AIX

IBM         International Business Machines 

AIX        Advanced Interactive eXecutive (Advanced IBM uniX)

POWER   Performance Optimized With Enhanced RISC

RISC       Reduced Instruction Set Computing

CISC      Complex Instruction Set Computing

SCSI      Small computer Simple Interface

PCI       Peripheral Component Interconnect

ISA       Industry Standard Architecture

MCA     Micro Channel Architectural

CHRP    Common Hardware Reference Platform

SMP      Symmetric Multi Processor

PSSP     Parallel System Support Programs

LPAR    Logical PARtition 

HACMP  High Availability Cluster Multi Processing

RSCT   Really Scalable ( RS6000) Cluster Technology

P2SC   POWER2 Super Chips

RAS     Releability Availability Serviceability

SMP    Symmetric Multi Processing

NUMA   Non-Uniform Memory Access

Page 20: Useful Tips in Aix099

MPP     Massively Parallel Processing

CMP    Chip Multi Processing

CAD   Computer Aided Design

CWS   Controll Work Station

ISB    Intermediate Switch Boards

SDR    System Data Depository

PVM   Parallel Virtual Machine

MPI   Message Passing Interface

HPF   High Performance FORTRAN 

HMC     Hardware Management Console

ASM     Advanced System Management

NIM      Network Installation Manager

LPP      Licenced program Product

BOS     Base Operating System

APAR    Authorized program Analysis Report

SMS     System Management Services

SRC     System Resource Controller 

JFS       Journaled File System

JFS2     Enhanced Journaled File System

CDRFS   CD-ROM File System

UDFS     Universal Disk Format Specification

CIFS      Common Internet File System

NFS      Network File System

Page 21: Useful Tips in Aix099

NBPI     Number of Bytes Per Inode 

WSM    Web based System management

RMC     Resource Monitoring and Controll

DAT     Digital Audio tape

QIC     Quarter Inch Catridge

DLT     Digital Linear Tape

LTO     Linear tape Operation

TAR     Tape ARchive

CPIO   CoPy Input to Output 

DD      Device to Device

TCTL   Tape  ConTroL 

DCE    Distributed Computing Environment 

CDE    Common Desktop Environment

PPA    parallel Port Adapter

TCP/IP     Transmission Control Protocol / Internet protocol

DARPA    Department of Advanced Research Projects Agency

IAB      Internet Architecture Board

RFC     Request For Comments

LAN     Local Area Network

WAN    Wide Area Network

NIS     Network Infornation Services

DNS    Domain Name Service

DHCP   Dynamic Host Configuration Protocol

Page 22: Useful Tips in Aix099

NCS     Network Computing System

ICMP    Internet Control Message Protocol

PING    Packet InterNet Gropher

ODM     Object Data Manager

SWVPD   SoftWare Vital Product Data

SRC    System Resource Controller

SMIT  System Management Interface Tool

PUN   Physical Unit Number

LUN   Logical Unit Number

LVM   Logical Volume Manager 

VGDA    Volume Group Descriptor Area

VGSA     Volume Group Status Area

LVCB    Logical Volume Control Block

LVDD  Logical Volume Device Driver

PDT    Performance Diagnostic Tool

SSH    Secured SHell

RSH    Restricted SHell 

EA       Extended Attributes

ACL     Access Controll List

TCB    Trusted Computing Base

SAK    Secure Authentication Key

SAN    Storage Area Network

NAS    Network Area Storage (by NFS)

Page 23: Useful Tips in Aix099

******************

Posted by Praveen K at 11/22/2009 11:59:00 AM 0 comments Email This BlogThis! Share to Twitter Share to Facebook Share to Google Buzz

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

Page 24: Useful Tips in Aix099

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

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

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

Page 25: Useful Tips in Aix099

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                To show dependancies of fileset          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

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

Page 26: Useful Tips in Aix099

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

Page 27: Useful Tips in Aix099

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

Page 28: Useful Tips in Aix099

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

swapon -a                     To invoke all entries in /etc/swapspaces file

swapon /dev/paging00  To make available swap space paging00

Page 29: Useful Tips in Aix099

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

Page 30: Useful Tips in Aix099

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 -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

Page 31: Useful Tips in Aix099

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)

Page 32: Useful Tips in Aix099

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 /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

defragfs -q /test  Display the current defrag status of the file system

Page 33: Useful Tips in Aix099

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

Page 34: Useful Tips in Aix099

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

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 : wait for a process and display status

procsig : list all signal action defined by processes

chuser fsize=-1 : to give permissions to create files over 2GB for a user.(-1=no limit)

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

Page 35: Useful Tips in Aix099

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 /unixln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unixbosboot -ad /dev/ipldeviceshutdown -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

Page 36: Useful Tips in Aix099

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.