Top Banner
VG COMMANDS 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 -y'datavg' hdisk1 Create VG with name datavg on hdisk1 with partition size 128MB reducevg -df datavg hdisk1 Remove VG datavg mkvg -s 8 hdisk1 Create VG with name vgxx on hdisk1 with partition size 8MB mkvg -s 8 -y sivg hdisk1 Create VG with name sivg on hdisk1 with partition size 8MB mkvg -s 4 -t 2 -y sivg hdisk1 Create sivg on hdisk1 with PP size 4 and no of partions 2 * 1016 chvg -a y newvg To cuase VG newvg automatically activated at startup chvg -a n newvg To deactivate the automatic activation at startup chvg -t 2 newvg To change maximum no. of PP to 2032 on vg newvg chvg -Q n 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 extendvg '-f' 'rootvg' 'hdisk1' Add PV hdisk1 by force to rootvg 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 varyonvg newvg To activate VG newvg syncvg -v sivg To sync the mirrored LV in the VG sivg mirrorvg -S -m sivg hdisk2 To mirror LVs of sivg with hdisk2 (-m for exact mirror, -S forbackground mirror) unmirrorvg sivg hdisk2 To remove the mirrored PV from the set. To remove or replace physical volumes in a volume group for maintenance purposes, use SMIT or the chpv command.
70
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Aix Commands

VG COMMANDS

lsvg Display all VGslsvg -o Display all active VGslsvg rootvg Display info about rootvglsvg -l rootvg Display info about all LVs in rootvglsvg -o | lsvg -il Display info about all LVs in all VGslsvg -p rootvg Display info about all PVs in rootvgmkvg -y'datavg' hdisk1 Create VG with name datavg on hdisk1 with partition size 128MBreducevg -df datavg hdisk1 Remove VG datavgmkvg -s 8 hdisk1 Create VG with name vgxx on hdisk1 with partition size 8MBmkvg -s 8 -y sivg hdisk1 Create VG with name sivg on hdisk1 with partition size 8MBmkvg -s 4 -t 2 -y sivg hdisk1 Create sivg on hdisk1 with PP size 4 and no of partions 2 * 1016chvg -a y newvg To cuase VG newvg automatically activated at startupchvg -a n newvg To deactivate the automatic activation at startupchvg -t 2 newvg To change maximum no. of PP to 2032 on vg newvgchvg -Q n newvg To disable quorum on VG newvgreorgvg newvg Reorganises PP allocation of VG newvgextendvg newvg hdisk3 hdisk4 Add PV hdisk3 and hdisk4 to VG newvgextendvg '-f' 'rootvg' 'hdisk1' Add PV hdisk1 by force to rootvgexportvg newvg Exports the VG newvgimportvg -V 44 -y newvg hdisk2 Import the hdisk2 with name newvg, and assign major number 44redcucevg newvg hdisk3 Remove PV hdisk3 from VG newvgvaryoffvg newvg To deactviate VG newvgvaryonvg newvg To activate VG newvgsyncvg -v sivg To sync the mirrored LV in the VG sivgmirrorvg -S -m sivg hdisk2 To mirror LVs of sivg with hdisk2 (-m for exact mirror, -S

forbackground mirror)unmirrorvg sivg hdisk2 To remove the mirrored PV from the set.

To remove or replace physical volumes in a volume group for maintenance purposes, use SMIT or the chpv command.# reducevg <VGname> <PVname># rmdev -dl hdisk<n>

Replace the disk...# cfgmgr -v# lspv# chdev -l hdisk<n> -a pv=yes# extendvg <VGname> <hdisk<n>

Mirroring rootvgIf you do not mirror the root volume group, you have a single point of failure. Always mirror rootvg! I have seen too many unnecessary system rebuilds because rootvg was not mirrored. Mirroring rootvg is a straightforward process and consists of the following steps, in which we are going to mirror rootvg to a new disk called hdisk1:1. Add hdisk1 to the rootvg for mirroring: # extendvg rootvg hdisk1

Page 2: Aix Commands

2. Use this command if all the rootvg logical volumes were created properly: # mirrorvg rootvg3. Or (if a problem was encountered) manually mirror rootvg and do not mirror the dump device (lv00 in example):

# lsvg# lsvg -l rootvg# lsvg rootvg

4. Mirror each logical volume:# for N in $(lsvg -l rootvg | grep syncd | awk '{print $1}' | grep -v lv00)> do> echo $N> mklvcopy $N 2> done5. Sync the volume group:# syncvg -v rootvg# lsvg -l rootvg

6. Configure the boot devices:# ipl_varyon -iPVNAME BOOT DEVICE PVID VOLUME GROUP IDhdisk0 NO 00001047375ac230 000010472822f021hdisk1 YES 000010472822e532 000010472822f021

# bosboot -a -d /dev/hdisk0bosboot: Boot image is 6955 512 byte blocks.

# ipl_varyon -iPVNAME BOOT DEVICE PVID VOLUME GROUP IDhdisk0 YES 00001047375ac230 000010472822f021hdisk1 YES 000010472822e532 000010472822f021

# chvg -a'y' -Q'n' -x'n' rootvg# bootlist -m normal -ohdisk1# bootlist -m normal hdisk0 hdisk1# bootlist -m normal -ohdisk0hdisk1# lsvg rootvg | grep -i QUORUMOPEN LVs: 14 QUORUM: 1

The mirrorvg command does all of the mklvcopy commands under the covers for you. Since disk quorum was disabled, we must reboot the system for the changes to take effect.

# shutdown -r now

FS COMMANDS

lsfs Lists all filesystems in the /etc/filesystems entrylsfs -q List all filesystems with detailed info

Page 3: Aix Commands

lsfs -a To list all filesystems (default)lsfs -l Specify the output in list formatlsfs -c Specify the output in column formatlsfs -v jfs Lists all jfs filesystemschfs -a size=24576 /si Change size of FS /si to 24576 x 512 bytes blocks (12 MB)chfs -a size=+24576 /si Add 24576 x 512 byte blocks to FS /sichfs -a size='+1024M' /usr Add 1GB space to FS /usrchfs -m /si /bi Change the mount point from /si to /bichfs -A /si To auto mount the filesystem sichfs -d account /si Remove account attribute of /si. ( from /etc/filesystems file)chfs -a splitcopy=/backup -a copy=2 /oracle This will mount the 2nd copy of mirrored filesystem oracle to

/backup in read-only modecrfs -v jfs -g testvg -a size=64465 -m /siju Creates FS /siju of type jfs in VG testvg of blocksize 64465crfs -v jfs -g datavg -a size=10M -m /oracle Creates FS /orzcle of type jfs in VG datavg of 10MBcrfs -v jfs -d /dev/lv00 -m /siju Create FS /siju of type jfs on device /dev/lv00rmfs /siju Deletes FS /siju and associated LVrmfs -r /siju Deletes FS /siju its mount point and associated LVdefragfs /sifs To defragment the file system /sifsdefragfs -q /sifs Display the current defrag status of the file systemfsck -y n /dev/lv00 To fsck the filesystem associated to /dev/lv00 assuming response "yes"fsck -p /dev/lv00 To restore superblock from backup superblock

PV COMMANDSlspv hdisk0 Display status and characteristics of the PVlspv -p hdisk0 Display PP usage of hdisk0lspv -l hdisk0 To list all logical volumes on PV hdisk0chpv -v r hdisk1 Close the PV (Used while removing PV without varyon)chpv -v a hdisk1 Open the PVchpv -c hdisk0 Clear the master boot record on PV hdisk0migratepv hdisk1 hdisk2 To move PPs from PV hdisk1 to hdisk2migratepv -l silv hdisk1 hdisk2 To migrate LV silv from PV hdisk1 to hdisk2

LV COMMANDSlslv -l lv00 Display info about LV by PVlslv -p hdisk1 Display LV allocation map for hdisk1chlv -t copy lv00 To change the lv00 to copy typechlv –n silv lv00 To rename lv00 to silvchlv -p r lv00 To change the lv00 to readonly modermlv silv To remove silvrmlv -f silv To remove silv without user interventionmklv -s n -c 3 silv hdisk1 To make LV silv with three copies on hdisk1extendlv silv 5 To extend the LV silv with 5 LPsmklvcopy -s n lvsi 2 hdisk1 To mirror LV lvsi on same PV with 2 copiesmklvcopy lvsi 3 hdisk1 hdisk2 To mirror LV lvsi on PV hdisk1 and hdisk2 with 3 copiesrmlvcopy lvsi 2 hdisk1 Will remove one copy of LV lsvi from hdisk1

Page 4: Aix Commands

mklv -t jfslog -y log00 newvg 2 To create a jfslog with name log00 on VG newvg with 2LPslogform /dev/log00 To format jfslog volume log00

BLV COMMANDSbootlist -m normal -o To see the boot sequence in normal modebootlist -m service -o To see the boot sequence in service modebootlist -m normal cd0 hdisk0 To change boot sequence to cd0,hdisk0 in normal modebootlist -m service cd0 rmt0 hdisk0 To change boot sequence to cd0,rmt0,hdisk0 in service modebosboot -ad /dev/hdisk1 To create boot image on PV hdisk1mkboot -cd /dev/hdisk1 To clear the boot imagebootinfo -b Specifies the bootable diskbootinfo - t Specifies the type of boot

1 Disk boot 3 CD-ROM boot 4 Tape boot 5 Network boot

bootinfo -e Check the machine can boot from tapebootinfo -T To see the machine hardware typebootinfo -s hdisk0 To see the size of hdisk0bootinfo -r To see the size of memory in KBbootinfo –k To see the key position (1 Secure, 2 Service, 3 Normal)bootinfo –m To see the machine model codebootinfo –o hdisk0 To list the location code of hdisk0bootinfo –z To see the machine is MP capable (0 – Not Capable, 1 – Capable)bootinfo –p To find out if the machine can run 64-bit kernel

(Returns the string "32", if executed on a machine that is only capable of running the 32-bit kernel. The command returns "chrp", if the machine is capable of running the 64-bit kernel or the 32-bit kernel)bootinfo –K or prtconf –k To find out the currently enabled kernel mode

(Returns "32" if the 32-bit kernel is enabled, and "64" if the 64-bit kernel is enabled.)bootinfo -y command will identify the type of system hardware you have, either

32-bit or 64-bit. If the command returns a 32, you cannot use the 64-bit kernel.

# prtconf -kKernel Type: 32-bit

To find out if 64 bit extensions are loaded:$ lslpp -l bos.64bitIf 32-bit:lslpp: 0504-132 Fileset bos.64bit not installed.

On AIX 4.3.3 , If 64-bit: Fileset Level State Description ----------------------------------------------------------------------------Path: /usr/lib/objrepos bos.64bit 4.3.3.78 COMMITTED Base Operating System 64 bit Runtime

Page 5: Aix Commands

On AIX 5.1 , If 64-bit:Fileset Level State Description ----------------------------------------------------------------------------Path: /usr/lib/objrepos bos.64bit 5.1.0.35 COMMITTED Base Operating System 64 bit Runtime

To find out if OS is 32b-it or 64-bit :$ locale64If 32-bit:exec(): 0509-036 Cannot load program locale64 because of the following errors: 0509-032 Cannot run a 64-bit program on a 32-bit machine.

If 64-bit:LANG=en_USLC_COLLATE="en_US"LC_CTYPE="en_US"LC_MONETARY="en_US"LC_NUMERIC="en_US"LC_TIME="en_US"LC_MESSAGES="en_US"LC_ALL=

