You are on page 1of 21

ODM Delete Command easy Step to remove a Disk

odmdelete -o CuDv -q name=hdisk1

Check the status of a mksysb tape (Guessing tape drive is rmt0)

chdev -l rmt0 -a clock_size=0

mt -t /dev/rmt0.1 fsf 3

lsmksysb -c -f //dev/rmt0.1


restore -Tvf /dev/rmt0.1 -s4

NIM showlog command example

nim -o showlog -a full_log=yes -a log_type=nimerr 530TL4spot

Command to boot from network (provided maint boot enabled in the boot server)

bootlist -m normal ent0 speed=auto duplex=auto gateway=X.X.X.X bserver=X.X.X.X client=X.X.X.X

( replace x with the real IPs and speed/duplex according to your network speed settings)

Remove a mksysb image from NIM Server

nim -o remove -a rm_image=yes mksysbname

Create a from mksysb image

restore -xvqf /images/mksysb.image ./

List all ODM Definitions

odmget CuAt to see all the attributes

odmget CuDv to see all the devices
To remove a mirror copy from a LV

/usr/sbin/rmlvcopy fslv01 1 hdisk4 hdisk5

Creating a spot from mksysb

nim -o define -t spot -a source=mksysb1 -a server=master -a location=/export/spot spot1

Restore a file from mksysb image

restore -xvqf mksysb.image ./etc/passwd

restore -xvqf mksysb.image /etc/passwd

Create an lpp source from existing directory

nim -o define -t lpp_source -a server=master -a location=/export/lpp_source/530TL5lpp\


Create a spot from existing lpp source

nim -o define -t spot -a server=master -a location=/export/spot/530TL5spot\

-a source=530TL5lpp 530TL5spot

How to update a lpp source from a downloaded file sets

gencopy -X -b "-qv" -d /TMP_FOR_UPDATE_CD \

-t /export/lpp_source/530TL6lpp/ -f ALL 2>&1

Learn 10 good UNIX usage habits from IBM
How to find a Tape is Mksysb or not
Run this command to see the list of files. If it doesn't show anything then the tape is NOT MKSYSB

chdev -l rmt0 -a clock_size=0

mt -t /dev/rmt0.1 fsf 3

lsmksysb -c -f //dev/rmt0.1


restore -Tvf /dev/rmt0.1 -s4

To define a mksysb resource custimgname in NIM

nim -o define -t mksysb -a server=master -a location=/images/custimg.img custimgname

How to find out the Physical Location of a disk

lsdev -Cc disk -l hdisk0 -F "name location"

Install all software from CD

/usr/sbin/installp -aX -Y -d/dev/cd0 * all

Install Atape software from utility directory

/usr/sbin/installp -aX -Y -d/utility Atape*

To display BOS installation status information while the installation is progressing, run the following
command on the master:

lsnim -a info -a Cstate ClientName

lsnim -l ClientName

