AIX Tips
AIX Tips
AIX Tips
Follow this procedure for performing the diag operation from the master and
client. To perform the diag operation from the client, enter:
nimclient -o diag -a spot=SPOTName
To perform the diag operation from the master, enter:
nim -o diag -a spot=SPOTName MachineObjectName
How to restore a Customer non bootable mksysb image to Client M/C
(Try to use the next procedure in NIM Server and try NIM load instead)
Don't try restbyname in NIM Server. It will overwrite all the NIM server data
with the tape Image. Now either use tctl or mt ( Guessing we are using rmt0)
If you want to restore in client M/C itself then
tctl -f /dev/rmt0.1 rewind
tctl -f /dev/rmt0.1 fsf 3
restbyname -xqf /dev/rmt0.1
How to create a NIM Image from Customer mksysb Tape
In NIM Server check a filesystem with at least 5-6 GB free space. I prefer
seperate filesystem for this. Let us guess we are using /export/mksysb directory
so cd to /export/mksysb and restore the image from tape for the Server venus
cd /export/mksysb
chdev -l rmt0 -a block_size=0 (To make sure it can read any block size)
mt -t /dev/rmt0.1 fsf 3
dd if=/dev/rmt0.1 of=/images/mksysb.venus bs=4m
(and use this image. using 4m to avoid any dd buffer error.)
nim -o define -t mksysb -a server=master -a location=/export/mksysb.venus
venus_mksysb
Now initiate the MKSYSB installation for the client venus
nim -o bos_inst -a source=mksysb -a mksysb=venus_mksysb -a
spot=530ML7SP3spot -a lpp_source=530ML7SP3lpp -a accept_licenses=yes
-a \ no_client_boot=yes -a force_push=no venus
All these information might not be necessary. We normally use in our
environment to allocate the mksysb and necessary lppsource & spots. In our
NIM definition our bosinst.data is called No_Prompt, our Script is called as
FTPSCR and FB Script is called Install_Drivers. These are just names but does
lot more than then their names said.
nim -o allocate -a source=mksysb -a mksysb=mksysb.venus -a
lpp_source=530TL5lpp -a spot=530TL5spot -a bosinst_data=No_Prompt -a
script=FTPSCR \
-a fb_script=Install_Drivers -a accept_licenses=yes -a boot_client=no venus
How to display NIM Machines
lsnim -c machines
How to display NIM networks
lsnim -c networks
If NFS Mount failes to mount with following error message -
RPC: 1832-019 Program not registered
Then -> Run on the client. And if both the server & client is new then run on
both uncomment portmap in /etc/rc.tcpip if not already done
make sure rc.nfs is not commented out in /etc/inittab
stopsrc -g nfs
startsrc -s portmap
/etc/rc.nfs
Now it should mount.
Installing Aix when booting from a mksysb tape fails.
Try clone load first. Clone load is boot from AIX CD1 and then recover from
tape. Or you can try the other procedure too. You need to access the firmware
command line prompt, which usually appears as an option in the SMS menus.
At the firmware command line prompt, type following two commands:
setenv real-base 1000000
reset-all
The system will then reboot, and you will be able to boot from tape, assuming
that you have an valid boot image on your tape media.
Create a Filesystem using command line
mkvg -y testvg hdisk1
mklv -y testlv testvg 500 hdisk1 (500 is 500 LP )
chlv -t jfs2 testlv
crfs -v jfs -a nbpi=16384 -A yes -d testlv -p rw -m /custimg
crfs -v jfs2 -A yes -d testlv -p rw -m /custimg
or
Create aJFS2 filesystems on VG testvg with size 10MB mount point /fs1 with
adding entry in /etc/filesystems
crfs -v jfs2 -g testvg -a size=10M -m /fs1 -A yes
ODM command to delete network.
odmdelete -q name = en0 -o CuAt
odmdelete -q parent = en0 -o CuDv
odmdelete -q name = en0 -o CuDv
odmdelete -q name = en0 -o CuDep
odmdelete -q dependency = en0 -o CuDep
odmdelete -q value1 = en0 -o CuDvDr
odmdelete -q value3 = en0 -o CuDvDr
odmdelete -q name=inet0 -o CuAt
Etherchannel problem after loading the server from Customer mksysb
tape
You must remove the ODM entries first before you configure etherchannel
run this on the correct network interface. Ex. en0
odmdelete -q name=en0 -o CuAt
odmdelete -q name=inet0 -o CuAt
How to remove a failed Disk from ODM
If you have been working with a PVID value rather than with an hdisk name,
ensure that the PVID is removed from the ODM with the following command.
The
32-digit value supplied consists of the PVID plus 16 zeros. For example:
In either case the problem could be caused by the fact that the hdisks with no
vpath association are listed in a file called /etc/vpexclude. If this file exists a
customer can remove the file and run cfgmgr and the hdisks will now be
associated with vpaths.
The only way that the vpexclude file can be created is if a customer runs a
querysn command on the AIX host or if the customer manually edits the
/etc/vpexclude file to include the hdisks.
Resetting the NIM state from the command line
Follow this procedure for resetting the NIM state from the command line.
In addition, AIX can be configured to detect when core files are created and
mail a message to root, alerting root that an application has failed. The
instructions for setting this up are in a README file in the
/usr/samples/findcore directory. These programs are delivered with the
bos.sysmgt.serv_aid fileset.
Extend a filesystem in AIX command line
Suppose you want to extend /usr file system to 4GB
chfs -a size=4G /usr
or
chfs -a size=4000M /usr
or you want to add some more space like 2GB with existing size
chfs -a size=+2G /usr
You can extend the root file system same way. Suppose the new size you want
is 2GB
then
chfs -a size=2G /
or
chfs -a size=2000M /
Sendmail Warning: .cf file is out of date: sendmail AIX5.3/8.13.4 supports
version 10, .cf file is version 9
Solution : vi /etc/mail/sendmail.cf and change V9 to V10
How to erase complete data from a disk on aix 5.2 TL6 and 5.3TL4
diag -d hdiskX -T format
How to make IP changes permanent from command line
/usr/sbin/mktcpip -h'P550B_LP01' -a'30.3.0.120' -m'255.255.0.0' -i'en2'
-g'30.3.0.120'
How to copy from one streaming tape to a another tape
tcopy /dev/rmt0 /dev/rmt1
How to check integrety of a tape
tapechk
How to display all the VLAN Adapter
lsdev -Cc adapter -t eth -s vlan
How to use BSD style network setting in AIX
smit configtcp fast path and then select BSD Style rc Configuration.
and configure the /etc/rc.bsdnet file using a standard text editor.
To lock
chuser account_locked=true user
or
chsec -f /etc/security/user -a account_locked=true -s user
How to define whether the user name should be echoed on a port
vi /etc/security/default stanza and change usernameecho = false
or
chsec -f /etc/security/login.cfg -s default -a usernameecho=false
How to change the password prompt for example
chsec -f /etc/security/login.cfg -s default -a pwdprompt="Enter your Password
now:
How to change login prompt from telnet session like it will display the
words in quote
chsec -f /etc/security/login.cfg -s default -a herald="Enter your user ID now:
How to supressthe login messages
touch .hushlogin
How to save current network parameter options for next boot
/usr/sbin/tunsave -a -F nextboot -t no
How to search for and correct physical partitions that are stale or unable
to
perform I/O operations on rootvg. ( Look manual for more options for this
command)
mirscan -v rootvg
How to determine the status of your system battery
diag -B -c
How to run diggonostics on all SCSI devices without user action
diag -S 5 -c
How to determine if the 64-bit kernel extension is loaded ?
genkex |grep 64
Restore a Backup by Name
To restore a remote backup archive by name, use the following command:
rsh remotehost "dd if=/dev/rmt0 bs=blocksize" | restore -xvqdf- pathname
To create and copy an archive to the remote tape device, use the following
command:
find pathname -print | cpio -ovcB | rsh remotehost "dd ibs=5120 obs=blocksize
of=/dev/rmt0"
2. FCID of the robot. Which you will find from the Fiber switch in the Zone.
Or run fcsstat. it will look like 0x242DB1
Now you need to run
1) /usr/openv/volmgr/bin/driver/install_ovpass
2) mkdev -c media_changer -t ovpass -s fcp -p fscsi0 -w 0x0242DB1,0
(fcsi0 if connected to fcs0, fscsi1 if fcs1 , FCID from Fiber Switch, add ,0 after
that)
3)/usr/openv/volmgr/bin/scsi_command -d /dev/ovpass0 -inquiry (will show
the robot)
4)/usr/openv/volmgr/scan will give you details of the robot if added correctly
Then run the netbackup Admin GUI
/usr/openv/netbackup/bin/jnbSA&
And discover everything from the main menu wizard. Don't go to device robot.
Most of the types veritas discover devices including robots correctly
How to find the devices in pre defined subclass
lsdev -P -H
then run
lsdev -Cc disk -Fname -sscsi - for scsi disks
lsdev -Cc cdrom -Fname -sscsi - for scsi cdrom
lsdev -Cc disk -Fname -sfcp - for fiber disks
lsdev -Cc tape -Fname -sfcp - for fiber tapes
How to find the system id number of AIX Server
lsattr -El sys0 -a systemid
or
uname -u
How to check and repair two file systems simultaneously on different drives
(from dfsck man page from AIX Server)
dfsck -p /dev/hd1 - -p /dev/hd7
How to fix SAN disks issue after rerecovering mksysb to different hardware
connected to different SAN disks.
Sceanario :
In a recent disaster recovery scenario I had to recover two lpar to different
hardware. mksysb created on two lpars connected to EMC Server and I was
recovering to two different hardware connected to IBM Shark. Both have AIX
5.3 TL10. After recovering I figured out that one lpar can see the Shark SAN
disks but showing as defined. And the other lpar no SAN disks are showing.
Solution I used : First I ran lslpp -l |egrep 'emc|ibm2105|sdd' and found that
mksysb has Clarion drivers/powerpath/ibm2105 etc. As we are not using
Clarion or EMC disks I am free to remove those packages. So I ran installp -u
EMC* and removes all the EMC softwares. Then I unstalled IBM2105
packages same way. The 2nd lpar now automatically showing the Shark disks
but they are showing as defined. Now I ran
rmdev -rdl fscsi0 and rmdev -rdl fscsi1 ( as SAN disks are connected to fcs0 &
fcs1)
After that I ran cfgmgr -vl fcs0 & cfgmgr -vl fcs1 and all the disks came as
MPIO device and as available. Now if I want vpath software then I would
download latest sdd drivers and ibm2105.rte from ibm website and install
them.
If you want to learn how to Install AIX 5L. Here is the link from IBM. I
think this is one of the best document which covered almost everything of
AIX installation.
http://www-128.ibm.com/developerworks/aix/library/au-install-aix.html
This page was last modified on Thursday, August 12, 2010 07:29:19 AM
THOUGH MOST OF THE SOLUTIONS I TESTED AND I TRY TO TEST
BEFORE I POST, STILL THERE MIGHT BE SOMETHING WHICH I
COLLECTED FROM WEB LONG BACK AND COULDN'T TEST
EARLIER. I AM TRYING TO MAKE THINGS CORRECT BUT IF YOU
PLEASE LEAVE A FEEDBACK WHENEVER YOU SEE SOMETHING
INCORRECT, WILL HELP ME TO CORRECT AND IT WILL HELP
OTHERS TOO.
Please leave a feedback if you think it helped you to figure out or provide any
clue to fix your issue. That will encourage me more. I tried to make sure less
typos but I don't get much time anymore. Too busy with my work. So please
leave a feedback if think something is not correct. Most of the stuffs I put here
from my day to day work and problem fixing.