To find out if kernel is 32-bit or 64-bit:$ ls -l /unix

If 32-bit:lrwxrwxrwx 1 root system 21 Mar 25 2002 /unix@ -> /usr/lib/boot/unix_mp*lrwxrwxrwx 1 root system 21 Jul 10 16:48 /unix -> /usr/lib/boot/unix_up

If 64-bit:rwxrwxrwx 1 root system 21 Jun 04 2002 /unix@ -> /usr/lib/boot/unix_64*

For AIX 5.2 64-bit:To find out if hardware if 32-bit or 64-bit :$ getconf HARDWARE_BITMODE64 ( If hardware is 64 bit)

To find out if kernel is 32-bit or 64-bit:Command: getconf KERNEL_BITMODE64 (If Kernel is booted in 64 bit mode)

To find out if Oracle is 32-bit or 64-bit use:

$ ORACLE_HOME/bin> file oracle

If 32-bit :oracle: executable (RISC System/6000) or object module not stripped

If 64-bit :

Page 6: Aix Commands

oracle: 64-bit AIX executable or object module not stripped

How to Change Kernel Mode of IBM AIX 5L (5.1) for more information.

There are three kernels available in the /usr/lib/boot directory: unix_up 32-bit kernel for uniprocessor systems unix_mp 32-bit kernel for multiprocessor systems unix_64 64-bit kernel for 64-bit processor systems

The following example provides the commands to run to enable the 64-bit kernel after system installation:

# 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

After the system has rebooted, it will be running the 64-bit kernel. To reactivate the 32-bit kernel, follow the same procedure, substituting unix_up or unix_mp for unix_64, depending on your system type.

PAGE SPACE COMMANDSlsps -a To list out all paging spaceslsps hd6 To display the details of the paging space hd6chps -s'10' hd6 To increase the size of paging space hd6 by 10 LPschps -d'10' hd6 To decrease size of paging space hd6 by 10 LPs

This (-d’10’) will perform the following stepsshrinkps: Temporary paging space paging00 created.shrinkps: Dump device moved to temporary paging space.shrinkps: New boot image created with temporary paging space.shrinkps: Paging space hd6 removed.shrinkps: Paging space hd6 recreated with new size.shrinkps: New boot image created with resized paging space.shrinkps: Resized and original paging space characteristics differ,check the lslv command output.

chps -a y paging00 To turn on the paging space paging00chps -a n paging00 To turn off the paging space paging00chps -s4 paging00 To increase the size of the paging space in 4 LP blocksmkps -a -n -s4 sivg To create a paging space on VG sivg of 4 LP size (-s4) and activate it

immediately (-n) and activate it at every restartsrmps paging00 To remove the paging space paging00swapon -a To invoke all entries in /etc/swapspaces fileswapon /dev/paging00 To make available swap space paging00swapoff /dev/paging00 To deactivate paging space paging00shrinkps Shell script that chps -d executes to shrink paging spacesvmon Takes a snapshot of virtual memory usage. Part of the perfagent.tools filesettopas IBM’s top/monitor clonevmstat Reports virtual memory statisticssar System Activity Reportistat Status of inodesslibclean Removes any currently unused modules in kernel or library memoryps Displays the current status of processes

Page 7: Aix Commands

Adding a swap space (512MB as hd6) – Replacing existing paging00 with hd6# mklv -y'hd6' -t'paging' rootvg 16 hdisk0 (16PP x 32 as PP size = 512MB)hd6

# lsps -aPage Space Physical Volume Volume Group Size %Used Active Auto Typepaging00 hdisk0 rootvg 512MB 1 yes yes lvhd6 hdisk0 rootvg 512MB 0 no no lv

# chps -a y hd6 # Makes an entry in /etc/swapspaces (Means auto - yes)

# swapon -a # Activates swap spaces as per /etc/swapspaces0517-075 swapon: Paging device /dev/paging00 is already active.swapon: Paging device /dev/hd6 activated.

# swapoff /dev/paging00 # Removes an entry in /etc/swapspaces (Means auto - no)

# chps -a n paging00 # Dctivates swap spaces as per /etc/swapspaces

# lsps -aPage Space Physical Volume Volume Group Size %Used Active Auto Typepaging00 hdisk0 rootvg 512MB 0 no no lvhd6 hdisk0 rootvg 512MB 1 yes yes lv

# sysdumpdev -P -p /dev/hd6primary /dev/hd6secondary /dev/sysdumpnullcopy directory /var/adm/rasforced copy flag TRUEalways allow dump FALSEdump compression ON

# rmps paging00

# lsps -aPage Space Physical Volume Volume Group Size %Used Active Auto Typehd6 hdisk0 rootvg 512MB 1 yes yes lv#

SYSTEM DUMP COMMANDSsysdumpdev -l To list the current dump destinationsysdumpdev -L List the details of the previous dumpsysdumpstart -p Starts dump in the primary dump devicesysdumpstart -s Starts dump in the secondary dump devicesysdumpdev -p /dev/lv00 To make lv00 as primary dump devicesysdumpdev -P -p /dev/lv00 To make lv00 as primary dump device permanentlysysdumpdev -s /dev/rmt0 To make rmt0 as secondary dump devicesysdumpdev -z To determine a new system dump occurred

Page 8: Aix Commands

Device related commandscfgmgr To configure devices and installs device software in systemcfgmgr -l vscsi0 To configure the components connected to the vscsi0 interfacelscfg To display config, diagnostics and vital product definition infolscfg -l mem0 Display info about device mem0lscfg -l ent* Display info about all Ethernet cardslscfg -v Display vpd lscfg -v -l hdisk0 Display vpd of hdisk0lscfg -vp |grep -e "Memory DIMM" -e "Size" DIMMs Detailsmkdev -l rmt0 To change device rmt0 from defined state to available statelsdev -P To lists all supported deviceslsdev -P -c disk To list all supported diskslsdev -P -r class To display supported classlsdev -P -r subclass To display all sub classlsdev -C To lists all configured deviceslsdev -Cc if To display existing network interfaceslsdev -C -l mem0 To display the properties of mem0chdev -l sys0 -a maxproc=100 To change default maxproc value to 100chdev -l rmt0 -a blocksize=512 To change the block size to 512chdev -l rmt0 -a ret=no To avoid tape retensionrmdev -l rmt0 To remove the device rmt0rmdev -d -l rmt0 To remove the device totally from databasermdev -l rmt0 -S To change the state of the device stoppedlsparent -C -k rs232 To display possible parent devices which accept rs232 deviceslsparent -C -l hdisk0 To display parent devices which accept child device hdisk0lsattr -Dl rmt0 To see the default values of the device rmt0lsattr -El rmt0 To see the current values of the device rmt0lsattr -El tty0 -a login -R To see all possible values of the login attribute of tty0lsconn -p scsi0 To list all possible connection scsi0 can acceptlvlstmajor To list the available major numbersmknod /dev/null c 2 2 Create null device with major (2) and minor (2) nos. (c - char device)

Console emulation commands

lscons To list the current consolelscons -b To list the console at next bootchcons /dev/tty3 To change the console to tty3chcons -a login=enable /dev/tty3 Redirect console to tty3 and provide login promptswcons /dev/tty3 To change system console to tty3 temporarilyalog -L -t console To see the current attributes of log type consolealog -t console -o To see the console messagesalog -t boot -o To see the boot time messages

Installation specific commands

lslpp -l To see the details of installed file sets

Page 9: Aix Commands

lslpp -ha bos.net.* To list the installation history of all file set in bos.net packageslslpp -f bos.rte To list the files in the bos.rte packagelslpp -w /etc/hosts To list the file set which contain /etc/hosts filelslpp -p bos.net.nfs.server To list the pre requisites for bos.net.nfs.server file setinstallp -L -d /dev/rmt0.1 To list the installable products on the device rmt0installp -aX -d /dev/rmt0.1 bos.net To install all filesets within bos.net and expands file system if it requiresinstallp -u bos.net To remove bos.netinstallp -r To reject the applied softwareinstallp -c -f <product> To commit the <product>installp -C To cleanup an incomplete installationlppchk –v To check package inconsistency. (No output for consistency)lppchk -c <product> To check the <product>instfix -k IX9999 -d /dev/rmt0.1 To install the file set associated with fix IX9999 from rmt0instfix -ik IX9999 To verify fix IX9999 installedsmit install Base install panelsmit install_latest Selective install panelsmit install_all Install ALL productsbffcreate -qv -d <media> -f <disk-path> Copy maint to diskinstallp -qa -d <media-path> -X all APPLY updatesinstallp -rB -X all REJECT updatesinstallp -c -g -X all COMMIT updatesInstallp -u <fileset> DEINSTALL a filesetinstallp -C <fileset> CLEAN UP failed install

Network related commands

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 ibmentstat en0 To the status of ethernet device en0entstat -d en0 To list the detailed status of device en0no -a To list all net configurable attributes and their valuesno -d thewall To change thewall parameter to its default valueno -o ipforwarding=1 To make the machine as router in tcpip networkstraceroute ibm To trace the route to ibmping ibm To tcp ping to the machine ibmifconfig -a To show the status of all network interfaces ifconfig en0 To show the status of en0ifconfig en0 up Turns on network card en0ifconfig en0 down Turns off network card en0ifconfig 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 starts immediatelyifconfig 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 networkroute add 192.100.12.0 192.100.13.7 To make 13.7 as gateway for 12.0 networkroute -f To clear the gateway table

Page 10: Aix Commands

chdev -l inet0 -a hostname=si To change the host name to si permanentlynetstat -a To show the state of all socketsnetstat -c To show the network buffers cachenetstat -D To show the net drops of packetsnetstat -i To display interface statisticsnetstat -r To show the routing tablenetstat -rn To show routing table (ip will be given instead of host names)netstat -s To show the statistics of the protocolsnetstat -s -p < tcp/udp/ipv6> To show the statistics of respective protocols

Space usage commands

du -k To list number of bytes in 1k blocksdu -l To list number of bytes in 512 bytes blocksdu -s To list only the total disk usage in the current directorydf -i To display no of free and used inodesdf -k To display diskspace in 1024 bytes format

Backup commands

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 backupmksysb -e /dev/rmt0 Creates system data but excludes the files listed in /etc/exclude.rootvgmkszfile Creates /image.data filemkcd -d /dev/cd1 Creates system boot backup to the CD-R device /dev/cd1mkcd -d /dev/cd1 -v vg00 Creates backup of vg vg00 to CD-R device /dev/cd1mkcd -d /dev/cd1 -G Creates generic boot backupsavevg -i -f /dev/rmt0 vg00 Creates vg00.data image file and backup vg vg00savevg -ef /dev/rmt0 vg00 Creates vg00 backup but excludes files listed in the /etc/exclude.vg00find / -print | backup -ivf /dev/rmt0 Backup entire system to rmt0backup -0vf /dev/rmt0 /home Backup /home directory to rmt0 with backup level 0restore -Tvf /dev/rmt0 List the archive in rmt0restore -xvf /dev/rmt0 /home Restore /home from archive in device rmt0find ./home -print |cpio -ocvumB > /dev/rmt0

Archives /home directorycpio -icvdumB < /dev/rmt0 Restores cpio archive from rmt0cpio -ivt < /dev/rmt0 List the contents of cpio archive from rmt0cpio -icvd < /dev/rmt0 /homeRestores /home directory from rmt0tar -cvf /dev/rmt0 /home Archives /home to rmt0 devicetar -tvf /dev/rmt0 List the archives in rmt0tar -xvf /dev/rmt0 /home Extract /home from rmt0dd if=si of=si1 conv=ebcdic Convert and copy ascii file si to ebcdic si1dd if=/dev/rmt0 ibs=512 obs=1024 of=/dev/rmt1