To perform a base system installaion on a machine venus (if you don't want
any bosinst_data, script, fbscript. image data then just don't use them in the command line) from the NIM
Server then run this

nim -o bos_inst -a source=rte -a spot=530ML7SP3spot -a lpp_source=530ML7SP3lpp\

-a bosinst_data=No_Prompt -a script=FTPSCR -a fb_script=Install_Drivers\
-a accept_licenses=yes -a preserve_res=yes -a no_client_boot=yes\
-a set_bootlist=no -a force_push=no venus

or with fewer options

nim -o bos_inst -a source=rte -a spot=530ML7SP3spot -a lpp_source=530ML7SP3lpp\

-a bosinst_data=No_Prompt -a script=FTPSCR -a fb_script=Install_Drivers\
-a accept_licenses=yes -a no_client_boot=yes -a force_push=no venus

Now boot the client machine from the network

To resync a logival volume in AIX. Here is an example

Note down the LV IDENTIFIER

root@zeus</root> lslv hd6

LV IDENTIFIER: 00c8411e00004c000000011731887e00.2 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/stale
TYPE: paging WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 128 megabyte(s)
LPs: 2 PPs: 4
STALE PPs: 2 BB POLICY: non-relocatable
Serialize IO ?: NO

Now run this command on the STALE LV

root@zeus </root> lresynclv -l 00c8411e00004c000000011731887e00.2

Or this script will resync all the Logical Volume of all Volume Groups
Modify this as per your requirement. This one I created for our test environment and so far seems to be
working in test environment.

Please test it in a test box before you use

lsvg|while read VG
lsvg l $VG|awk '{print $1}'
done|sed -e '/LV/d' -e '/\:/d'|while read LV
lslv $LV|grep 'LV IDENT'|awk '{print $3}'
done|while read LVIDENT
lresynclv -l $LVIDENT

To add all the filesets on /dev/cd0 to NIM lpp source 530TL5lpp

nim -o update -a package=all -a source=/dev/cd0 530ML5lpp

To add all the filesets from a directory /utility/aixml to NIM lpp source 530TL5lpp
nim -o update -a package=all -a source=/utility/aixml 530ML5lpp

How to create a NIM LPP Source from CD

To create from an existing directory use the full path of the existing directory ex.
/export/lpp_source/510ML2lpp instead of /dev/cd0

gencopy -X -b "-qv" -d /dev/cd0 -t /export/lpp_source/510ML8lpp -f file 2>&1

How to create a lpp_source from existing directory i,e /export/lpp_source/520TL10SP2lpp

nim -o define -t lpp_source -a server=master -a location=/export/lpp_source/520TL10SP2\

lpp 520TL10SP2lpp
NIM Network boot problem

# smitty nim_control_boot ==>

>> Limit Boot Image Creation to Defined Interfaces?
>> It was currently set to "NO"

Booting a Client from NIM Server in diagnostics mode from the command line

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 informations might not be necessary. We normally use in our environment

to allocate the mksysb and necessary lppsource & spots. In our NIM definition our 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 say.

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

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
Now it should mount.

Installing Aix when booting from a mksysb tape fails

If a backup tape fails to boot, you can still install by using a mksysb image stored on the tape. 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
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


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:

odmdelete -q value=0073659c2c6d26f10000000000000000 -o CuAt ( add 16 zeros)

To get the PVID run

lsvg -p vgname
Then run
rmlvcopy 1 0073659c2c6d26f1 (16 Digit PVID)

Restoring tar backup with absolute pathname to different directory

A tar backup created using absolute path names can only be restored to the directory from which it was
created. One way to restore it to a different directory is by using the pax command.
For example, suppose you receive a tar tape created using absolute path names:
tar -cvf /dev/rmt0 /work/*
but want to restore it to the /test directory. The pax command would be:
pax -rf /dev/rmt0 -s/work/test/p
The -s/work/test/p does the directory change.


Suppose you want to delete the entry with athena and lsnim shows the name as mksysb.athena
odmget nim_attr >/tmp/nim_attr.out
vi /tmp/nim_attr.out and look for athena entry
Note down the id no for Ex. id=1161733976
odmdelete -o nim_attr -q id=1161733976
Now Delete it from nim_objects
odmget nim_objects >/tmp/nim_objects.out
vi that file and note down the id for athena
odmdelete -o nim_object -q id=1162344443

Determine the path to your system's error log file by running the following command:

/usr/lib/errdemon -l

To change the maximum size of the error log file enter:

/usr/lib/errdemon -s LogSize
To change the size of the error log device driver's internal buffer, enter:

/usr/lib/errdemon -B BufferSize

To list all events for which logging is currently disabled, enter:

errpt -t -F Log=0

To list all events for which reporting is currently disabled, enter:

errpt -t -F Report=0

IBM 3494 Library testing commands

mtlib -l /dev/lmcp0 -D -E
mtlib -l /dev/lmcp0 -qM
look man mtlib for more options

Vpaths not created for all hdisks of an AIX host or missing vpaths for some hdisks.

In some cases a customer may notice that some hdisks are not associated with any vpaths. Or a customer
may not see the expected number of vpaths for the number of hdisks that they have on their AIX host.

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.

To return a machine to the ready state, enter:

nim -Fo reset MachineName

To deallocate resources, enter:

nim -o deallocate -a subclass=all MachineName

Recovering the /etc/niminfo file from the command line

nimconfig -r

To list all duplicate and conflicting updates in the /myimages image source directory

/usr/lib/instl/lppmgr -d /myimages -u

To remove all duplicate and conflicting updates in the /myimages image source directory, type:

/usr/lib/instl/lppmgr -d /myimages -u -r

How to change the console to tty0 if tty0 not available

smitty devices
add a tty
tty rs232 Asynchronous terminal
in next screen select port to 0, baud rate to 9600 and Enable Login to enable
and hit enter

Now run smitty console and change the device from /dev/lft0 to /dev/tty0

To attempt to boot through a gateway using Ethernet with Duplex & speed Auto, and then try other devices,
enter: Bserver=Boot Server, may be your NIM Server too. Even if you don't have a gateway you need to
mention it. In that case use as gateway. And client is ther Server you want to load from NIM

bootlist -m normal ent0 speed=auto duplex=auto gateway= bserver=

client= hdisk0 rmt0


Suppose you want to delete the entry with TRYME mksysb and lsnim shows the name as
mksysb.TRYME and you are unable to delete it normal way.



odmget nim_attr >/tmp/nim_attr.out

vi /tmp/nim_attr.out and look for TRYME entry
Note down the id no for Ex. id=1161733976

odmdelete -o nim_attr -q id=1161733976

Now Delete it from nim_objects

odmget nim_objects >/tmp/nim_objects.out

vi that file and note down the id for TRYME

odmdelete -o nim_object -q id=1162344443

now from websm screen or smitty nim add the routing information to NIM
MASTER object

resources -> master ->properties ->nim interface. ( Add the interface again)

Identifying the Origin of "core" Files

(Collected from Internet)

When an application core dumps, a "core" file is placed in the current directory. Core files are often a symptom of a problem that
needs attention. You can determine which application caused the "core" file going to the directory where the core file is located
and running the command:
$ lquerypv -h core 6b0 64
The name of the application causing the core file is listed in the section on the right. In the sample output below, the "ftpd"

caused the core file.

000006B0 7FFFFFFF FFFFFFFF 7FFFFFFF FFFFFFFF |................|
000006C0 00000000 000007D0 7FFFFFFF FFFFFFFF |................|
000006D0 00170000 53245A2C 00000000 00000015 |....S$Z,........|
000006E0 66747064 00000000 00000000 00000000 |ftpd............|
000006F0 00000000 00000000 00000000 00000000 |................|
00000700 00000000 00000000 00000000 000000CF |................|
00000710 00000000 00000020 00000000 000000BE |....... ........|

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


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


chfs -a size=2G /


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/ 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'' -m'' -i'en2' -g''

How to copy from one streaming tape to a another tape

tcopy /dev/rmt0 /dev/rmt1

How to check integrety of a tape


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.
How to check the last fsck log of /utility filesystem
/sbin/helpers/jfs2/fscklog /utility

How to check the inode status of a file or inode or to check last accessed time etc
/sbin/helpers/jfs2/istat /etc/passwd

/sbin/helpers/jfs2/istat 40 /dev/hd4 ( to check inode 40 of /dev/hd4)

How to cleanup deleted ODM spaces

/usr/samples/odm/odmclean -d CuDvDr

How to find which fileset contains a particular binary for example ls

lslpp -w /usr/bin/ls

To display if the hardware is 32-bit or 64-bit, type:

bootinfo -y

How to change AIX OS from 32 bit kernel to 64 Bit kernel

ln -sf /usr/lib/boot/unix_64 /unix

ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
bosboot -ad /dev/ipldevice
shutdown -r

How to know if the kernel is 32-bit enabled or 64-bit enabled ?

bootinfo -K

How to lock and unlock a user

To unlock
chuser account_locked=false user
chsec -f /etc/security/user -a account_locked=false -s user

To lock

chuser account_locked=true user

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
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 reset a user "asis"s failed login count

chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s 'asis'

How to restore a file from a savevg backup

/usr/bin/restorevgfiles -s -r -f'/dev/rmt0' -b'4096' -a'' /etc/passwd

How to preview information about a savevg backup with block size 4MB
listvgbackup -l -f'/dev/rmt0' -b'4096' -a''

What is the command to create VG on VPATH device


What is the command to add a Datapath PV to a vg


How to identify a PCI Slot at U1.5-P2-I8

drslot -c pci -i -s 'U1.5-P2-I8'
How to display all graphics adapters in a machine


How to display all Read Write Optical Device List ( Optical Jukebox)
lsdev -Cc rwoptical

How to add path to available Data Path Devices


How to define and configure all Data path Devices


How to display all the vpath devices

lsdev -Cc disk -s dpo -t vpath

How to display Data Path Device Configuration


How to configure a defined tty

mkdev -l tty0

How to display the PMTU table

pmtu display
netstat -in

How to display all locked users (including system users)

usrck -l ALL (lowercase L)

How to generate hardware and software inventory of a server

/usr/sbin/geninv -c

/usr/sbin/geninv -l

How to display and change setting of the core files

lscore - to diplay settings

chcore - to change settings

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

Restore a Backup by inode

To restore a remote backup archive by inode, use the following command:
rsh remotehost "dd if=/dev/rmt0 bs=blocksize" | restore -xvqf- pathname

Restore a Remote cpio Archive

To restore a remote archive created with the cpio command, use the following command:
rsh remotehost "dd if=/dev/rmt0 ibs=blocksize obs=5120" | cpio -icvdumB

Restore a tar Archive

To restore a remote tar archive, use the following command:
rsh remotehost "dd if=/dev/rmt0 bs=blocksize" | tar -xvpf- pathname

Restore a Remote Dump

To restore a remote dump of the /myfs file system, use the following command:
cd /myfs rrestore -rvf remotehost:/dev/rmt0
Backup by Name
To remotely create a backup archive by name, use the following command:
find pathname -print | backup -ivqf- | rsh remotehost "dd of=/dev/rmt0 bs=blocksize conv=sync"

To remotely create a backup archive by inode, first unmount your file system then use the backup command. For example:
umount /myfs backup -0 -uf- /myfs | rsh remotehost "dd of=/dev/rmt0 bs=blocksize conv=sync"

Create and Copy an Archive to Remote Tape

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"

Create a tar Archive remotely :

tar -cvdf - pathname | rsh remotehost "dd of=/dev/rmt0 bs=blocksize conv=sync"

Create a Remote Dump remotely. To create a remote dump of the /myfs file system,
use the following command:
rdump -u -0 -f remotehost:/dev/rmt0 /myfs

How to compare two directory

dircmp /dir1 /dir1

How to identify if a file is sparsely-allocated, for ex. /etc/passwd.

fileplace -v /etc/passwd

How to displaythe placement of file blocks within logical or physical volumes

fileplace -v /usr/bin/ls

fileplace -p /usr/bin/ls ( Will display the PV it resides in)

How to verify the list of bootable PVs :

ipl_varyon -i

How to display the filesystems in a volume group

lsvgfs rootvg

How to display the jfs/jfs2 file systems, run


How to clean up a failed software installation

installp -C
How to unlock a rootvg
putlvodm -K `getlvodm -v rootvg`

How to run 64BIT application on 32 bit kernel

Smitty -> System Environments ->Enable 64bit Application environment
and run the following command
mkitab "load64bit:2:wait:/etc/methods/cfg64 >/dev/console 2>&1 # Enable 64-bit execs"

How make AIX replying to broadcast ping run this command

no -o bcastping=1

How to out the Status of VGDA of rootvg and hdisk0

lqueryvg -g `getlvodm -v rootvg` -At -p hdisk0

How to change a users attribute like pasword length

chsec -f /etc/security/user -s sid -a minlen=8
chuser minlen=8 sid

How to determine the tape block size

Use the dd command to read a single block from the device and find out what block size is used for the archive:
dd if=/dev/rmt0 bs=128k count=1 | wc -c
This will return to you the size in bytes of the block being read. Assuming that your backup was made with the
same physical block size, you can change your device to use this block size.
Use the tcopy command as follows to find out the block size:
# tcopy /dev/rmt0
tcopy : Tape File: 1; Records: 1 to 7179 ; size:512
tcopy : Tape File: 1; End of file after :7179 records; 3675648 bytes

How to mirror a terminal

portmir -t pts/0 ( To start)
portmir -o (To stop)

How to restart inetd

refresh -s inetd
How to identifying the current run level at the command line:
# cat /etc/.init.state


who -r

How to displays the names of the files added to the system during installation of the specified fileset. for Ex. openssh
lslpp -f openssh.base.server

How to list all the softwares in a cdrom ( To display directory use the path)
installp -L -d /dev/cd0

How to configure STK L700 Library with AIX for Veritas Netbackup 6

You need to know two things first

1. Which fcs card you zoned the Fiber Robotic device

For Example fcs0 or fcs1

2. FCID of the robot. Which you will find from the Fiber switch in the Zone
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)

3)/usr/openv/volmgr/scan will give you details of the robot if added correctly

Then run the netbackup Admin GUI


And discover everything from the main menu wizard. Don't go to device robot.
Most of the types veritas discover devices including robots correctly

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.

(Please check later for more AIX tips)