To copy blocks from rmt0 with 512 blocks to rmt1 with 1024 blockstctl -f /dev/rmt0 rewind To rewind the tapetctl -f /dev/rmt0 offline To eject the tapetctl -f /dev/rmt0 status To show the status of tape

Page 11: Aix Commands

chdev -l rmt0 -a block_size=512 To change the block size of the tape to 512

When using variable block size, the dd command can be employed with an excessive block size to buffer input to tar, cpio, backup, and restore.# dd if=/dev/rmt0.1 ibs=64k obs=512 | restore -xvf-# dd if=/dev/rmt0.1 ibs=64k obs=5120 | tar -xvBf-# dd if=/dev/rmt0.1 ibs=64k obs=5120 | cpio -ivB# dd if=/dev/rmt0.1 ibs=64k obs=5120 | pax –rf

You can change the default block size defined to AIX for a tape device using the chdev command or through SMIT, as shown in the following listing. Remember that this does not alter the physical block size used by the device!# chdev -1 rmt0 -a "block_size=0" Variable block size# chdev -1 rmt0 -a "block_size=512" Fixed 512-byte block size# chdev -1 rmt0 -a "block_size=1024" Fixed 1024-byte block size

Tape Device Name Implicit OptionsFilename Rewind on Close Retention on Open Density/dev/rmt* Yes No High/dev/rmt*.1 No No High/dev/rmt*.2 Yes Yes High/dev/rmt*.3 No Yes High/dev/rmt*.4 Yes No Low/dev/rmt*.5 No No Low/dev/rmt*.6 Yes Yes Low/dev/rmt*.7 No Yes Low

# tctl -f/dev/rmt0 rewind Rewind the rmt0 tape drive# tctl -f /dev/rmt0 offline Rewind and eject the rmt0 tape drive# mt -f /dev/rmt0 rewind Rewind the rmt0 tape drive# mt -f /dev/rmt0 offline Rewind and eject the rmt0 tape drive

Shutdown Commands# shutdown -m +5 Shut system down to single user in 5 minutes# shutdown -r Shut down and reboot# shutdown now Shut down immediately without rebooting# shutdown -r Reboot now# shutdown -Fr Reboot now without any user warning# shutdown -r now Reboot now and warn the users# shutdown -k Avoid shutting down the system

ODM:Customized object classes represent the devices actually present on the system./etc/objrepos/Pdxxx ODM predefined Attributes, Connections, and Devices: PdAt PdCn PdDv /etc/objrepos/Cuxxx ODM customized Attributes, Dependencies, Device Drivers and Vital Product Data: CuAt CuDep CuDv CuDvDr CuVPD Config_Rules CuOD (New to 5L!)/usr/share/lib/objrepos Components of the SoftWare Vital Product Data (SWVPD) : lpp history inventory product

Page 12: Aix Commands

Device object classes are linked hierarchically into subclasses.

# odmshow <ObjectClassName>

Sampling of AIX Object ClassesClass Object Contents of the Object ClassPdDv Predefined devices supported by AIXPdAt Predefined device attributesPdCn Predefined device subclass connectionsCuDv Customized devices attached to the systemCuDvDr Customized device driversCuAt Customized device attributesCuDep Custom device dependenciesCuVPD Customized vital product dataConfig_Rules Configuration rule sets

Print commands

qchk -q To display the default qqchk -P lp0 To display the status of the printer lp0qchk -# 123 To display the status of job number 123qchk -A To display the status of all queuesqcan -x 123 To cancel the print job 123qcan -X -P lp0 To cancel all jobs submitted to lp0qpri -#570 -a 25 To change the priority of the job to 25qhld # 569 To hold the job 569qhld -r -#569 To remove holding from 569qmov -m lpa -#11 To move the job 11 to queue lpaenable psq To enable queue psqdisable psq To disable queue psqcancel -#111 To cancel job 111lpstat To display the status all queueslpstat -p lp0 To display the status of print queue lp0lpstat -u root To display the jobs submitted by user rootlpq -P lp0 To display the status of queue lp0last To list all the records in the /var/adm/wtmp filelast | grep shutdown To show the shutdown sessionsuptime (w -u ) To show how long the system has been up# switch.prt -s AIX Switch to the AIX printer subsystem# switch.prt -s SystemV Switch to the System V printer subsystem

Once the printer driver is installed, you can proceed to add the System V printer to the system. There are three steps to enable the printer. The lpadmin command is used to add the printer:# mkdev –c printer –t hp4V –s parallel –p ppa0 –w p# lpadmin -p hp4V -v /dev/lp0 -D "Hewlett-Packard LaserJet 4/4M"After the System V printer has been added to the system, you need to use the accept command to allow the printer to accept print requests:# accept hp4V

Page 13: Aix Commands

The last step is to enable the new print queue using the enable command:# enable hp4V

To define the print queue on the remote client, use the following command syntax:# lpadmin -p <client_printer_name> -s <remote_pr_server>!<remote_pr_queue>

The System V filesets that are installed by default include the following:bos.msg.en_US.svprintbos.svprint.fontsbos.svprint.hpnpbos.svprint.psbos.svprint.rtebos.terminfo.svprint.data

Licensing commands

oslevel To list the operating system leveloslevel –r To get the ML infoinstfix -i | grep ML To get the ML infolslicense To see the number of licensechlicense -u30 To change the fixed user license to 30chlicense -f on To enable floating user license

User commands

id To list all system identifications for current userid -gn To list the default group for current userid -Gn To list all system groups for current userlsuser root To list the attribute of user rootlsuser ALL To list the attributes of all userslsuser -a HOME ALL To list the home directory of all userslsuser -a ALL To list all usernameslsuser -a auth1 auth2 ALL To list the authentication method for all userslsuser -a expires ALL To list expiry datelsuser -a account_locked ALL To check account lock status of all userschuser -a login=true san To enable the user sanchuser -a rlogin=true san Enable san to login remotely mkuser si Creates user si with default values in /usr/lib/security/mkuser.defalaultmkuser su=false si Create user si without su facilityrmuser si To remove user sirmuser -p si To remove user si and his all attributeswho List users with tty nos and ip numberswho /var/adm/wtmp Lists history of login logout system startup and shutdownswho -r To list the run level who am i /who -m To list the current usermkgroup dcm To create the group dcmchgroup users=u1,u2,u3 dcm To add users u1 u2 and u3 to dcm group

Page 14: Aix Commands

rmgroup dcm To delete the group dcmchauthent To change the authentication methods

To enable a non-root administrator to use pwdadm, simply add their ID to the "security" group

Subsystem Commands

lssrc -a To list the status of all subsystems lssrc -h node1 -a To list the status of all subsystems on foreign host node1lssrc -s kadmind To list the status of the subsystem kadmindlssrc -g tcpip To get the status of the subsystem group tcpipmkssys To add a subsystemrmssys -s kerberos To remove the subsystem kerberoschssys -s kerb -s kad To rename the subsystem kerb to kadstartsrc -s kadmin To start the subsystem kadminstartsrc -g tcpip To start the subsystem group tcpipstopsrc -s kadmin To stop the subsystem kadminstopsrc -g tcpip To stop the subsystem group tcpiprefresh -s nfsd To refresh nfsd subsystemrefresh -g tcpip To refresh tcpip subsystem grouprefresh –s lpd

Scheduling commands

crontab -l To list the crontab entriescrontab -e To edit the crontab entriescrontab -l > /si To copies the entries of crontab to /si filecrontab -r To remove all crontab entriescrontab -v To list the submission time/var/adm/cron/cron.allow File containing users who allowed cron service/var/adm/cron/cron.deny File containing users denied cron serviceat -l To list the jobs scheduled via at commandat -r root.dfjdhjdh.21 To remove the scheduled job root.dfjdhjdh.21/var/adm/cron/at.allow File containing users who allowed at service/var/adm/cron/at.deny File containing users denied at servicebatch To run the command when the system load permitsatq joe To list all the jobs submitted by user joe

ODM Commandsodmget sm_menu_opt To get the objects from class sm_menu_optodmget -q "id=licenses" sm_menu_opt To list objects that matches query id=licenses from object sm_menu_optodmdelete -o sm_menu_opt -q "id=licenses" To delete the entries from class sm_menu_opt which agrees the query id=licenses

Page 15: Aix Commands

odmshow sm_menu_opt To show the object class definitionodmdrop -o sm_menu_opt To drop sm_menu_opt object classodmchange -o sm_menu_opt -q "id=licenses" file1 To change the attributes from file1

Report & Errors Commandserrpt To display complete summary of reporterrpt -a To list complete detailed reporterrpt -d H To list all hardware related errorserrpt -d S To list all software related errorserrpt -a -j 34564423 To list detailed error report of error id 34564423chitab tty002:23:respawn:/usr/sbin/getty /dev/tty To enter the entry tty002:23:respawn:/usr/sbin/getty /dev/tty in inittablssrc -g portmap To start tcpip

Daemons of NISServer Slave Server Clientypserv ypserv ypbindyppasswdypupdated

NIS maps created by default (if file available on master server)MAP FILE NICK NAMEpasswd.bynamepasswd.byaddr

/etc/passwd passwd

group.bynamegroup.byaddr

/etc/group Group

hosts.bynamehosts.byaddr

/etc/hosts Hosts

ethers.bynameethers.byaddr

/etc/ethers Ethers

networks.bynamenetworks.byaddr

/etc/networks Networks

rpc.bynumber /etc/rpcservices.byname /etc/servicesprotocols.bynameprotocols.bynumber

/etc/protocols protocols

netgroup.byhostnetgroup.byuser

/etc/netgroup

bootparams /etc/bootparamsmail.aliases mail.byaddr

/etc/aliases aliases

publickey.byname /etc/publickeynetid.byname /etc/passwd

Page 16: Aix Commands

/etc/group/etc/hosts /etc/netid

netmasks.byaddr /etc/netmasks

chypdom –I mca Modifies nis domain name entry in /etc/rc.nfschypdom –B mca Changes nis domain and modifies /etc/rc.nfs filechypdom –N mca Changes nis domain name to mcadomainname mca Changes nis domain name to mca until next rebootmkmaster To make the machine NIS master

(Options-O Overwrites existing maps-o prevents overwriting existing maps-E Exit on errors-e No exit on errors-P Starts yppasswdd daemon-p Don’t start yppasswdd daemon-U Starts ypupdated daemon-u Don’t start ypupdated daemon-C Starts ypbind daemon-c Don’t start ypbind daemon-B Executes ypinit command and modifies rc.nfs

mkclient –B –S mca Makes the machine as a client of mca server and starts ypbind daemonypcat passwd To cat the password map file passwd.bynameypcat –x To display map nickname translation tableypcat –d pci passwd To display the passwd file in the domain pciyppasswd To change the password of nis userlsmaster Display characteristics for the configuration of NIS mastermrgpwd >/var/yp/passwd To merge /etc/passwd and /etc/security/passwd file to /var/yp/passwdypxfr -h mca passwd.byname To transfer password map file from host mca

Procedure for NISMaster Server

Change the nis domain name in the master serverchypdom –B mca or smit chypdom

Verify tcpip is running by executing lssrc –s inetdVerify portmap is running by executing lssrc –s portmap(For security reason it is better to locate all nis files to /var/yp directory and change the DIR=/etc entry to DIR=/var/yp in the /var/yp/MakeFile. For merging the existing passwords execute mrgpwd > /var/yp/passwd)Execute mkmaster –O –E –P –U –C –B

-O Overwrites existing maps for this domain-E Exist on errors when creating master server-P Starts yppasswdd daemon-U Starts ypupdated daemon-C Starts ypbind daemon-B Executes ypinit command, uncomment entries in rc.nfs and starts daemons

Check the yp daemons with lssrc –g yp

Page 17: Aix Commands

Slave ServerChange the nis domain name

chypdom –B mcaEdit hosts file, keep entries for loopback, this machine and of serverExecute mkslave –O –B –C mca

Client machineChange the nis domain name

chypdom –B mcaEdit hosts file, and keep entries for loopback , this machine and of serverExecute mkclient –B mcaCheck for ypbind with lssrc –s ypbind

LPAR

indyoradst# uname -L1 06-C891Gindyoradst# prtconf -LLPAR Info: 1 06-C891Gindyoradst#

HMC: List partitions authenticated by RMC/opt/csm/bin/lsnodes -a Status partition01 1 partition02 0 partition03 1 Where 1 means LPAR is activated and authenticated for DLPAR; 0 means otherwise. If the LPAR is activated and still shows Active<0>, you could have either network or hostname setup problems. If you have just rebooted the HMC, wait for a few minutes. If nothing changes after that, check your hostname/network setup in Setting up HMC/partitions hostname and network.

HMC: List partitions recognized by DLPAR lspartition -dlpar <#0> Partition:<001, partition01.company.com, 9.3.206.300> Active:<1>, OS:<AIX, 5.2>, DCaps:<0xf>, CmdCaps:<0x1, 0x0> <#1> Partition:<002, partition02.company.com, 9.3.206.300> Active:<0>, OS:<AIX, 5.2>, DCaps:<0xf>, CmdCaps:<0x1, 0x0> <#2> Partition:<003, partition03.company.com, 9.3.206.300> Active:<0>, OS:<, 5.1F>, DCaps:<;0x0>, CmdCaps:<0x0, 0x0> If all active AIX 5.2 partitions are listed as Active<1>, ..., DCaps:<0xf> your system has been set up properly for DLPAR, and you can skip the checklist now. (In this example, LPAR 002 is being shut down, and LPAR 003 is not activated because it is at AIX 5.1.) If you're missing some active partitions or some partitions are reported as Active<0>, your system probably still has a network/hostname set up problem. See Setting up the HMC/partitions hostname and network. (If your LPAR is Active<1> but the GUI is still not DLPAR capable, do a rebuild to get around this problem. See the Appendixes in this article for more information.) If you still can't get partitions recognized by DLPAR after verifying the

Page 18: Aix Commands

checklist, contact IBM service personnel.

HACMP Commands

logs/tmp/hacmp.out Detailed event script output logged in 7 day rolling history/var/adm/cluster.log High level view of cluster events (No clean up on this file)/usr/sbin/cluster/history/cluster.mmdd Day by day view of cluster events. (one file / day of month)/tmp/cm.log Clstrmgr messages/tmp/cspoc.log Output from C-SPOC commands (similar to smit.log)/tmp/emuhacmp.out Output from event emulationrdist -b -f /etc/disfile1 To distribute the files in disfile1 to all nodes in disfile1 in binary mode

Sample entry for disfile1HOSTS = ( root@node1 root@node3 )FILES = ( /etc/passwd /etc/security/passwd)${FILES} -> ${HOSTS}

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 resourcesclstop -g -N To do graceful shutdown immediately with no takeoverclstop -gr -N To do graceful shutdown immediately with takeover

cldare -t To sync the cluster toplogycldare -t -f To do the mock sync of topologycldare -r To sync the cluster resourcescldare -r -f To do the mock sync of resources

clverify cluster verification utility

cllscf To list clustur topology informationcllsclstr To list the name and security level of the clustercllsnode To list the info about the cluster nodescllsnode -i node1 To list info about node1cllsdisk -g shrg To list the PVID of the shared hard disk for resource group shrgcllsnw To list all cluster networkscllsnw -n ether1 To list the details of network ether1cllsif To list the details by network adaptercllsif -n node1_service To list the details of network adapter node1_servicecllsvg To list the shared vgs which can be accessed by all nodescllsvg -g sh1 To list the shared vgs in resource group sh1cllslv To list the shared lvs cllslv -g sh1 To list the shared lvs in the resource group sh1cllsdisk -g sh1 To list the PVID of disks in the resource group sh1cllsfs To list the shared file systems

Page 19: Aix Commands

cllsfs -g sh1 To list the shared file systems in the resource group sh1cllsnim Show info about all network modulescllsnim -n ether Show info about ether network modulecllsparam -n node1 To list the runtime parameters for the node node1cllsserv To list all the application servers

claddclstr -i 3 -n dcm To add a cluster definition with name dcm and id 3claddnode To add an adaptercladdnim To add network interface modulecladdgrp -g sh1 -r cascading -n n1 n2 To create resource group sh1 with nodes n1,n2 in cascadecladdserv -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 2clchclstr -s enhanced To change the clustur security to enhancedclchnode To change the adapter parametersclchgrp To change the resource group name or node relationshipclchparam 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 definitionclrmgrp -g sh1 To delete the resource group sh1 and related resourcesclrmnim ether To remove the network interface module etherclrmnode -n node1 To remove the node node1clrmnode -a node1_svc To remove the adapter named node1_svcclrmres -g sh1 To remove all resources from resource group sh1clrmserv app1 To remove the application server app1clrmserv ALL To remove all applicaion servers

clgetactivenodes -n node1 To list the nodes with active cluster manager processes from cluster

manager on node node1clgetaddr node1 returns a pingable address from node node1clgetgrp -g sh1 To list the info about resource group sh1clgetgrp -g sh1 -f nodes To list the participating nodes in the resource group sh1clgetif To list interface name/interface device name/netmask associated with

a specified ip label / ip address of a specific nodeclgetip 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.0clgetvg -l nodelv To list the VG of LV nodelv

cllistlogs To list the logs

clnodename -a node5 To add node5 to the clusterclnodename -o node5 -n node3 To change the cluster node name node5 to node3

clshowres Lists resources defined for all resource groupclfindres To find the resource group within a cluster

Page 20: Aix Commands

xclconfig X utility for cluster configurationxhacmpm X utility for hacmp managementxclstat X utility for cluster status

SP CommandsDaemons

hats Topology services hatsd ( /usr/sbin/rsct/bin/hatsctrl script)hags Group services hagsd (/usr/sbin/rsct/bin/hagsctrl script)haem Event management haemd (/usr/sbin/rsct/bin/haemctrl script)hr Host responds hrd (/usr/sbin/rsct/bin/hrctrl script)pman Problem managementpmand,pmanrmd (/usr/sbin/rsct/bin/pmanctrl script)

fault_service_Worm_RTG_SP (WORM) Switch daemon on nodes (/usr/lpp/ssp/rc.switch called by css_restart_node)

kadmind The authentication database daemon for password changing and administration toolsListens port 751. It checks acl files admin.acl.(get,mod,add) in /var/kerberos/database/.k file for master key and /var/kerberos/databse/pricipal.pag, pricipal.dir for authenticationdatabase.

kerberos Daemon that provides authentication services & ticket granting ticket for clients.kpropd Daemon to receive update for a secondary database serverhardmon Daemon that monitors and controls the state of SP hardware

It checks acl file /spdata/sys1/spmon/hmacls

install_cw To complete PSSP installation on cws(Installs PSSP programs for SMIT panelsStarts and configures SDRSets node number 0 for cws in ODMCreates hmacls file with rood.admin entry in Starts and configure PSSP daemonsConfigures default partition)

setup_authent To setup workstation as SP authentication server(Creates /etc/krb.conf, /etc/krb.realms filesCreates authentication database using kdb_edit commandCreate master key file /.k using kstash commandAdds kadmin and kerberos to inittab file and starts themDefine initial auth. admin (eg:- root.admin) using kdb_edit commandCreates Kerberos ACLS (admin_acl.get,mod,add files) Execute kinit for root.admin and creates local service principals(hardmon.cws, rcmd.cws)Creates /.klogin file and add admin principal to itCreates /etc/krb-srvtab file using ext_srvtab command)

setup_server To setup CWS as BIS

Page 21: Aix Commands

splst_versions -G -t To check the PSSP versions in all nodesspmon_ctest To verify system monitor configured properlyspmon_itest To verify system monitor installed properly & operationalSYSMAN_test To verify the system management componentCSS_test To verify communication subsystem

SDR_test -l si To verify SDR and logs the errors in file siSDRListClasses To list the class name in the SDRSDRArchive si To backup SDR in the directory /spdata/sys1/sdr/archives with name

backup.<year><Julian day>.<hour><minute>.sisprestore_config backup.<year><Julian day>.<hour><minute>.si

To restore SDR and partion sensitive subsystemsSDRGetObjects Syspar To get the system partition infoSDRGetObjects syspar_map To get the system partition map (with node info)SDRGetObjects Adapter node_number netaddr

To get the node number and net address in the Adapter classSDRDeleteObjects Adapter netaddr==193.9.200.227

To delete class Adapter with netaddr value 193.9.200.227SDRChangeAttrValues Node node_number==9 bootp_response==install

To change the boot response as install on node with node number 9SDRWhoHasLock <class_name> Returns the transaction ID of a lock on a specified classSDRClearLock <class_name> To unlock an SDR class

syspar_ctrl -G -A To add and restart all system partition sub systems syspar_ctrl -G -D To stop and delete all system partition sub systemssyspar_ctrl -R To restore all system partition sub systems in current partitionsyspar_ctrl -E To list all system partition sub systemssyspar_ctrl -s To start all system partition sub systems in current partitionsyspar_ctrl -k To stop all system partition sub systems in current partitionsyspar_ctrl -r To refresh all system partition sub systems in current partition

ngcreate -s 1:1 si To create node group si with 1st node in 1st framengcreate -n 1 2 3 si To create node group si with 1st 2nd and 3rd nodesngcreate -N ng1,ng2 si To create node group si with node groups ng1 and ng2ngcreate -w n1,n2 si To create node group si with host name n1 and n2ngcreate -ae n1,n2 si To create node group si with all nodes in the current partition

excluding hosts n1 and n2

nglist To list node groups in current partitionnglist -G To list node groups globallyngfind si To find all node groups which contain node group singnew si1 si2 si3 To create 3 node groups with names si1 si2 and si3ngnew -G si1 si2 si3 To create 3 node groups globally with names si1 si2 and si3ngresolve -G -n si To resolve the nodes in the node group si as node numbers

with global optionngresolve -w si To resolve the nodes in the node group si as fully qualified host namengresolve -d si To resolve the nodes in the node group si as fully qualified ip address

Page 22: Aix Commands

ngdelete si si1 To remove node groups si and si1ngdelete -u si To remove node group si but leave entries in other node groups

which is having the entries in itngclean -Ga To clean up all node groupsngaddto si 1 2 To add nodes 1 and 2 to the existing node group singaddto si 1 2 ng1 To add nodes 1,2 and node group ng1 to node group singdelfrom si 1 2 To remove nodes 1 and 2 from node group singdelfrom si 1 2 ng1 To remove nodes 1, 2 and node group ng1 from node group si

spled -G To display leds of nodes in a multi partition systemspled or spmon -L To display leds of nodes in the current partion

spmon -p off frame2/node3 To power off node3 in frame 2spmon -p on frame2/node3 To power on node 3 in frame 2spmon -G -p on frame2/node3 To power on node3/frame 2 if it is outside current partitionspmon -k service /frame2/node3 To change the key settings to servicespmon -p off frame1 To power off frame1spmon -K frame1/node1 To see the key settings of frame1/node1spmon -reset frame1/node1 To resetspmon -open frame1/node1 To open a tty on frame1/node1==(s1term -w 1 1)spmon -d To run the diag in the current partition spmon -G -d To run the diag globally

hmmon -V 1:1 Displays a descriptive list of symbolic variable nameshmmon -Q -s 1:1 Displays the state of node1 in frame 1 and existshmmon -q -s 1:1 Displays and monitors continuously

hmreinit To stop and restart hardmon

hmcmds -G off all To power off all hardwarehmcmds -G off 1:3 To power off slot 3 in frame 1hmcmds -G on 1:3 To power on slot 3 in frame 1hmcmds -v -G boot_supervisor 1:1 To reset the power of node_supervisor card on slot 1 frame 1

(Use full to close the opened ttys on nodes)hmcmds secure l 1-3:2 To change the key in secure mode for slot 2 in frame 1 2 and 3hmcmds -v synch_reset Perform sync reset. To clear the switch errorshmcmds -v power_on_reset Perform sync reset and do self test of switch chips

cstartup -G all To startup all nodes globallycstartup -N 1 2 4-8 To startup nodes 1,2 and 4 to 8cstartup -g si To startup node group sicstartup -GZ all To startup all nodes. With Z it will restart the nodes which are already

running (otherwise command will exit)cstartup -k all To verify the startup with sequence file (StartSeq)cstartup -E all To startup all nodes ignoring the sequence file

cshutdown -F node1 To shutdown node1 immediatelycshutdown -h node1 To halt the node node1

Page 23: Aix Commands

cshutdown -g si To shutdown the nodes in the node group sicshutdown -G -N 1 3 4-7 To shutdown nodes 1 3 and 4 to 7 regardless partitioncshutdown -X -N 1 2 3 To shutdown nodes 1 2 and 3 ignoring sequence file

hostlist -av To list sp host name which is activehostlist -avd To list the hosts in ipaddress which are activehostlist -dw node1 Returns the ip of the node node1hostlist -N si List the host names in the node group sihostlist -s 1-4:4 List the hostname of the node in 4th slot in frames 1-4

nodecond -n 1 1 To get the ehternet address of the node 1 in frame 1nodecond 1 1 To network boot the node 1 in frame 1

splstdata -h To list the hardware info (equivalent to lscfg )splstdata -i To list the network adapter data (equivalent to netstat -in)splstdata -v To list VG info on nodessplstdata -t To list extension node configsplstdata -b To list boot install infosplstdata -n To list node informationsplstdata -s To list node switch informationsplstdata -d To list file system info (equivalent to df)splstdata -p To list SP partition infosplstdata -e To list the sp environment variables like ntp_config, amd_configEfence To display all nodes fencedEfence 193.9.1.2 193.9.1.5 To fence nodes with ips 193.9.1.2 and 3Efence node1 node3 To fence nodes node1 and node3Efence -autojoin node1 To fence out but will unfence it after reboot

Eunfence 193.9.1.2 193.9.1.5 To unfence nodes with ips 193.9.1.2 and 3Eunfence node1 node3 To unfence nodes node1 and node3

Estart To start sp switchEstart -autounfence -0 To start sp switch and turn off autounfence feature

(1 for autounfence enabled)

Eunpartition To prepare a system partition for repartitioning

delnimclient -l 1 2 3 To delete nim client definition for nodes 1 2 and 3 from NIM mastermknimclient -l 1 2 3 To make node 1 2 and 3 as NIM clientsdelnimmast -l 1 17 33 To unconfigure nodes 1 17 and 33 as NIM masters and remove filesetsmknimmast -l 1 17 33 To make nodes 1 17 and 33 as NIM masters

lshacws To list the status of the CWS

ntpdate 90.1.2.1 Sets date and time by enquiring ntp server 90.1.2.1

spbootlist -l 1 2 To set the bootlist on nodes 1 and 2

nodecond 1 4 To network boot the node 4 in frame 1

Page 24: Aix Commands

nodecond -n 1 4 To fetch the ethernet address of node 4 in frame 1sphrdwrad 1 3 2 To fetch mac address for node 3 and 4 in frame 1

setup_authent To setup a cws to use kerberos authenticationkdb_destroy To destroy the kerberos databasecreate_krb_files Searches for nodes in install/Customise mode and create krb-srvtab file

for those nodes. (Creates in tftpboot directory of CWS.)ext_srvtab -n node1 To extract service key files from the database for instance node1ext_srvtab -n SPbgAdm To extract service key files from the database for instance SPbgAdm

(Creates in the present directory with name <instance>-new-srvtab)spsetauth -d k4 std To set the authentication methods as k4 and standardchauthpar k4 std To change the authentication methods as k4 and std

kpasswd To change the kerberos principals password

lsauthent To list the authentication table

k4init siju To get the kerberos ticket for principal sijuk4init -v siju To get the same as above but give verbose outputk4init -i siju To get the same but the machine will ask for the instancek4init -r siju To get the same for a different realm (U can specify realm)k4init -l siju To get the same for the life time in minutes which u specify

rcmdtgt To obtain a maximum life time ticket for rcmd services on local node

k4list To list the ticket cache and principal’s namek4list -srvtab To list the contents of the server key file

chkp -l 6 siju To change the life time of the principal siju to 30 minutes (6 x 5)chkp -e 2001-5-23 siju To change the expiry date of principal siju to 2001 may 23

lskp -p To list the predefined kerberos principalslskp -s To list the kerberos service principalslskp -c To list the kerberos client principalslskp siju abc To list the principals of siju and abc

rmkp siju To remove the principal sijurmkp -n siju To remove the principal siju without prompting for confirmationrmkp -v siju To remove the principal with verbose output

kdb_edit To change the attributes of the kerberos principalskdb_edit -n To avoid asking master key and get it from .k file

kdb_util dump /si.bak To backup the kerberos database to si.bak filekdb_util load /si.bak To restore the kerberos database from file si.bak. kdb_util new_master_key To change the master key

Page 25: Aix Commands

kadmin To add,delete,see,change password,change admin passwd of kerberosekadmin ank To add a new kerberos principalkadmin cpw To change the password of a principalkadmin cap To change admin passwordkadmin get To get the details of a principalkadmin dest To destroy admin ticket

kstash To save the master key in the .k file

kdb_init To initialize the kerberos system

ksrvutil list To list the principals and version number in the server key fileksrvutil -f /etc/srvtab.bak list To list the principals in the file /etc/srvtab.bakksrvutil change To change the key version in the default srvtab fileksrvutil delete To delete the keys in the /etc/krb-srvtab fileksrvutil -f /etc/srvtab.bak delete To delete the keys in the /etc/srvtab.bak filespacs_cntrl block user1 To block user1 on the nodespacs_cntrl unblock user1 To unblock user1spacs_cntrl deny user1 To deny user1spacs_cntrl allow user1 To allow user1spacs_cntrl -f /tmp/si deny To deny the list of the users in the file /tmp/sicw_allowed List of users to be allowed to login to CWScw_restrict_login Script which will deny user to login to cws and allow them to change

the passwd (files are /usr/lpp/ssp/config/admin directory and entry forsecond file will be in /etc/profile file)

spmkuser id=1234 pgrp=system groups=system,bin home=node1:/home/siju sijuTo create SP user siju with id 1234, primary groups system, secondarygroups system,bin and home directory home/siju of node1

sprmuser -ipr siju To remove the SP user siju (I for interactive, p for removing info from

passwd file and r for removing the home directory)

splsuser -c siju To list the attributes of sp user siju in column formatsplsuser -f siju To list the attributes of sp user siju in stanza format

spchuser groups=dev,system sh=/bin/ksh sijuTo change the shell to ksh and secondary groups to dev,system of SP user siju

supper -v To go to the supper prompt in verbose modesupper update To update all file collectionssupper status To see the status of the file collectionssupper when To list when last updation occuredsupper where To show current servers for updation

Page 26: Aix Commands

supper log To show summary of last or current updationsupper rlog To show the details of last of current updationsupper file user.admin To list the files in the file collection user.adminsupper install siju To install the file collection sijusupper remove siju To remove file collection sijusupper update user.admin To update file collection user.adminsupper diskinfo To show the diskspace and current VG

Procedure to Build a file collection with name siju for files in /home/siju

1) go to /var/sysman/sup2) create dir siju3) change ownership and group of siju to bin4) copy contents of /var/sysman/sup/user.admin to siju5) edit list file for including and omitting files in /home/siju directory

It should contains entry like the following

symlinkallupgrade ./home/sijuomit ./home/siju/abcomitany ./home/siju/s*

6) Add a symbolic link to siju file in lists directory to list in siju directoryie ln -s /var/sysman/sup/siju/list /var/sysman/sup/lists/siju

7) Update /var/sysman/file.collections file with following entryprimary siju - / - / EDO power no

8) Update sup.admin file collection to reflect the changes made to file.collectionsdsh -av supper update sup.admin

9) Install file collection siju in the nodes dsh -av supper install siju

sysctld Sysctl server daemon/etc/sysctl.conf Sysctl configuration file

setauth -cmd svcconnect NONE To allow non kerberos users to execute sysctl commands(Entry in sysctl.conf file)setauth -cmd pdf {ACL /etc/si.acl} To change the acl file for pdf command to /etc/si.acl(Entry in sysctl.conf file)

/etc/sysctl.acl Default acl file for sysctl

sysctl -h node1 Opens a sysctl command interface for node node1sysctl -h node1 aclcheck siju To check entry for siju in the default acl file (sysctl.acl)sysctl -h node1 -f /etc/si.acl siju To check entry for siju in the acl file /etc/si.aclsysctl -h node1 info commands To list the authorized commands for the current principalsysctl -h node1 acladd -p siju To add the principal siju to the default ACL filesysctl -h node1 -f /etc/si.acl acladd -p siju To add the principal siju to /etc/si.acl ACL file

Page 27: Aix Commands

sysctl -h node1 acldelete -p siju To delete the principal siju to the default ACL filesysctl -h node1 -f /etc/si.acl acldelete -p siju To delete the principal siju to /etc/si.acl ACL filesysctl -h node1 acllist To list the entries in the default acl filesysctl -h node1 -f /etc/si.acl acllist To list the entries in /etc/si.acl filesysctl -h node1 aclcreate -p root.admin -p siju -f /etc/si.acl

To create acl file /etc/si.acl with the entries root.admin and sijusysctl -h node1 checkauth -cmd pdf To check authorization for command pdf for the current usersysctl -h node1 confadd include /etc/si.acl To include the acl file si.acl in the sysctl.conf filesysctl -h node1 confdelete include /etc/si.acl To remove the acl file si.acl from sysctl.conf filesysctl -h node1 svcrestart To restart the sysctld daemon on node node1

Steps to create a Syctl application

Task :- User siju (kerberos principal siju.adm) should get the permission to start a subsystem by executing the command substart. Permission should not be given to other users.

1) Create the client application substart in /usr/bin directory of cws with following contentsif [ $# -gt 2 ]

then echo "Arguments exceed the limit"exit 1

fi/usr/lpp/ssp/bin/hostlist -n $1 | /usr/bin/sysctl -c - substart_proc $2In the above script if condition will check for the number of arguments and execute procedure

on corresponding host

2) Change the mode to executable chmod 755 /usr/bin/substart

3) Create server application substart.tcl with a procedure substart_proc with following contentscreate proc substart_proc {SubSystem} AUTH {global SCUSERif [ aclcheck -f /etc/substart.acl $SCUSER ] {

exec /etc/substart.srv $SubSystemreturn} }

if condition in the above example checks for kerberos user in the acl file /etc/substart.aclIf the condition is true it execute the command /etc/substart.srv with arguments passed bysubstart command

4) Create the script substart.srv with following contentsstartsrc -s $2This script execute the command startsrc with the argument passed by the substart command

5) Change the mode to executable chmod 755 /etc/substart.srv

6) Create acl file substart.acl with the entry for user siju#acl#_PRINCIPAL siju.adm@CWS

7) Add the application to the sysctl by adding following line to sysctl.conf fileinclude /etc/substart.tcl

8) Distribute the files to all nodes

Page 28: Aix Commands

pcp -av /usr/bin/substartpcp -av /etc/substart.tclpcp -av /etc/substart.srvpcp -av /etc/substart.aclpcp -av /etc/sysctl.conf

9) Restart the sysctld daemon to get the new information on cws and on all nodes10) Get the kerberos ticket for user siju and execute following command

substart 3 lpdThis should start the lpd daemon on node 3

11) Try the above command with any other kerberos ticket. Result should be negative

NIM Commands

smit nimconfig Configure and start NIM mastersmit nim_mknet Create NIM network objectssmit nim_mkroute Define NIM network routessmit nim_mkmac Create client network objectsmit nim_mkres Create lpp_sourcesmit nim_alloc Create bos.inst resourceslsnim List NIM-defined objectsbootinfo -q Check IPL ROM emulationbosboot -r Create IPL ROM mediasmit nim_alloc Create bos_inst resource on clientsmit nim_perms Set master push permissionsmit nim_mac_op Select client and resourcesmit nim_mkgrp Create a NIM client groupsmit bos_inst Push install stand-alone clientsmit nim_install Pull install from clientsmit dksl_init Initialize diskless clientsmit nim_mac_opp lppchk Verify installationsmit nim_backup_db Back up NIM configurationsmit nim_restore_db Restore NIM configurationsmit nim_client_op Remotely operate a NIM clientsmit nim_unconfig Unconfigure NIM masternimconfig -a pif_name=en0 -a netname=net1

To initialise the NIM master with network name net1nimconfig -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 mksysb1To define mksysb resource mksysb1, from source /resources/mksysb.image on master

nim -o remove inst_resource To remove the resource inst_resourcenim -o check lpp_source1 To check the status of lpp_source lpp_source1

Page 29: Aix Commands

nim -o allocate -a spot=spot1 -a lpp_source=lpp_source1 node1To allocate the resources spot1 and lpp_source1 to the the client node1

nim -o bos_inst node1 To initialise NIM for the BOS installation on node1 with the allocated resourcesnim -o dkls_init dcmds To initialize the machine dcmds as diskless operationnim -o dtls_init dcmds To initialize the machine dcmds for dataless operationnim -o cust dcmds To initialize the machine dcmds for customize operationnim -o diag dcmds To initialize the machine dcmds for diag operationnim -o maint dcmds To initialize the machine dcmds for maintenance operationnim -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 xxxxxnim -o unconfig master To unconfigure nim master masternim -o allocate -a spot=spot1 dcmds To allocate the resource spot1 from machine dcmdsnim -o deallocate -a spot=spot1 dcmds To de allocate the resource spot1 from machine dcmdsnim -o remove dcmds To remove machine dcmds after removing all resources associated to itnim -o reboot dcmds To reboot ther client dcmdsnim -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/cd0lsnim To list the nim resourceslsnim -l dcmds To list the detailed info about the object dcmdslsnim -O dcmds To list the operation dcmds object can supportlsnim -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 )

Network Install Manager (NIM)1. First, create a /tftpboot filesystem before running smitty nim_config_env. To create the /tftpboot

filesystem and install the NIM software, use the following command sequence:# mklv -y 'lvtftp' rootvg 1# crfs -v jfs -d lvtftp -m /tftpboot -A yes# mount /tftpboot# chfs -a size=120000 /tftpboot# df -k /tftpboot# installp -qaX -d <device> bos.sysmgt..nim.master bos.sysmgt.nim.spot# smitty nim_config_env

2. Create a /tftpboot filesystem and install the NIM filesets using the preceding command sequence.3. Configure the NIM Master from CD-ROM using smitty nim_config_env.4. Define the client machine(s) using smitty nim_mac.5. Create a mksysb image and define a mksysb resource using smitty nim_res.6. Install a stand-alone client from the mksysb image using smitty nim_bosinst.7. Boot the client.

NFS DaemonsThere are a number of daemons that need to run on both the client and the server.Client

biod Improves NFS performance by filling and emptying the buffer cache. By default 6 biod daemons are started however this can be changed to improve performance. These are started in the /etc/rc.nfs file.

rpc.statd Allows the remote procedure calls

Page 30: Aix Commands

rpc.lockd Handles File lockingServer

portmap Provides a standard way of looking up the port for a certain application. The application registers with portmap, then portmap listens on the appropriate port. When a client communicates on the NFS port, portmap replies with the real port number of NFS. Portmap is included in the /etc/rc.tcpip file and must be started before inetd and the RPC servers so that it can accept the registrations.

nfsd A server daemon that handles the client requests for file system operations. Each daemon accepts one request at a time, however once it has passed the request on to the kernel it is free to accept a new request. Bu default 8 nfsd daemons are started, however if the server is a busy nfs server then a value 50 to 100 might be more appropriate. These are started from /etc/rc.nfs and are under the control of SRC.

rpc.mountd Accepts a mount request from the client and allows the export if authorised.rpc.statd Allows Remote procedure callsrpc.lockd Implements file locking

NIS Servers and Clients Configuration# smit mkmasterHOSTS that will be slave servers [slave1,slave2]Can existing MAPS for the domain be overwritten? yesEXIT on errors, when creating master server? yesSTART the yppasswdd daemon? noSTART the ypupdated daemon? noSTART the ypbind daemon? yesSTART the master server now, bothat system restart, or both?

# smit mkslaveHOSTNAME of the master server [Master]Can existing MAPS for the domain be overwritten? yesSTART the slave server now, bothat system restart, or both?Quit if errors are encountered? Yes

# smit mkclientSTART the NIS client now, bothat system restart, or both?NIS server - required if there are no []NIS servers on this subnet

To stop, start, or check status of the NIS client ypbind daemon, run the following commands:# lssrc –s ypbind# stopsrc –s ypbind# startsrc –s ypbind

NIS Packages - bos.net.nis

Starting NIS ServicesLike NFS, NIS is managed as a subsystem under AIX. NIS daemons are started using the SRC startsrc

Page 31: Aix Commands

and stopsrc commands. The /etc/rc.nfs script contains code to start up NIS services before bringing up NFS.# startsrc -g nis# stopsrc -g nis

The NIS daemons are as follows:ypserv NIS server daemonypbind NIS server binding manageryppasswdd NIS passwd update daemonypupdated NIS map update invoked by inetdkeyserv Public key server daemonportmap RPC program to port manager

NIS PLUSNIS Packages - bos.net.nisplus

To create NIS+ master servers and clients, invoke the SMIT FastPath smit nisp_config. AIX also provides setup scripts to set up NIS+: nisserver, nispopulate, and nisclient.

The following table contains a list of common NIS+ commands to manage different NIS+ components.

Command Descriptionniscat Displays object properties of an NIS+ tablenisls Displays the contents of an NIS+ tablenisrmdir Removes an NIS+ object from a namespacenisrm Removes NIS+ directories and subdirectories from a namespacerpc.nisd The NIS+ daemon; provides NIS+ servicesnisinit Initializes a workstation to be an NIS+ clientnis_cachemgr Starts the NIS+ cache manager daemonnisshowcache Displays the contents of the shared cache filenisping Pings the replicas and prompts for updatingnislog Displays the contents of the transaction lognisgrpadm Creates, deletes, and performs miscellaneous administration operations on NIS+ groupsnisdefaults Displays the seven default values currently active in the namespacenisaddent Creates NIS+ tables from corresponding /etc files or NIS maps

Starting NIS+ ServicesLike NIS, NIS+ is managed as a subsystem under AIX. NIS+ daemons are started using the SRC startsrc and stopsrc commands. The /etc/rc.nfs script contains steps to start up NIS+ services.# startsrc -g nisplus# stopsrc -g nisplus

NIS+ daemons are as follows:rpc.nisd NIS+ server daemonrpc.nispasswd NIS+ passwd update daemonnis_cachemgr NIS+ cache manager daemon

Sendmail FilesThe sendmail MTA uses the following files for configuration and data:/etc/mail/sendmail.cf Sendmail configuration file

Page 32: Aix Commands

/etc/mail/aliases Mail aliases/etc/mail/aliases.db Compiled alias file/etc/mail/sendmail.pid PID of sendmail daemon/etc/sendmail.pid Link to sendmail.pid file/etc/mail/statistics Mail statistics

The sendmail program accesses configuration file information from a compiled version of the /etc/sendmail.cf table. To compile a new version of the database, use sendmail with the -bz flag.# /usr/lib/sendmail –bz --- Compile a new sendmail.cf database

sendmail accesses alias information from a dbm version of the /etc/aliases table. To compile a new version of the /etc/aliases table, use /usr/lib/sendmail -bi.# /usr/lib/sendmail –bi ---- Create new alias database

The sendmail program is invoked as a subsystem from the /etc/rc.tcpip script. The AIX sendmail automatically compiles the /etc/mail/aliases and /etc/mail/sendmail.cf files when it is started. If you are running a non-IBM-supplied sendmail, you may need to force a compile of these files as part of the start-up. If you update any of the configuration information while sendmail is running, refresh the sendmail subsystem by issuing an SRC refresh command or by sending the daemon a SIGHUP.# refresh -s sendmail# kill -1 'head –1 /etc/sendmail.pid'

The basic startup flags for sendmail should invoke sendmail as a daemon and specify the time in minutes between mail queue scans for postponed messages. These flags are -bd and -q<time>.# /usr/lib/sendmail -bd -q30m # Start and scan mail queue every 30 minutes

To stop the sendmail daemon, use the SRC stopsrc command or send a SIGABORT to the daemon.# stopsrc -s sendmail# kill -6 'head –1 /etc/sendmail.pid'

To restart the stopped server, use the SRC startsrc command. (Note that startingsendmail with startsrc requires an additional parameter.)# startsrc -s sendmail -a'-bd -q30m'

To check the status of the sendmail daemon, use the SRC lssrc command.# lssrc -s sendmail

To display the set of supported signals, use the -l argument of the kill command:# /bin/kill -l

Page 33: Aix Commands

Datavg recovery

# varyonvg datavg0516-082 varyonvg: Unable to access a special device file. Execute redefinevg and synclvodm to build correct environment.snitsoradbs06# lsvgrootvgdatavgsnitsoradbs06# lsvg datavg0516-010 : Volume group must be varied on; use varyonvg command.

# lsdev -Cc diskhdisk0 Available 08-08-00-3,0 16 Bit LVD SCSI Disk Drivehdisk1 Available 08-08-00-4,0 16 Bit LVD SCSI Disk Drivehdisk2 Available 08-08-ff-0,0 SCSI RAID 5 Disk Array

# lspvhdisk0 00cdb75d801c9e88 rootvg activehdisk1 00cdb75dc9733fb1 rootvg activehdisk2 00cdb75d0ae46707 datavg

# redefinevg -d hdisk2 datavg

# synclvodm datavg0516-010 : Volume group must be varied on; use varyonvg command.0516-544 synclvodm: Unable to access volume group datavg.

# varyonvg datavg

# mount -amount: 0506-324 Cannot mount /dev/hd1 on /home: The requested resource is busy.mount: 0506-324 Cannot mount /proc on /proc: The requested resource is busy.mount: 0506-324 Cannot mount /dev/hd10opt on /opt: The requested resource is busy.mount: 0506-324 Cannot mount /dev/lv09 on /unix_stage: The requested resource is busy.mount: 0506-324 Cannot mount /dev/lv00 on /oracle: A file or directory in the path name does not exist.mount: 0506-324 Cannot mount /dev/lv01 on /oracle/data1: A file or directory in the path name does not exist.mount: 0506-324 Cannot mount /dev/lv02 on /oracle/data2: A file or directory in the path name does not exist.mount: 0506-324 Cannot mount /dev/lv03 on /oracle/data3: A file or directory in the path name does not exist.mount: 0506-324 Cannot mount /dev/lv04 on /oracle/data4: A file or directory in the path name does not exist.mount: 0506-324 Cannot mount /dev/lv05 on /bkup_arch_logs: A file or directory in the path name does not exist.mount: 0506-324 Cannot mount /dev/lv06 on /transfer_edi: A file or directory in the path name does not exist.mount: 0506-324 Cannot mount /dev/lv08 on /apps: A file or directory in the path name does not exist.mount: 0506-324 Cannot mount /dev/lv07 on /non_edi_data: A file or directory in the path name does not exist.

# mount /oraclemount: 0506-324 Cannot mount /dev/lv00 on /oracle: A file or directory in the path name does not

Page 34: Aix Commands

exist.

# fsck /dev/lv00fsck: 0506-035 /dev/lv00 is not a known file system.

# ls /dev/lv00ls: 0653-341 The file /dev/lv00 does not exist.# varyoffvg datavg

# exportvg datavg

# importvg -y datavg hdisk2datavg

# lsvgrootvgdatavg

# lsvg -l datavgdatavg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTloglv00 jfslog 1 1 1 closed/syncd N/Alv00 jfs 57 57 1 closed/syncd /oraclelv01 jfs 92 92 1 closed/syncd /oracle/data1lv02 jfs 103 103 1 closed/syncd /oracle/data2lv03 jfs 110 110 1 closed/syncd /oracle/data3lv04 jfs 149 149 1 closed/syncd /oracle/data4lv05 jfs 4 4 1 closed/syncd /bkup_arch_logslv06 jfs 1 1 1 closed/syncd /transfer_edilv07 jfs 1 1 1 closed/syncd /non_edi_datalv08 jfs 6 6 1 closed/syncd /apps

Page 35: Aix Commands

AIX FS Recovery

Maintenance Type the number of your choice and press Enter. >>> 1 Access a Root Volume Group 2 Copy a System Dump to Removable Media 3 Access Advanced Maintenance Functions 4 Install from a System Backup 88 Help ? 99 Previous Menu >>> Choice [1]: 1 Warning: If you choose to access a root volume group, you will not be able to return to the Base Operating System Installation menus without rebooting. Type the number of your choice and press Enter. 0 Continue 88 Help ? >>> 99 Previous Menu >>> Choice [99]: 0 Access a Root Volume Group Type the number for a volume group to display the logical volume information and press Enter. 1) Volume Group 00cdb75d00004c0000000103fba9f700 contains these disks: hdisk1 70006 08-08-00-4,0 hdisk0 70006 08-08-00-3,0 2) Volume Group 00cdb75d00004c00000001040ae47c8c contains these disks: hdisk2 134560 08-08-ff-0,0 Choice: 1 Volume Group Information ------------------------------------------------------------------------------ Volume Group ID 00cdb75d00004c0000000103fba9f700 includes the following logical volumes: hd5 hd6 hd8 hd4 hd2 hd9var hd3 hd1 hd10opt fwdump lg_dumplv paging00

Page 36: Aix Commands

paging01 paging02 lv09 lv10 ------------------------------------------------------------------------------ Type the number of your choice and press Enter. 1) Access this Volume Group and start a shell 2) Access this Volume Group and start a shell before mounting filesystems 99) Previous Menu Choice [99]: 2 Importing Volume Group... rootvg Checking the / filesystem. log redo processing for /dev/rhd4 syncpt record at 5137028 end of log 5137028 syncpt record at 5137028 syncpt address 5137028 number of log records = 1 number of do blocks = 0 number of nodo blocks = 0 /dev/rhd4 (/): ** Unmounted cleanly - Check suppressed Checking the /usr filesystem. /dev/rhd2 (/usr): ** Unmounted cleanly - Check suppressed Exit from this shell to continue the process of accessing the root volume group. # fsck /dev/hd1 ** Checking /dev/rhd1 (/home) ** Phase 0 - Check Log log redo processing for /dev/rhd1 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Inode Map ** Phase 6 - Check Block Map 2801 files 986057 blocks 8451127 free

# fsck /dev/hd2 ** Checking /dev/rhd2 (/usr) ** Phase 0 - Check Log log redo processing for /dev/rhd2 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity

Page 37: Aix Commands

** Phase 4 - Check Reference Counts ** Phase 5 - Check Inode Map ** Phase 6 - Check Block Map 32400 files 10371960 blocks 2473096 free

# fsck /dev/hd3 ** Checking /dev/rhd3 (/tmp) ** Phase 0 - Check Log log redo processing for /dev/rhd3 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Inode Map ** Phase 6 - Check Block Map 1142 files 292240 blocks 1018480 free

# fsck /dev/hd4 ** Checking /dev/rhd4 (/) ** Phase 0 - Check Log log redo processing for /dev/rhd4 ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Inode Map ** Phase 6 - Check Block Map 1998 files 194240 blocks 67904 free

# fsck /dev/hd9var ** Checking /dev/rhd9var (/var) ** Phase 0 - Check Log log redo processing for /dev/rhd9var ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Inode Map ** Phase 6 - Check Block Map 7096 files 2011784 blocks 2968952 free

# fsck /dev/hd10opt ** Checking /dev/rhd10opt (/opt) ** Phase 0 - Check Log log redo processing for /dev/rhd10opt ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity

Page 38: Aix Commands

** Phase 4 - Check Reference Counts ** Phase 5 - Check Inode Map ** Phase 6 - Check Block Map 581 files 56271 blocks 205873 free

# logform /dev/hd8 logform: destroy /dev/hd8 (y)?y

# bootlist -m normal -o cd0 rmt0 hdisk0

# df -k Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/ram0 131072 107680 18% 363 1% / /dev/cd0 611836 0 100% 305918 100% /SPOT

# bootlist -m normal hdisk0 # bootlist -m service hdisk0 # /usr/sbin/shutdown -rF now # exit Saving special files and device configuration information. Checking and mounting the /tmp filesystem. /dev/rhd3 (/tmp): ** Unmounted cleanly - Check suppressed Checking and mounting the /var filesystem. /dev/rhd9var (/var): ** Unmounted cleanly - Check suppressed Filesystems mounted for maintenance work. # bootlist -m normal -o hdisk0

Page 39: Aix Commands

AIX System Recovery

# bootlist -m normal cd0 hdisk0 # bootlist -om normal cd0hdisk0# shutdown -FrRebooting . . .

RIO Configuration+------------- Remote I/O Attachment Summary --------------+

1 = SMS Menu 5 = Default Boot List 8 = Open Firmware Prompt 6 = Stored Boot List

memory keyboard network scsi speaker STARTING SOFTWARE PLEASE WAIT...

Elapsed time since release of system processors: 1 mins 59 secs

------------------------------------------------------------------------------- Welcome to AIX. boot image timestamp: 22:26 04/09 The current time and date: 13:52:27 07/23/2004 number of processors: 2 size of memory: 4096Mbboot device: /pci@400000000111/pci@2,2/scsi@1/sd@5:\ppc\chrp\bootfile.execlosing stdin and stdout...-------------------------------------------------------------------------------

AIX Version 5.2Starting NODE#000 physical CPU#001 as logical CPU#001... done.

******* Please define the System Console. *******

Type a 1 and press Enter to use this terminal as the system console.

HARDWARE SYSTEM MICROCODE Licensed Internal Code - Property of IBM (C) Copyright IBM Corp. 1990, 1994. All rights reserved.

US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

>>> 1 Type 1 and press Enter to have English during install.

Page 40: Aix Commands

88 Help ?

>>> Choice [1]: 1

Welcome to Base Operating System Installation and Maintenance

Type the number of your choice and press Enter. Choice is indicated by >>>.

>>> 1 Start Install Now with Default Settings

2 Change/Show Installation Settings and Install

3 Start Maintenance Mode for System Recovery

88 Help ? 99 Previous Menu

>>> Choice [1]: 3

Maintenance

Type the number of your choice and press Enter.

>>> 1 Access a Root Volume Group 2 Copy a System Dump to Removable Media 3 Access Advanced Maintenance Functions 4 Install from a System Backup

88 Help ? 99 Previous Menu

>>> Choice [1]: 1

Warning:

If you choose to access a root volume group, you will not be able to returnto the Base Operating System Installation menus without rebooting.

Type the number of your choice and press Enter.

0 Continue

88 Help ?>>> 99 Previous Menu

>>> Choice [99]: 0

Access a Root Volume Group

Page 41: Aix Commands

Type the number for a volume group to display the logical volume informationand press Enter.

1) Volume Group 0059d6ca00004c00000000fb91a3829f contains these disks: hdisk5 34757 1D-08-L hdisk4 34757 1D-08-L hdisk3 34757 1n-08-L hdisk2 34757 1n-08-L 2) Volume Group 0059d6ca00004c00000000fb874a4e3a contains these disks: hdisk1 34715 1S-08-00-9,0 hdisk0 34715 1S-08-00-8,0

Choice: 2

Volume Group Information

------------------------------------------------------------------------------ Volume Group ID 0059d6ca00004c00000000fb874a4e3a includes the following logical volumes:

hd5 hd6 paging00 hd8 hd4 hd2 hd9var hd3 hd1 hd10opt lg_dumplv fslv00 pinutil ------------------------------------------------------------------------------

Type the number of your choice and press Enter.

1) Access this Volume Group and start a shell 2) Access this Volume Group and start a shell before mounting filesystems

99) Previous Menu

Choice [99]: 2Importing Volume Group...rootvgChecking the / filesystem.

****************j2_logredo:end of log 0x44ce2cj2_logredo:syncpt record at 0x1433cj2_logredo:syncpt address 0x1433cj2_logredo:log record count = 34955j2_logredo:after record count = 19003j2_logredo:do block count = 455j2_logredo:nodo block count = 118/dev/hd4: Superblock is marked dirty (FIXED)Checking the /usr filesystem.

****************Exit from this shell to continue the process of accessing the rootvolume group.

Page 42: Aix Commands

# logform /dev/hd8logform: destroy /dev/rhd8 (y)?y# fsck -p /dev/hd1

****************# fsck -p /dev/hd2

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

# fsck -p /dev/hd3

****************# fsck -p /dev/hd4

****************# fsck -p /dev/hd9var

****************# fsck -p /dev/pinutil

****************# exitSaving special files and device configuration information.Checking and mounting the /tmp filesystem.

****************Checking and mounting the /var filesystem.

****************Filesystems mounted for maintenance work.

# df -kFilesystem 1024-blocks Free %Used Iused %Iused Mounted on/dev/ram0 65536 53368 19% 1844 14% //dev/hd4 65536 53368 19% 1844 14% //dev/hd2 3014656 1577468 48% 33097 9% /usr/dev/hd3 393216 295708 25% 455 1% /tmp/dev/hd9var 131072 71004 46% 2339 13% /var# lsvg rootvgdbvg# varyonvg dbvg0516-082 varyonvg: Unable to access a special device file. Execute redefinevg and synclvodm to build correct environment.

# lspvhdisk0 0059d6ca0d8bf584 rootvg activehdisk1 0059d6ca7793e65c rootvg activehdisk2 0059d6ca7814ecf6 dbvg

Page 43: Aix Commands

hdisk3 0059d6ca7814ef34 dbvg hdisk4 0059d6ca7814f184 dbvg hdisk5 0059d6ca7814f38f dbvg

# redefinevg -d hdisk2 dbvg

# synclvodm Usage: synclvodm [-v] [-P] VGname [LVname...]# synclvodm dbvg 0516-010 : Volume group must be varied on; use varyonvg command.0516-544 synclvodm: Unable to access volume group dbvg.# varyonvg dbvg# synclvodm dbvg# lsvg -l dbvgdbvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTu01 jfs2 200 200 1 closed/syncd /u01u02 jfs2 200 200 1 closed/syncd /u02u03 jfs2 200 200 1 closed/syncd /u03u04 jfs2 200 200 1 closed/syncd /u04loglv00 jfs2log 1 1 1 closed/syncd N/A

# fsck /u01

****************The current volume is: /dev/u01**Phase 1 - Check Blocks, Files/Directories, and Directory Entries**Phase 2 - Count links**Phase 3 - Duplicate Block Rescan and Directory Connectedness**Phase 4 - Report Problems**Phase 5 - Check Connectivity**Phase 7 - Verify File/Directory Allocation Maps**Phase 8 - Verify Disk Allocation Maps 13107200 kilobytes total disk space. 1308 kilobytes in 1808 directories. 6083969 kilobytes in 2978 user files. 7018816 kilobytes are available for use.File system is clean.# fsck /u02

****************The current volume is: /dev/u02**Phase 1 - Check Blocks, Files/Directories, and Directory Entries**Phase 2 - Count links**Phase 3 - Duplicate Block Rescan and Directory Connectedness**Phase 4 - Report Problems**Phase 5 - Check Connectivity**Phase 7 - Verify File/Directory Allocation Maps**Phase 8 - Verify Disk Allocation Maps

Page 44: Aix Commands

13107200 kilobytes total disk space. 6 kilobytes in 12 directories. 656696 kilobytes in 16 user files. 12448076 kilobytes are available for use.File system is clean.# fsck /u03

****************The current volume is: /dev/u03**Phase 1 - Check Blocks, Files/Directories, and Directory Entries**Phase 2 - Count links**Phase 3 - Duplicate Block Rescan and Directory Connectedness**Phase 4 - Report Problems**Phase 5 - Check Connectivity**Phase 7 - Verify File/Directory Allocation Maps**Phase 8 - Verify Disk Allocation Maps 13107200 kilobytes total disk space. 6 kilobytes in 12 directories. 2266944 kilobytes in 16 user files. 10837828 kilobytes are available for use.File system is clean.# fsck /u04

****************The current volume is: /dev/u04**Phase 1 - Check Blocks, Files/Directories, and Directory Entries**Phase 2 - Count links**Phase 3 - Duplicate Block Rescan and Directory Connectedness**Phase 4 - Report Problems**Phase 5 - Check Connectivity**Phase 7 - Verify File/Directory Allocation Maps**Phase 8 - Verify Disk Allocation Maps 13107200 kilobytes total disk space. 1383 kilobytes in 983 directories. 13102635 kilobytes in 7927 user files. 0 kilobytes are available for use.File system is clean.# logform /dev/loglv00logform: destroy /dev/rloglv00 (y)?y# sync # sync# sync# bootlist -m normal -ocd0hdisk0# bootlist -m normal hdisk0# rebootRebooting . . .

Page 45: Aix Commands

TSM Commands

select node_name,filespace_name,stgpool_name,volume_name from volumeusage

q vol status=pendingVolume Name Storage Device Estimated Pct Volume Pool Name Class Name Capacity Util Status (MB)------ ----------- ------------ ---------- ----- --------000001 DR_BKPPOOL 3584CLASS 0.0 0.0 Pending000092 DR_BKPPOOL 3584CLASS 0.0 0.0 Pending

backup image /dev/pcondata27ops

tsm> arch /exportdump/cweom/expPREEOM01DEC2005.dmp.Z -archmc=archive0030

Manual Checkin:

tsm> move drmedia <volume name> wherestate=vaultret tostate=onsitertsm> move drmedia <volume name> wherestate=vaultret tostate=onsitertsm> CHECKIN libvol 3584lib search=bulk checklabel=barcode status=scrtsm> q reqtsm> reply <Request No.>

Manual Checkout:tsm> checkout libvolume <library_name> <tape no> CHECKLABEL=YES FORCE=NO REMOVE=YES

Automatic Checkout:tsm> run drcheckout

New LTO Labeling and Checking in:LABEL libvol 3584lib labelsource=barcode search=bulk checkin=scr

Space Reclamation:To start space reclamation: tsm> update stgpool <POOL_NAME> reclaim=80

To end (ie., after) Space reclamation:tsm> update stgpool <POOL_NAME> reclaim=100

Auditing:tsm> audit library 3584lib

Dismounting the tape:tsm> dismount vol <TAPE_NO>

Page 46: Aix Commands

DRCHECKOUTmove drmedia * wherestate=mountable tostate=vault cmd="Send volume &vol to offsite" cmdfilename=/tmp/drcheckout.txt remove=bulk wait=yes

DRCHECKINmove drmedia * wherestate=vaultretrieve tostate=onsiteretrieve cmd="&vol" cmdfilename=/tmp/drcheckin.txt wait=yes

checkin libvol 3584lib search=bulk vollist=FILE:/tmp/drcheckin.txt checklabel=barcode status=scr

DRBACKUPdisable sessionsselect * from sessions where upper(session_type)='NODE'if (rc_ok) goto rescheduleexpire inventory wait=yesmove data /tsmdb/bkp_diskpool.dsm stgpool=3584_bkppool wait=yesmove data /tsmdb/arc_diskpool.dsm stgpool=3584_arcpool wait=yesbackup stgpool 3584_bkppool dr_bkppool wait=yesbackup stgpool 3584_arcpool dr_bkppool wait=yesbackup db devclass=3584class type=full wait=yesbackup volhist filenames=/tsmdb/backup/volhist.bkpbackup devconf filenames=/tsmdb/backup/devconf.bkpaudit licenseupdate schedule drbackup type=admin starttime=16:00:00enable sessionsexitreschedule:update schedule drbackup type=admin starttime=now+00:05exit

Server side Query:

q scriptq script DRBACKUP f=dq stgpool

query actlog (query the activity log)query admin (display administrator information)query association (query client node associations with a schedule)query auditoccupancy (query client node storage utilization)query backupset (query a backup set)query backupsetcontents (query contents of a backup set)query cloptset (query a client option set)query content (query the contents of a storage pool volume)query copygroup (query copy groups)query datamover (display data mover definitions)query db (display information on the database)query dbbackuptrigger (query the database backup trigger)

Page 47: Aix Commands

query dbvolume (display information on one or more database volumes)query devclass (display information on one or more device classes)query domain (query a policy domain)query drive (query information about a drive)query drmedia (query disaster recovery media)query drmstatus (query disaster recovery manager system parameters)query enabled (query enabled events)query event (query scheduled and completed events)query eventrules (query rules for server or client events)query eventserver (query the event server)query filespace (query one or more file spaces)query library (query a library)query libvolume (query a library volume)query license (display license information)query log (display information on the recovery log)query logvolume (display information on one or more log volumes)query machine (query machine information)query media (query sequential access storage pool media)query mgmtclass (query a management class)query mount (display information on mounted sequential access volumes)query node (query nodes)query occupancy (query client file spaces in storage pools)query option (query server options)query path (display a path definition)query policyset (query a policy set)query process (query one or more server processes)query profile (query a profile)query recoverymedia (query recovery media)query request (query one or more pending mount requests)query restore (query restartable restore sessions)query rpfcontent (query recovery plan file contents stored on a target server)query rpfile (query recovery plan file information stored on a target server)query schedule (query schedules)query script (query tivoli storage manager scripts)query server (query a server)query servergroup (query a server group)query session (query client sessions)query sqlsession (display sql session value)query spacetrigger (query the database or recovery log space triggers)query status (query system parameters)query stgpool (query storage pools)query subscriber (display subscriber information)query subscription (display subscription information)query system (query the system configuration and capacity)query volhistory (display sequential volume history information)query volume (query storage pool volumes)

Ex:-

Page 48: Aix Commands

q actlog -begintime=00:00 begindate=today-1 or=cl node=<hostname> q vol status=<STATUS>q vol stgpool 3584_arcpool status=<STATUS>-> displays the filling tapes in arcpool library with filled in size

STATUS can be online, offline, filling, full, empty.

q volhist type=dbbackup -> To check drbackup completion status

Type DSMC to get into TSM backup client, and tsm> Use the below command for taking backup for the followingEG: tsm>arch /nscw1arch_local/cwops_1_12345.arcEG: tsm>arch /nscw1arch_local/cwops_1_12345.arc –archmc=archve0030EG: tsm>arch /nscw1arch_local/cwops_1_12345.arc –archmc=archve0090EG: tsm>arch /nscw1arch_local/cwops_1_12345.arc –archmc=archve0365EG: tsm>arch /nscw1arch_local/cwops_1_12345.arc –archmc=archve2225Backup is completed, if not please escalate appropriateCheck the backed up data by using tsm>q arch /nscw1arch_local/cwops_1_12345.arc and it will display the data file with retention time and date. Exit the TSM client by using quit.=============================================================Login to the server from where you want to restore the data.Use Putty on your system type the IP address of the serverAt user prompt type user name and passwordType DSMC to get into TSM client, it will prompt tsm> Use the below command to check the data availability EG: tsm>q arch /nscw1arch_local/cwops_1_12345.arcUse the below command for restore the data for following tsm>ret /nscw1arch_local/cwops_1_12345.arc tsm>ret /nscw1arch_local/cwops_1_12345.arc /tmp/Login to the server where you target to restore the data and type #dsmc ret /nscw1arch_local/cwops_1_12345.arc /tmp/ -virtualnode= the system name which you have performed the backup

TSM Server Management:Defining Database and Recovery Log Sizes:

Size in default:

DB Volume (db.dsm) – 17 MBLOG Volume (log.dsm) – 9 MB

Format and define a 500MB DB and 25MB Recoery LOG vol. And extend them by

define dbvolume db2.dsm formatsize=500define logvolume log2.dsm formatsize=25

Page 49: Aix Commands

extend db 500extend log 25

Increasing Disk Storage Pools:

By default,

BACKUPPOOL backup.dsm (8 MB)ARCHIVEPOOL archive.dsm (8 MB)SPACEMGPOOL spcmgmt.dsm (8 MB)

To create a 100MB volume named sbkp01.dsm in BACKUPPOOL,

Define volume backuppool sbkp01.dsm formatsize=100

Adding Administrators:

Creating a user named mark with password Missouri and adding him to system class

Register admin mark MissouriGrant authority mark classes=system

Adding Backup-Archive clients:

Registering a node Mercedes where u have already installed TSM client with password montana

Register node Mercedes Montana userid=none