aix commands1

359
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 -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 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. Mirscan To scan the mirror vg before replacing PV FS COMMANDS lsfs Lists all filesystems in the /etc/filesystems entry lsfs -q List all filesystems with detailed info lsfs -a To list all filesystems (default) lsfs -l Specify the output in list format lsfs -c Specify the output in column format lsfs -v jfs Lists all jfs filesystems chfs -a size=24576 /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 /si chfs -m /si /bi Change the mount point from /si to /bi

Upload: manoj63

Post on 11-Mar-2015

1.091 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: AIX Commands1

VG COMMANDSlsvg 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 -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 newvgexportvg 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.

Mirscan To scan the mirror vg before replacing PV

FS COMMANDSlsfs Lists all filesystems in the /etc/filesystems entrylsfs -q List all filesystems with detailed infolsfs -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 -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 -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

Page 2: AIX Commands1

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 -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 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 bootbootinfo -e Check the machine can boot from tapebootinfo -T To see the machine typebootinfo -s hdisk0 To see the size of hdisk0bootinfo -r To see the size of memory

PAGE SPACE COMMANDSlsps -a To list out all paging spaceslsps hd6 To display the details of the paging space hd6chps -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 paging00

Page 3: AIX Commands1

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 occurredsysdumpdev –vL To determine the reason for failure dump.

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 hdisk0mkdev -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 -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)lsdev –C –l rmt0 –F parent To list the parent device of the rmt0

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 temporarily

Installation specific commands

Page 4: AIX Commands1

lslpp -l To see the details of installed file setslslpp -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 -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 installed

Network related commandshost 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 tablechdev -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 commandsdu -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 directory

Page 5: AIX Commands1

df -i To display no of free and used inodesdf -k To display diskspace in 1024 bytes format

Backup commandsmksysb -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 /home Restores /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 rmt0tar –xvf filename To extarect file in current directotydd 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 tapechdev -l rmt0 -a block_size=512 To change the block size of the tape to 512

Print commandsqchk -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 file

Page 6: AIX Commands1

last |grep shutdown To show the shutdown sessionsuptime (w -u ) To show how long the system has been up

Licensing commands

oslevel To list the operating system levellslicense 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 grouprmgroup dcm To delete the group dcmchauthent To change the authentication methods

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 tcpip

Page 7: AIX Commands1

refresh -s nfsd To refresh nfsd subsystemrefresh -g tcpip To refresh tcpip subsystem group

Scheduling commandscrontab -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=lices 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=licensesodmshow 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

errpt 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

HACMP Commands

Page 8: AIX Commands1

logs/tmp/hacmp.out Detailed event script output logged in 7 day rolling history/var/adm/cluster.log High level view of cluster events (No clean up on this file)/usr/sbin/cluster/history/cluster.mmdd Day by day view of cluster events. (one file / day of month)/tmp/cm.log Clstrmgr messages/tmp/cspoc.log Output from C-SPOC commands (similar to smit.log)/tmp/emuhacmp.out Output from event emulation

rdist -b -f /etc/disfile1 To distribute the files in disfile1 to all nodes in disfile1 in binary mode

Sample entry for 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 takeovercldare -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 resourcesclverify cluster verification utilitycllscf 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 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 2

Page 9: AIX Commands1

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

clgetaddr 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

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

SP Commands

Daemons

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 management pmand,pmanrmd (/usr/sbin/rsct/bin/pmanctrl script)

Page 10: AIX Commands1

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

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

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 partition

Page 11: AIX Commands1

syspar_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 addressngdelete 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 errors

Page 12: AIX Commands1

hmcmds -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 node1cshutdown -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 masterslshacws To list the status of the CWS

Page 13: AIX Commands1

ntpdate 90.1.2.1 Sets date and time by enquiring ntp server 90.1.2.1spbootlist -l 1 2 To set the bootlist on nodes 1 and 2

nodecond 1 4 To network boot the node 4 in frame 1nodecond -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

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

Page 14: AIX Commands1

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 frompasswd 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 updationsupper 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/siju1) 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 siju

Page 15: AIX Commands1

5) edit list file for including and omitting files in /home/siju directoryIt 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 sysctlsysctl -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 filesysctl -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 contents

if [ $# -gt 2 ]then echo "Arguments exceed the limit"exit 1

Page 16: AIX Commands1

fi/usr/lpp/ssp/bin/hostlist -n $1 | /usr/bin/sysctl -c - substart_proc $2

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

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

startsrc -s $2

This 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 nodespcp -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 nodes

10) Get the kerberos ticket for user siju and execute following command

substart 3 lpd

This should start the lpd daemon on node 3

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

Page 17: AIX Commands1

NIM Commandsnimconfig -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_resourceTo remove the resource inst_resource

nim -o check lpp_source1To check the status of lpp_source lpp_source1

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 node1To initialise NIM for the BOS installation on node1 with the allocated resources

nim -o dkls_init dcmdsTo initialize the machine dcmds as diskless operation

nim -o dtls_init dcmdsTo initialize the machine dcmds for dataless operation

nim -o cust dcmdsTo initialize the machine dcmds for customize operation

nim -o diag dcmdsTo initialize the machine dcmds for diag operation

nim -o maint dcmds To initialize the machine dcmds for maintenance operation

nim -o define -t standalone -a platform=rspc -a if1="net1 dcmds xxxxx" -a cable_type1=bnc dcmdsTo define the machine dcmds as standalone with platform as rspc and network as net1 with cable type bnc and mac address xxxxx

nim -o unconfig masterTo unconfigure nim master master

nim -o allocate -a spot=spot1 dcmdsTo allocate the resource spot1 from machine dcmds

nim -o deallocate -a spot=spot1 dcmdsTo de allocate the resource spot1 from machine dcmds

nim -o remove dcmdsTo remove machine dcmds after removing all resources associated to it

nim -o reboot dcmdsTo reboot ther client dcmds

nim -o define -t lpp_source -a location=/software/lpp1 -a server=master -a source=/dev/cd0 lpp1To define lppsource lpp1 on master at /software/lpp1 directory from source device /dev/cd0

lsnim 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

nimclientThe client version of nim command (User can obtain same results of nim in server )

Page 18: AIX Commands1

Useful commandsNote  All AIX commands reference can be found under  http //www.austin.ibm.com/doc_link/en_US/a_doc_lib/aixgen/wbinfnav/CmdsRefTop.htm1.1    Memorybootinfo –r      shows how much RAM does my machine has (as root)lsattr –E –l sys0 –a realmem  shows how much RAM does my machine have (as non root)rmss -c 512rmss -r         sets the memory size to 512 MBresets the memory size to the original one 1.2    Deviceslsattr  -El  en0     displays en0 driver paramslsattr  -El  ent0     displays ent0 HW paramslsattr -El rmt0     displays tape paramslscfg -vp -l rmt0     (all information about a tape drive)lsattr  -El  sys0     displays system type, firmware, etc  driver paramslscfg –v     lists all system HW config (NVRAM)lsdev –Csscsi     list all scsi deviceslsdev –Cspci     list all pci deviceslsparent –Ck scsi     list all scsi adapterslsdevfc     list fiberchannel devicescfgmgr     Configures devices lsdev -Ccdisk      Shows all diskslsdev -Cctape               Shows all tapescfgmgr -v -l device –v    Specifies verbose output. The cfgmgr command writes information about what it is doing to standard output.cfgmgr -v -l device       Name Specifies the named device to configure along with its children.If you only turned on a disk tower at e.g. scsi2 cfgmgr -v -l scsi2 will only configure this with detailed output.lsdisp     To check which graphic adapter is installed.lscfg -vp -l mga0      (all information about a adapter)lscfg -vp -l hdisk0 | grep Machine    gives info about the disk manufacture typelsslot -c pci     For 6F1 only !!!! Lists all slots ,voltage,boards,etc !!!!bootlist -m normal cd0  rmt0 hdisk0   Changes the default bootlistlsmcode -c     display the system firmware level and service processorlsmcode -r -d scraid0     display the adapter microcode levels for a RAID adapter scraid0lsmcode -A     display the microcode level for all supported devices        

1.3    System info/usr/bin/uname -m     Get machine ID/usr/bin/uname -M     Get platform typeoslevel     Displays current AIX leveloslevel -r     Displays current AIX maintenance leveloslevel -g     List filesets at levels later than maintenance level !!!lsps -a     Paging space settings.lscfg -vp -l proc0  (1,2,3)   (all information about a processor[s])lscfg -vp -l mem0 |pg     (all information about memory modules installed)

Page 19: AIX Commands1

env ulimit    Environment setings - show user ulimitbootinfo –s hdisk0      Displays disk sizelsattr -El sys0 -a systemid   Determines the system serial numberlscfg –vp|grep ROM|grep -v CD  Determines the system Firmware level

1.4    System issuesTERM=vt100      -If you execute a command/application and it responds with msg ‘ The type of your terminal is unknown to the system’,run those commands (In ‘ksh’)set term=vt100   -Same (In tcsh’)rcp -rp /dataVolumes/brisque1.1.0/jobs/flower.job sciroot@ripro3:/dataVolumes/ripro3.3.0/jobs/ -Copying a file from one Unix machine (Brisque) to another (Server) the assumption is that both machines know each other’s names (in hosts file)dd if=/dev/fd0 of=/temp/diskimage bs=4096 -Duplicate a diskette copy from diskette to hard drivedd if=/temp/diskimage of=/dev/fd0 bs=4096  -copy diskette image onto diskette/usr/lpp/X11/bin/xset -display unix 0 s off  -Kill display timeoutlsfs -v jfs   -List of Filesystem items.lsfs -q -v jfs          -you can see also the parameter of a filesystem and thus see if e.g. /backup was or is a big_filesystem_enabled one.Important for the 2GB File limit.lsuser –f root     Shows all user parameters (max .file size,etc)sysdumpdev -L     Check last system dump statussysdumpdev -l     Check system dump device settingslslpp -f Upd_Timna_DTM.obj    List contents of the package

1.5    Networkingkshfor ENT in ` lsdev –Cs pci|grep ent | awk '{ print $1 }'|cut –c 1,2,4 `;do    mktcpip –S $ENT doneexit        -Shows all interfaces IP config+mask+router+DNS !host timna1     displays station default IP address – works ONLY in DNS environmentifconfig en0     displays en0 driver paramsnetstat  -i      displays network interfaces settingmktcpip -S en0    #host:addr:mask:_rawname:nameserv:domain:gateway:type:startsyslab18:192.9.100.1:255.255.255.0:en0:10.4.2.12:csil.creoscitex.com:10.4.30.1:N/A:noGREAT TCPIP info in one command !!!showmount –e     displays all exported volumesshowmount -a     show who's got my filesystemsses mounted over IP !lssrc –g tcpip     displays all IP oriented processes statusentstat -drt ent0 |grep –i error    display any communication errors on etn0entstat -r     Resets all the statistics back to their initial values.arp -a     shows a local arp cachecd /usr/local/es/;res    restarts appletalknetstat  -ptcp     shows IP statisticsnetstat  -pudp     shows UDP statisticsnetstat  -c          -s          -m     client only;

server onlyNFS mountnetstat -I en0 10     Trace en0 every 10 seconds

Page 20: AIX Commands1

netstat -rn     Display routing info with IP address (10.4.27.182)netstat -in     Shows the state of all configured interfacesnetstat -r     Display routing info with full hostnames (timna2.csil.creoscitex)    nfsstat  –z       ;to    reset NFS stats without rebootcat /etc/resolv.conf     Check DNS settingsstopsrc –g NFS      To stop NFS services on a clientstartsrc –g NFS      To start NFS services on a clienttraceroute 149.115.39.1    Trace all hobs (interconnections=routers) to the destination  IPnetpmon -o netpmon.outtrcstop     Traces all network processes activity into a logfile. Must be preceede by a trcstop command !nslookup hostname     Shows the DNS server name and addressping -R -c 1 bnc2     Ping with displaying the routing infonamerslv -s | grep domain | awk '{ print $2 }'    Displays a fully qualified domain name of a hostrup    Shows the status of a remote host on the local networknmonnfs     Traces all NFS processes activitymount hostname:/filesystem /mount-point    Mount an NFS filesystemmknfsexp -d /directory     Creates an NFS export directorymknfsmnt                       Creates an NFS mount directoryrmnfs                             Stops and un-configures NFS servicesmknfs                             Configures and starts NFS servicesexportfs -u (filesystem)    Un-exports a filesystemexportfs                          Lists all exported filesystemsexportfs -a                      Exports all fs's in /etc/exports file

1.6    Diskssynclvodm -vP svg3    synchronizes ODM and the disk VG info.redefinevg svg3     Redfined VG definition in ODMlqueryvg -p hdisk0 –Avt  -reads logical volumes info from diskbootinfo -s hdiskx     Shows Megabytes available even if no volume group is assigned.lspv -p  hdiskx     (PP's used, location on disk, mount point)lscfg -vp -l hdiskx       (all information about a disk/raid)

1.7    Filesystemchfs -a size=+200000 /var    increases /var FS by 100MBdu -sk /john           shows directory used space in kb !!!!mount all    mounts all FSumount /dataVolumes/rtest9.1.0    unmounts a FSfuser -k /dev/cd0    Releases a CD that will not unmount !fuser –c /dataVolumes/rtest9.1.0  -Find out which process_id lock the FSistat <filename>    Shows when the file was last created/modified/accessed !!!!

1.8    System monitoringistat <filename>     Shows create/modify/access file infoalog -o -t boot | more     displays system boot logw     Lists login users and their programs.who     Identifies the users currently logged in/usr/local/es/swho      Identifies the Ethershare users currently logged inlast  |more     shows last logins last –20     Shows recent 20 lineslast root     Shows username ‘root’ login/logout record

Page 21: AIX Commands1

last ftp      Shows all FTP session in the recordmount     shows all mounted filesystems (nfs+local)ps -ef     show all running processesps -ef |grep Scitex     show all scitex running processesdu -ak /scitex|sort -n -r|head –10  -Display 10 biggest directories on the volume by sizefind /scitex -xdev -size +2048 -ls|sort -rn +6|head –10  -to find 10 top files in the root (/) directory larger than 1 MB.”-xdev” helps searching ONLY in “/” !!!!!!!!!history    Last commands run on the system by this useralog -ot boot     Lists a log of all boot operationsgrep TX /etc/environment    Verify daylight settings

1.9    Performance issuesnmon    a nice monitor - runs only on AIX5 and uptopas    a nice monitor - runs only on AIX 4.3.3 and upmonitor -top 10 -s 2   monitors system 10  top processes with 2 seconds iostat 2     displays disks activity every 2 seconds refresh intervaliostat –a 2            AIX5 ONLY !!!!displays disks and ADAPTER !!!! activity every 2 seconds refresh intervalvmstat 2     ;monitors virtual memory statistics every 2 seconds (see appendix A)sar –P ALL 2 2     Show all CPU’s activity on an SMP machinesvmon –i 2     Monitors real and virtual memoryps auxw | sort –r +3 |head –10  -Shows top 10 memory usage by processps auxw | sort –r +2 |head –10  -Shows top 10 CPU usage by processps –auw | grep defunct    Shows zombies processes (to kill – reboot or kill the parent)filemon –O all –o filemon.out ; find / -name core ; trcstop    Traces FS,LV,disks,files activityof a “find” command into a logfile (filemon.out). Must be preceded by a trcstop command.tprof –x find / -name core ; trcstop    Traces CPU activityof a “find” command Severall logfile are created. Must be preceded by a trcstop command.tprof -ske -x "sleep 30"    -Trace CPU activity for next 30 seconds.Results in file sleep.tprof

lvmstat –ev svg1lvmstat –v svg1 2    AIX5 ONLY !!!!enable gathering the VG statisticsDisplay VG logical volumes statistics every 2 seconds

1.10    Remote issues (working over the modem)

pdelay tty0; pdisable tty0 >/dev/null ;penable tty0  -Resets tty0stty erase '^?'     Makes bakespace to work/scitex/version/utils/modem/kermit -l /dev/ttyx –c atdt {phone #}     Use Unix to Dail-out  (for any reason) ttyx is the serial port the cable is connected/scitex/version/utils/modem/kermit -s /u/d0/ripro_messages -i    Sends a file to a remote desktop in binary mode/scitex/version/utils/modem/kermit –r -Receives a file to from remote desktop

1.11    Browsing errlog with errpt

errpt -a  -s 0604090601  -e 0605090901    browse the errlog in  detail for all errors within a timeframeerrpt -a  -N SYSPROC |moreerrpt -a  -N SYSPROC  > /tmp/err.log    Browse the errlog for the SYSPROC resource, can be

Page 22: AIX Commands1

into the fileerrpt -j 5DFED6F1   -Browse the errlog by the identifiererrpt –A     -AIX5 ONLY !!!! Shows less detailes then errpt -aerrpt –D     -AIX5 ONLY !!!! eliminates double entries

1.12    Security issueschmod -s Filename    Remove Sticky Bit to a file or directorychmod +r+w+x+t Filename     Add Read+Write+Execute+Temp mode to a file or directory.This is a ‘blanket’ change for all owner, user & group.Numeric Access Modes  0 (---) - no access1 (--x) - execute permissions; search permissions for directories2 (-w-) - write access3 (-wx) - execute/search permission and write access4 (r--) - read access5 (r-x) - execute/search permission and read access6 (rw-) - read and write access7 (rwx) - execute/search permission and read and write accessmkpasswd -f    rebuild the /etc/passwd indexes in case of suspected corruption

1.13    Miscellaneouskshfind / -type f|xargs grep "10.4.27.181" 2> /dev/null-Find all files containing my IP addresscompress -c file > file.Z    Compresses the files while keeps the originalwhereis  <command-ame>    Returms full path of program

1.14 SFTP Solution Provided : cp /usr/sbin/sftp-server /usr/sbin/sftp-server.origldedit -b maxdata:0x80000000 /usr/sbin/sftp-server

SFTP umask

Create a wrapper script in the same/different path.Vi /usr/sbin/sftp-server.sh#! /usr/bin/ksh

Umask 0000exec /usr/sbin/sftp-server

hash the the line /usr/sbin/sftp-server in /etc/ssh/sshs_config file put the new file /usr/sbin/sftp-server.sh

To clean up unreleased library and /tmp

# slibclean

Page 23: AIX Commands1

Upgrading your HMC machine codeLearn how to upgrade the HMC software from one release to the next while maintaining your HMC configuration data.Perform Tasks 1 through 9 to upgrade the HMC machine code.Note: You cannot use this procedure to upgrade from a POWER4™ HMC to a POWER5™ HMC. You must do a full installation.Parent topic: Getting HMC machine code fixes and upgrades

Task 1. Obtain the upgradeYou can order the HMC machine code upgrade through the Hardware Management Console Web site, by contacting service and support, or by downloading it to an FTP server.

From a computer or server with an Internet connection, go to the Fix Central Web site at http://www.ibm.com/eserver/support/fixes/.

Select the appropriate family in the Product family list.

Select Hardware Management Console in the Product or fix type list.

Click Continue. The Hardware Management Console site is displayed.

Navigate to the HMC version you are upgrading.

Locate the Recovery CD download and ordering section.

Note: If you do not have access to the Internet, contact service and support to order the upgrade on DVD.

Follow the on-screen prompts to submit your order.

After you have the upgrade, continue with Task 2. View the existing HMC machine code level.

Task 2. View the existing HMC machine code levelTo determine the existing level of HMC machine code so you can verify that it is upgraded, follow these steps:

In the navigation area, expand the Licensed Internal Code Maintenance folder.

Select HMC Code Update.

In the Status area, look for the version and release of your HMC machine code.

Record the current version and release.

Continue with Task 3. Back up the managed system's profile data.

Task 3. Back up the managed system's profile data In the navigation area, select Server and Partition.

In the contents area, open Server Management. A task list displays.

Right-click the managed system and select Profile data > Backup.

Type a backup file name and record this information.

Click OK.

Repeat steps 3 through 5 for each managed system.

Page 24: AIX Commands1

Continue with Task 4. Back up critical console information.

Task 4. Back up critical console informationBack up critical console information before installing a new version of HMC software so that previous levels can be restored in the event of a problem while upgrading the software. Do not use this critical console data after a successful upgrade to a new version of the HMC software.Note: If you choose to back up the console data to removable media (that is, diskette or DVD), you will need to have a diskette or DVD available.

In the HMC Code Update window, choose from the following options:

o If you do not plan to back up to diskette or DVD-RAM, continue with the next step.

o If you plan to back up to diskette or DVD-RAM, perform the following steps:

Insert the media into the drive.

Select Format Removable Media.

Select Format DVD-RAM or Format diskette.

Click OK.

Continue with the next step.

Select Back up Critical Console Data.

Select an archive option. You can back up to a DVD in the HMC, a remote system mounted to the HMC file system (for example, NFS), or send the back up to a remote site using File Transfer Protocol (FTP).

o To back up to DVD, choose Back up to DVD on local system and follow the instructions.

o To back up to a mounted remote system, choose Backup to mounted remote system and follow the instructions.

o To back up to a remote FTP site, choose Send backup critical data to remote site and follow the instructions.

Continue with Task 5. Record the current HMC configuration information.

Task 5. Record the current HMC configuration informationBefore you upgrade to a new version of HMC software, as a precautionary measure, record HMC configuration information.To record HMC configuration information, follow these steps:

In the navigation area, open HMC Management.

Select HMC Configuration.

In the tasks list, select Schedule Operations. The Scheduled Operations window displays with a list of all managed systems.

Select the HMC you plan to upgrade and click OK. All scheduled operations for the HMC are displayed.

Select Sort > By Object.

Select each object and record the following details:

o Object Name

Page 25: AIX Commands1

o Schedule date

o Operation Time (displayed in 24-hour format)

o Repetitive (if Yes, perform the following steps:

Select View > Schedule Details.

Record the interval information.

Close the scheduled operations window.

Repeat for each scheduled operation.

Close the Customize Scheduled Operations window.

Continue with Task 6. Record remote command status.

Task 6. Record remote command status In the navigation area, select HMC Management.

Select HMC Configuration.

In the tasks list, click Enable/Disable Remote Command Execution.

Record whether the Enable remote command execution using the ssh facility check box is selected.

Click Cancel.

Continue with Task 7. Save upgrade data.

Task 7. Save upgrade dataYou can save the current HMC configuration in a designated disk partition on the HMC. Only save upgrade data immediately prior to upgrading your HMC software to a new release. This action allows you to restore HMC configuration settings after upgrading.Note: Only one level of backup data is allowed. Each time you save upgrade data, the previous level is overwritten.

In the navigation area, open the Licensed Internal Code folder.

Select HMC Code Update.

Select Save Upgrade Data.

Select Hard Drive and click Continue.

Click Continue to start the task.

Wait for the task to complete. If the Save Upgrade Data task fails, contact your next level of support before proceeding.

Note: If the save upgrade data task fails, do not continue the upgrade process.

Click OK.

Click Close.

Continue with Task 8. Upgrade the HMC software.

Task 8. Upgrade the HMC softwareTo upgrade the HMC software, you restart the system with the DVD-RAM in the DVD-RAM drive.

Page 26: AIX Commands1

Insert the HMC Product Installation DVD-RAM into the DVD-RAM drive.

From the HMC menu bar, select Console > Exit .

Click Exit now.

From the logout list, select Reboot Console and click OK. The HMC restarts and system information scrolls on the window.

Select Upgrade and click Next.

When the warning is displayed, choose from the following options:

o If you have saved upgrade data during the previous task, continue with the next step.

o If you did not save upgrade data previously in this procedure, you must save the upgrade data now before you continue.

Select Upgrade from media and click Next.

Confirm the settings and click Finish.

Follow the on-screen prompts.

Note:

o If the screen goes blank, press the space bar to view the information.

o The first DVD can take approximately 20 minutes to install.

When prompted, remove the first media and then insert the second media into the DVD-RAM drive.

Select 1. Install additional software from media and press Enter. Press any key to confirm the installation. The HMC will display status messages as it installs the packages.

When the second media installation is complete, remove the media from the drive and close the drawer.

Select Option 2 Finish the installation and press Enter. The HMC will complete the booting process.

At the login prompt, log in using your user ID and password.

Accept the License Agreement for Machine Code twice. The HMC code installation is complete.

Continue with Task 9. Verify that the HMC machine code upgrade installed successfully.

Task 9. Verify that the HMC machine code upgrade installed successfullyTo verify that the HMC upgrade installed successfully, perform these steps:

In the navigation area, expand the Licensed Internal Code Maintenance folder.

Select HMC Code Update.

In the Status area, look for the version and release of your HMC machine code.

Verify that the version and release match the fix that you installed.

If the level displayed is not the level that you installed, see Failed verification that the fix installed successfully.

Page 27: AIX Commands1

Getting HMC machine code fixes using CD or an FTP serverLearn how to apply fixes for the machine code on your HMC when you want to use CD or an FTP server to obtain the fix.To get HMC machine code fixes, perform Tasks 1 through 5.Parent topic: Getting HMC machine code fixes and upgrades

Task 1. View the existing HMC machine code levelTo determine the existing level of HMC machine code, follow these steps:

In the navigation area, expand the Licensed Internal Code Maintenance folder.

Select HMC Code Update.

In the Status area, look for the version and release of your HMC machine code.

Record the current version and release.

Task 2. View the available HMC machine code levelsTo find out if there are new HMC machine code fixes available, perform these steps:

From a computer or server with an Internet connection, go to the Fix Central Web site at http://www.ibm.com/eserver/support/fixes/.

Select the appropriate family in the Product family list.

Select Hardware Management Console in the Product or fix type list.

Click Continue. The Hardware Management Console site is displayed.

Scroll down to your HMC Version level to view available HMC levels.

Note: If you prefer, you can contact service and support.

Task 3. Obtain the HMC machine code fixYou can order the HMC machine code fix through the Fix Central Web site, contact service and support, or download it to an FTP server.

From a computer or server with an Internet connection, go to the Fix Central Web site at http://www.ibm.com/eserver/support/fixes/.

Select the appropriate family in the Product family list.

Select Hardware Management Console in the Product or fix type list.

Click Continue. The Hardware Management Console site is displayed.

Under Supported HMC products, select the latest HMC level that supports POWER5™ processors.

Scroll down to the File name(s) / Package area and locate the update you want to order.

In the Order CD column, select Go.

Click Continue to sign in with your IBM® ID.

Follow the on-screen prompts to submit your order.

Note: If you do not have access to the Internet, contact service and support to order the fix on CD.

Page 28: AIX Commands1

Continue with Task 4. Apply the HMC machine code fix.

Task 4. Apply the HMC machine code fix Before you install fixes to the HMC machine code, back up critical console information on your HMC.

For instructions, see Backing up critical HMC data. Then continue with the next step.

If you obtained or created the fix on CD, insert it into the CD drive on the HMC.

In the navigation area, expand the Licensed Internal Code Maintenance folder.

Select HMC Code Update.

Select Install Corrective Service. Corrective service refers to the HMC machine code fix.

On the Install Corrective Service window, choose from the following options:

o If you want to download the fix from an FTP server to your HMC, continue with step 7.

o If you want to get the fix from a CD, select Apply corrective service from removable media and continue with step 8.

If you previously downloaded the fix to an FTP server, select Download the corrective service file from a remote system, and then apply downloaded service file, and specify the following information:

o Remote site: The fully qualified host name of the FTP server to which you previously downloaded the patch file (zip file) that contains the fix.

o Patch file: The name of the patch file (zip file) that you downloaded to the FTP server.

o User ID: Your user ID for the FTP server.

o Password: Your password for the FTP server.

Click OK.

Follow the instructions to install the fixes.

Shut down and restart the HMC for the fixes to take effect.

Task 5. Verify that the HMC machine code installed successfullyTo verify that the HMC fix installed successfully, perform these steps:

In the navigation area, expand the Licensed Internal Code Maintenance folder.

Select HMC Code Update.

In the Status area, look for the version and release of your HMC machine code.

Verify that the version and release match the fix that you installed.

If the level of firmware displayed is not the level that you installed, see Failed verification that the fix installed successfully.

Useful AIX commands svmonsvmon -P <pid>

Page 29: AIX Commands1

Further:use can user svmon command to monitor memory usage as follows;

(A) #svmon -P -v -t 10 | more (will give top ten processes)(B) #svmon -U -v -t 10 | more ( will give top ten user)

smit install requires "inutoc ." first. It'll autogenerate a .toc for youI believe, but if you later add more .bff's to the same directory, thenthe inutoc . becomes important. It is of course, a table of contents.

dump -ov /dir/xcoff-file

topas, -P is useful # similar to top

When creating really big filesystems, this is very helpful:chlv -x 6552 lv08Word on the net is that this is required for filesystems over 512M.

esmf04m-root> crfs -v jfs -g'ptmpvg' -a size='884998144' -m'/ptmp2'-A''`locale yesstr | awk -F: '{print $1}'`'' -p'rw' -t''`locale yesstr |awk -F: '{print $1}'`'' -a frag='4096' -a nbpi='131072' -a ag='64'Based on the parameters chosen, the new /ptmp2 JFS file systemis limited to a maximum size of 2147483648 (512 byte blocks)New File System size is 884998144esmf04m-root>

If you give a bad combination of parameters, the command will listpossibilities. I got something like this from smit, then seasonedto taste.

If you need files larger than 2 gigabytes in size, this is better.It should allow files up to 64 gigabytes: crfs -v jfs -a bf=true -g'ptmpvg' -a size='884998144' -m'/ptmp2' -A''` | | locale yesstr | awk -F: '{print $1}'`'' -p'rw' -t''`locale yesstr | aw | | k -F: '{print $1}'`'' -a nbpi='131072' -a ag='64'

Show version of SSP (IBM SP switch) software:lslpp -al ssp.basic

llctl -g reconfig - make loadleveler reread its config files

oslevel (sometimes lies)oslevel -r (seems to do better)

Page 30: AIX Commands1

lsdev -Cc adapter

pstat -a looks useful

vmo is for VM tuning

On 1000BaseT, you really want this:chdev -P -l ent2 -a media_speed=Auto_Negotiation

Setting jumbo frames on en2 looks like:ifconfig en2 down detachchdev -l ent2 -a jumbo_frames=yeschdev -l en2 -a mtu=9000chdev -l en2 -a state=up

nfso -a shows AIX NFS tuning parameters; good to check on if you'regetting badcalls in nfsstat. Most people don't bother to tweaks thesethough.

nfsstat -m shows great info about full set of NFS mount options

Turn on path mtu discoveryno -o tcp_pmtu_discover=1no -o udp_pmtu_discover=1TCP support is handled by the OS. UDP support requires cooperationbetween OS and application.

nfsstat -c shows rpc stats

To check for software problems:lppchk -vlppchk -clppchk -l

List subsystem (my word) status:lssrc -amkssysrmssyschssysauditprrefreshstartsrcstopsrctracesontracesoff

Page 31: AIX Commands1

This starts sendmail:startsrc -s sendmail -a "-bd -q30m"

This makes inetd reread its config file. Not sure if it kills andrestarts or just HUP's or what:refresh -s inetd

lsps is used to list the characteristics of paging space.

Turning off ip forwarding:/usr/sbin/no -o ipforwarding=0

Detailed info about a specific error:errpt -a -jE85C5C4CBTW, Rajiv Bendale tells me that errors are stored in NVRAM on AIX,so you don't have to put time into replicating an error as often.

Some or all of these will list more than one number. Trust the first,not the second.

lslpp -l ppe.poe...should list the version of poe installed on the system

Check on compiler versions:lslpp -l vac.Clslpp -l vacpp.cmp.core

Check on loadleveler version:lslpp -l LoadL.full

If you want to check the bootlist do bootlist -o -m normal if you want toupdate bootlist do bootlist -m normal hdisk* hdisk* cd* rmt*

prtconf

Run the ssadiag against the drive and the adapter and it will tell you if it fails or not. Then if its a hot plugable it can be replaced online.

You can get patches from:http://www-912.ibm.com/eserver/support/fixes

You'll need to click through a bit of red tape before getting to whereyou actually can list corequisites and start a download.

BTW, "Add to my download list" does not work in konqueror, but it doeswork in mozilla.

Page 32: AIX Commands1

Backup to tape:env - /usr/bin/mksysb '-m' '-i' '-X' /dev/rmt0The "env -" is because some sort of environment variable can confusemksysb, making it error out instead of doing your backupThere's also "smitty mksysb"

You can create an image using the savevg command i.e.

savevg -v -n -9 / _rootvg.img rootvg

This can be used to build a NIM installable image to recover your systems

alternatively, the command line call for a mksysb to tape (to include mapand exclude files) is /usr/bin/mksysb '-m' '-e' '-i' /dev/rmt0

Finding which lpp contains a file:lslpp -w /usr/sbin/umount

There exists a "diag CD" for AIX.

/usr/samples/kernel/vmtune

lsattr -El sys0 | grep realmemlsattr -El mem0

See if you AIX system's hardware is CHRP (some sort of PowerPC referenceplatform spec, I believe) :bootinfo -pchrp

Some really funky hardware-looking problems can be fixed by drainingthe NVRAM battery for 5 minutes, and then reinstalling the microcode.We used to do this on some IBM RT's in Cincinnati, and a recent posterto AIX-L indicates that it's still useful in some situations.

From AIX-L:AIX 4.3.2 -> AIX 4.3.3 is the most easiest Upgrade of ALL. Place theAIX 4.3.3 Vol 1 of CD on the CDROM drive and run smitty update_all ,this will upgrade the OS

On the subject of running out of paging space, from AIX-L:Look into npswarn, npskill stuff in Performance Management Guide

Changing the boot device order:Boot the server, and hit 1 or F1 (depending if you have an ascii consoleor a graphics console) when the logos come up to get to sms mode. Inthe menus select multiboot, select boot devices, select boot order.

Page 33: AIX Commands1

You should start tracing for inetd subsystem with

traceson -s inetd

and then issue:

trpt -j

you will see the protocols control blocks (PID) you're tracing, and then with:

trpt -p <PID>

you should see output for telnet communications. But this is not working.

Why don't you try using iptrace and ipreport to see the behavior of yourtelnet sessions ??

Purportedly orks with JFS 1 and 2:

To split off a mirrored copy of the /home/xyz file system to a new mountpoint named /jfsstaticcopy, type the following:

chfs -a splitcopy=/jfsstaticcopy /home/xyz

You can control which mirrored copy is used as the backup by using thecopy attribute. The second mirrored copy is the default if a copy isnot specified by the user. For example:

chfs -a splitcopy=/jfsstaticcopy -a copy=1 /home/xyz

At this point, a read-only copy of the file system is available in/jfsstaticcopy. Any changes made to the original file system after thecopy is split off are not reflected in the backup copy.

To reintegrate the JFS split image as a mirrored copy at the /testcopymount point, use the following command:

rmfs /testcopy

The rmfs command removes the file system copy from its split-off stateand allows it to be reintegrated as a mirrored copy.

Working around a loader domain problem:

esmf04m-strombrg> /usr/local/bin/gribmap exec(): 0509-036 Cannot load program /usr/local/bin/gribmap because ofthe following errors: 0509-030 Insufficient permission to create loader domain /usr/lib/libiconv.a 0509-026 System error: The file access permissions do not allow the specified action.

esmf04m-strombrg> LIBPATH=$TMPDIR/gribmap-ld /usr/local/bin/gribmap

Page 34: AIX Commands1

gribmap v1.4 for GrADS Version 1.8SL11

Apparently you can also link your application with -L$TMPDIR/loaderdomainor so, but you'd need a unique one for each set of shared libraries.This one apparently must be the first -L in the link line.

Please see also:http://dcs.nac.uci.edu/~strombrg/AIX-shared-libs.html

/usr/bin/uname -M

Anyway, set the timezone variable TZ in /etc/environment like this:

TZ=MST7

...takes effect after everyone logs out and back in. This is just anexample, not something for California.

"svmon" will give u this output which give u the information regardingur memory.

size inuse free pin virtualmemory 1310711 1298235 12476 103782 711466pg space 2097152 585219 work pers clnt lpagepin 103782 0 0 0in use 438570 10130 849535 0

acledit

Scott (of IBM, onsite hardware tech) stuff:

lsdev -Cc adapter"defined" means at one time the piece of hardware was on system - asopposed to "available". A card which is being newly added should nottemporarily pass through "defined" state. Hardware should be in the"available" state./////lsslot -c pcip1-i1 is the first slot on the back left/////diagdiadiagnostic routinesproblem determinationsfp: phones home (to IBM) over modempreviously reported problem/////task selectionhot plug taskpci or scsiidentify function will blink light, so you can make sure the hardwareand software are on the same page.u1.1 drawer address, bottom left

Page 35: AIX Commands1

/////EIA numbers on right and left of rack, goes to lowest of the numbersadjacent to the equipment in question. EG, something in the rack mightbe 3 EIA numbers high - the software should identify the hardware bythe lowest number of the 3./////hotplug in os removes voltage from slot, slot light should blink yellow,same as for identify./////we have older "hotswap cassettes" - which means lots of screws.Newer ones snap together. It also can take a bit of wrestling to getthe card in and out of the old cassettes (shades of Sun's IPX's :)/////yellow llight continues blinking after card inserted, until software istold to let the slot have voltage again./////advanced diagnostics, search for thing to test visually/////cfgmgrtakes awhile to run, checks all devices on machineno output, but then lsdev -Cc adapter again should change afterward/////ps -ef | grep Wormsplstdata -ashould not say not_configureduse rc.switch to make it configuredps -ef pipe | Worm again, should show up nowEunfence 49 - 49 is 04m/////spmon -d"d" for diagnosticlike front panel leds"host responds" and "switch responds" should say yes for all css adapters/////errpt (no args)/////Scott says that sometimes an SP2 system will refuse to acknowledge thenew adapter, in which case you have to lie to the ODM to make the systemsee the card. He suggested that maybe we did not need to do that thistime, because we have the latest pssp (ssp.*) software on the system./////We also had to Eunfence the node whose card was replaced.

Rajiv tells me that it does not matter which host is Eprimary, as long asone of the nodes is, and there aren't things fenced off that shouldn't be.

mount -v cdrfs -o ro /dev/cd0 /mntMount iso9660 filesystem

More on cfgmgr, from aix-l:

you can execute cfgmgr on line without trouble

normally cfgmgr have 3 steps named phases :phase 1 during boot

Page 36: AIX Commands1

phase 2 during normal boot (after phase1)phase 3 durinf service boot (after phase1)

if you run cfgmgr without flags (-p or -f) cfgmgr executes phase 2 only bydefault

in fact cfgmgr and cfgmgr -p2 are the sames commandsflag -v for verbose

AIX 5.2 has builtin CIFS client?mount -v cifs -n winserver/myuser/mypassword /home /mnt

Can also "smitty cifs_fs"

This is supposed to be included in lpp bos.cifs_fs

Apparently this was added in AIX 5.2

please check if your cd device is being used by some process by running:

fuser -c /dev/cd0

you can also chack if cdromd is up and running by:

lssrc -a | grep cd

if cdromd is running, then try with the following commands:

cdumount

cdeject

here is some commands to manipulate the ODM directly (I don't suggest youdo so, at least you know exactly what you are doing).odmget, odmshow, odmchange, odmadd, odmdelete, odmdrop

lsps -a

nmon - free, unsupported download from IBMWhat's this about chmod'ing kmem to be world readable though?!

esmf04m-dcsew> instfix -i | grep ML All filesets for 5.1.0.0_AIX_ML were found. All filesets for 5100-01_AIX_ML were found. All filesets for 5100-02_AIX_ML were found. All filesets for 5100-03_AIX_ML were found. All filesets for 5100-04_AIX_ML were found.esmf04m-dcsew>

The specifix fixes can be checked using instfix command:

Page 37: AIX Commands1

#instfix -ivk <APAR no.>e.g #instfix -ivk IY56076

instfix -ciqk 4330-08_AIX_ML | grep ":-:"Lists what filesets need to be installed for instfix to show "All filesetsfor 4330-08 were found".

instfix -k "IX#####" -d /dev/rmt0.1Installs the APAR and its prerequisites on the system.

installp -Xagqd /dev/rmt0.1 X11.base.rteInstalls Xwindows on the system.

installp -udeletes an AIX lpp

Copious network statistics:entstat -d ent0

Making AIX 5.1 see a change to /etc/inetd.conf and/or /etc/servicesand/or /etc/rpc is different from most other systems (only verifiedusing one rpc/udp service so far)

You can't just kill -HUP inetd's pid

What you can do, is "smitty inetd", stop inetd, start inetd, and exit smitty.

Alternatively, it -should- work to:stopsrc -s inetdstartsrc -s inetd

Or better:Edit /etc/inetd.conf and comment out ftp and refresh inetd by issuing"refresh -s inetd"

startsrc -t ftpd -u 022 -l

To truly change the kernel to 64-bit, you need to be at the 5.1 oslevel. Themeans to change to a 64-bit kernel are:

From 32-bit to 64-bit:

ln -sf /usr/lib/boot/unix_64 /unix ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix lslv -m hd5 bosboot -ad /dev/ipldevice shutdown -Fr bootinfo -K (should now be 64)

To change the kernel back to 32-bit:

Page 38: AIX Commands1

From 64-bit to 32-bit:

ln -sf /usr/lib/boot/unix_mp /unix ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix lslv -m hd5 bosboot -ad /dev/ipldevice shutdown -Fr bootinfo -K (should now be 32)If you are running AIX 5.1

Switching From 32 to 64 Bit Mode

To switch from 32-bit mode to 64-bit mode run the following commands,in the given order:

1.ln -sf /usr/lib/boot/unix_64 /unix 2.ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix 3.bosboot -ad /dev/ipldevice 4.shutdown -Fr 5.bootinfo -K (should now show 64)

Switching From 64 To 32-Bit Mode

To switch from 64-bit mode to 32-bit mode run the following commands,in the given order:

1.ln -sf /usr/lib/boot/unix_mp /unix 2.ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix 3.bosboot -ad /dev/ipldevice 4.shutdown -Fr 5.bootinfo -K (should now show 32)

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-Moulay Rachid BOUSSETA

To see if you're running with a 32 bit or 64 bit kernel, run:

bootinfo -K...or...prtconf -k

EG:esmf04m-root> PATH=/usr/bin:/usr/sbin prtconf -kKernel Type: 64-bitesmf04m-root> bootinfo -K64

bootinfo -s hdiskxxx

lspv hdiskXX as well is defined on a Volume Group

lsattr -El hdiskXX

lscfg -vp -l hdiskXX

These should give you the raw disk capacity

Page 39: AIX Commands1

Go to: http://www-912.ibm.com/eserver/support/fixes/fcgui.jspChoose: 1)pSeries family 2)AIX OS,Java, compilers 3)Specifi fix 4)Your OSPress continue....

type in your requisites in the text box. thats it!

LPP history:

lslpp -h

sar 1 10

bootinfo -b reports last device the system booted frombootinfo -k reports keyswitch position 1=secure, 2=service, 3=normal

bootinfo -r reports amount of memory (/ by 1024)bootinfo -s (disk device) reports size of disk drivebootinfo -T reports type of machine ie rspc,rs6ksmp,rspc or chrpbootinfo -y reports your hardware arquitecture (32bits or 64 bits)

bootinfo -K reports if the kernel in memory is 32bits or 64 bits

You can submit/check a pSeries PMR via the web at:

https://techsupport.services.ibm.com/ssr/ssr.slprob

Force a user to change their password on their next login:pwdadm -f ADMCHG usernameNote that this works with some sshd's and not others

Identifying hard disk issues:

svmon -Gvmstat 1 20iostat -d hdisk0 1 20ps avg | sort +3r -n | head -25

Maximum number of processes a user can have:lsattr -E -l sys0 -a maxuproc

Page 40: AIX Commands1

smitty chgsysAlso allows one to change the max number of processes per user, amongother things

AIX and SNMP:

by Host Resource you mean the AIX SNMP component that monitors system resources ??

if so, then there's a conf file for the daemon aixmibd named /etc/aixmibd.conf where you can configure the thresholds for many monitors. Once you have configure this then you should activate the daemon by issuing:

startsrc -s aixmibd

Please remember to uncomment the line that starts aixmibd in /etc/rc.tcpip file.

On AIX patches:

1) An APAR (Authorized Program Analysis Report) is a bunch of software patches that solves many problems while a PTF (is the same as Fix and means Program Temporary Fix) is a patch that solves one specific problem. You will download Maintenance Levels (ML) as APARs from IBM Software Web Site.

2) You should install the latest Maintenance Level for the AIX version you have installed (usually a big bunch of software up to 650 MB that needs almost 1GB space to be decompressed and installed). As AIX 5L is new technology from IBM they're patching many problems and generating ML very often. You can download from http://www-1.ibm.com/servers/eserver/support/pseries/aixfixes.html

3) First, you have to know which Fix or PTF to install, then download it from the above web link, then copy to a location in the server (usually PTF's are copied to /usr/sys/inst.images directory as well as there's enough space (what i do is to create a new FS of some 2 GB dize and mount it over /usr/sys/inst.images, after installing the APAR or PTF i just delete the FS without deleting the mount point). Then uncompress or unzip, untar, whatever, and using the fastpath smitty update_all in AIX you can install or preview the installation of any patches. I recommend using preview option before real installation and also recommend installing patches in APPLIED status, that is, both either original or old version and newest version of the software are installed, so you can REJECT the installation of any patch.

4) You can remove any single fileset with the fastpath smitty remove

5) A COMMITed software is installed and the only way to reject it is by uninstalling the software fileset while a APPLIED software is installed and the preview versions of filesets are installed too so if you REJECT the APPLIED software then those older versions will be active again.

Page 41: AIX Commands1

Checking on known maintenance levels:

esmf04m-strombrg> oslevel -qrKnown Recommended Maintenance Levels

5100-045100-035100-025100-01esmf04m-strombrg> lppchk -v

Dual booting AIX:

>Okay you install AIX 5.1 on hdisk0 as example and boot your maschine. th=>an>you clone your rootvg to hdisk1 :>alt_disk_install -C hdisk1>so you have hdisk0 with old_rootvg>and hdisk1 with alt_*rootvg>>bootlist -m hdisk0 hdisk1 (means you boot from hdisk0 first and hdisk1>second)>>boot with AIX5.2 CD and install with Migartion Option from prompt on>hdisk0.>>now you have Aix5.2 on hdisk0 and aix5.1 on hdisk1>>if you want to remove the alternate disk install:>alt_disk_install -X

Installing an IBM maintenance release upgrade:

Go to the IBM Support Fix Central site:http://www-912.ibm.com/eserver/support/fixes/fcgui.jsp

* Server Select "Pseries family" or the series that your server is.

* Product or fix typeSelect "AIX OS, java, compilers"

* Ordering optionSelect "Mainteneance packages"

* OS levelSelect "AIX 5.1"

Select "continue" for next screen

Current levelSelect "5100-04"

Desired Level

Page 42: AIX Commands1

Select "5100-05"

Select "go"

Download "510405.tar.gz " at the bottom of the page

Follow the instructions

Locking an account:

The following procedure can be used to lock a user's account;(1) smitty user(2) select, change the characteristics of a user(3) Expiration Date: input the effective date, when this account will be expiring / closing(4) Is this user account locked: false, use tab key to choose true(5) User can login:true, use tab key to change true to false(6) user can login remotely:true, use tab key to change true to false(7) Press enter key and account will be locked(8) for further security also change the password

to permit the user to login after 30 days / specfied time revert the above fields to original values.

If an ESMF node mostly falls off the net (strobe shows only about 5ports open), then:

1) Go down to the ESMF HMC2) Log in3) Locate the right window to use4) Log in to the trouble machine5) kill and restart srcmstr6) startsrc -s inetd7) startsrc -s sshd8) startsrc -s automountd9) /etc/nfs.clean10) /etc/rc.nfs

There may be other things that need to be started up as well, but thishas been sufficient so far.

Following the documentation if you issue the following command you will activate HMT or Hardware MultiThreading

# bosdebug -H onMemory debugger offMemory sizes 0Network memory sizes 0 Kernel debugger off Real Time Kernel offHMT on

...but only if your hardware -supports- HMT!

Page 43: AIX Commands1

Definiing a virtual network interface:ifconfig en# alias xxx.xxx.xxx.xxx

Checking if NFS is active:lssrc -a | egrep nfs biod nfs 20752 active nfsd nfs 21426 active rpc.mountd nfs 27888 active rpc.statd nfs 22730 active rpc.lockd nfs 24280 active

nfso -o nfs_use_reserved_ports=1

Find where gzip lives, package-wise:which_fileset gzip

Get the machine model:

esmf04m-strombrg> /usr/bin/uname -MIBM,7039-651esmf04m-strombrg>

lsconfLooks a lot like prtconf?

You can check microcode version by issuing the following command

lsmcode

if this does not work, then

lscfg -vp | grep -i alterable

You can download Fixes and microcodes not only for your Server nut for any

peripheral devices from

techsupport.services.ibm.com

1. Type no -o tcp_keepinit=3750 The initial timeout for TCP/IP will change from 75 seconds to 31.25 minutes. The time (3750) is in 1/2 seconds.

2. Type no -o tcp_keepidle=86400 The connection will be kept alivefor 12 hours.

The above two items will not be active once a reboot is done. If thissolves your problem you can add the statements to your /etc/rc.tcpip file.

Page 44: AIX Commands1

filemon Command

Monitors the performance of the file system, and reports the I/O activity onbehalf of logical files, virtual memory segments, logical volumes, and physicalvolumes.

lsfs...can be used to check what kind of filesystem a filesystem is

portmirApparently can be used to snoop on a tty/pty on AIX? A bit like screenor VNC, but without the forethought requirement.

To mirror the terminal.

/usr/sbin/portmir -t '/dev/pts/2' -m ''

To close the port mirror.

Portmir –o │

Restoring from a mksysb tape:

You can either boot from your mksysb Medium (band Streamer or cdrom) andrestore.

change your bootlist:

if you have a Band Streamer, so you can boot from AIX Installation Mediumand choose point 3 (Maintenance mode) and restore from media.

Determing what needs to be upgraded to advance to a higher os level:you can do an "instfix -i | grep ML" to list which maintenance level isincomplete and then show what filesets are required i.e. if AIX 5.2 ML02 isincomplete do "instfix -ivk 5200-01_AIX_ML | grep ":" | grep not"

Nice page with AIX OpenSSH bff's, a script for creating bff's, a scriptfor setting up LBX for use with ssh, and more.http://www.zip.com.au/~dtucker/openssh/

An example mksysb backup:

# mksysb /dev/rmt0

Creating tape boot image ...

Creating list of files to back up .Backing up 68614 files..............................17379 of 68614 files backed up (25%)..............................25331 of 68614 files backed up (36%)..............................

Page 45: AIX Commands1

25341 of 68614 files backed up (36%)..............................55359 of 68614 files backed up (80%).................68614 of 68614 files backed up (100%)0512-038 mksysb: Backup Completed Successfully.# echo $PATH/usr/ucb:/bin:/usr/bin:/etc:/usr/lpp/ssp/bin:/usr/lib/instl:/usr/sbin:/usr/local/bin#

Note the PATH! The backup failed when I had a larger PATH.

IBM's document describing AIX to Solaris admins:http://www.redbooks.ibm.com/abstracts/sg246584.html?Open

Changing the boot device:

Boot from aix cd's into maint shell and run the bosboot -ad /dev/hdisk0command.

Or if the hd5 boot device is mirrored on hdisk0 and hdisk1 all you needto do is boot into sms menu and ensure both disks are selected in theboot order.

To access sms hit 1 before it does a speaker test. /////You can boot it up into what used to be called SMS mode .. i.e. hit F1 atthe 'keyboard' prompt ... You can change the boot device from there andthen make sure that you rerun your bosboot once you have booted up.Couldn't be simpler

manctsr/ >lsvg rootvg -prootvg:PV=5FNAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTIONhdisk0 active 542 245 28..00..00..108..109hdisk1 active 542 245 28..00..00..108..109manctsr/ >lsvg rootvg -lrootvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINThd5 boot 1 2 2 closed/syncd N/Ahd6 paging 64 128 2 open/syncd N/Ahd8 jfslog 1 2 2 open/syncd N/Ahd4 jfs 1 2 2 open/syncd /hd2 jfs 27 54 2 open/syncd /usrhd9var jfs 3 6 2 open/syncd /varhd3 jfs 5 10 2 open/syncd /tmphd1 jfs 1 2 2 open/syncd /homeapachelv jfs 5 10 2 open/syncd /apachecv4=5Fhome jfs 172 344 2 open/syncd /export/cv4=5Fhomecv4=5Fdec jfs 15 30 2 open/syncd /export/cv4=5Fd=eclv00 jfs 2 4 2 open/syncd /mn/script

# lsvg rootvg -lrootvg:

Page 46: AIX Commands1

LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINThd5 boot 1 2 2 closed/syncd N/Ahd6 paging 40 80 2 open/syncd N/Ahd8 jfslog 1 2 2 open/syncd N/Ahd4 jfs 1 2 2 open/syncd /hd2 jfs 71 142 2 open/syncd /usrhd9var jfs 1 2 2 open/syncd /varhd3 jfs 2 4 2 open/syncd /tmphd1 jfs 4 8 2 open/syncd /homehd10opt jfs 2 4 2 open/syncd /optlog1 jfslog 1 2 2 closed/syncd N/Apaging01 paging 9 18 2 open/syncd N/Ahd14 jfs 4 8 2 closed/syncd N/A

PSSP has it's own 5 CD set (PSSP-3.5) and has to be ordered. Thanks

Don't panic! DISK_ERR4 (in errpt) is just a bad block relocation andis a somewhat"normal" occurrence. You only need to be concerned about these errorsif you notice them increasing in number on the same disk. So - you needto track it but not necessarily replace it.

What kernel level (lslpp -l 'bos.[um]p*')

The hardware must be CHRP (Common Hardware Reference Platform) in order for5.2 or greater to be supported.

You can determine that by issuing "bootinfo -p".

Nice article on AIX backups:

http://www.ahinc.com/aix/backup.htm

A fix for some kinds of tape backup problems:

please post the output of the following command

lsattr -El rmt0

we are looking for the value "ret error", if this is set to true then i'd recommend changing it to false by issuing a smitty devices->Tape devices->Change Tape Devices

How to create mksysb to a remote tape drive.. **** Note mksysb will not be bootable ***. Lets say tape drive is on systemA and you need to create mksysb of system You should be able to do rsh from systemB to systemA Create the script remote_mksysb on systemB with following lines.

Page 47: AIX Commands1

. #!/usr/bin/ksh rm -f /tmp/pipe

mknod /tmp/pipe p mksysb /tmp/pipe & dd if=/tmp/pipe | rsh systemA "dd of=/dev/rmt0 bs=1024 conv=sync" rm /tmp/pipe

Generating a list of system calls known to the kernel:

dd if=/proc/$$/sysent of=/tmp/out

(check the end)

Reading a tape

mksysb

tctl rewindtctl fsf 3restore -Tqvf /dev/rmt0.1|pg

Savevg

tctl rewindtctl fsf 5restore -Tqvf /dev/rmt0.1|pg

I think that all these following commands mean the same thing :

# bootinfo -y32# prtconf -cCPU Type: 32-bit# bootinfo -K32

On alt_disk_install:

We use it mainly to reduce downtime while upgrading the systems and alsoto have a quick back out path. You can have the new built image installon the alt disks. Switch boot device to the new partition and your newlyupgraded system up and running. If your system has any problems youcannot fix with adjustments, you can switch back to the old partitionand bring out the old software.

Outage time is little over a reboot worth of time.

First, try to start the switch adapter daemon (worm) with rc.switch.

Page 48: AIX Commands1

Good luck - these SP switch problems are notoriously hard to fix.

Enabling quotas on a JFS filesystem (and perhaps others) :

Edit /etc/filesystems and edit in quota=userquota on the relevant filesystem.

esmf04m-root> chfs -a "quota = userquota" /homeesmf04m-root> quotaon /homeesmf04m-root> quotacheck /home

If a program proves too large to compile with the default options dueto a toc overflow, please try adding:

-Wl,-b -Wl,bigtoc

...to your $CC or $LDFLAGS

bash-2.05b$ lsattr -El ent0

alt_addr 0x000000000000 Alternate ethernet addressTruebusintr 553 Bus interrupt levelFalsebusmem 0xf8080000 Bus memory addressFalsechksum_offload yes Enable hardware transmit andreceive checksum Truecompat_mode no Gigabit Backward compatabilityTruecopy_bytes 2048 Copy packet if this many or lessbytes Trueflow_ctrl yes Enable Transmit and ReceiveFlow Control Trueintr_priority 3 Interrupt priorityFalseintr_rate 10000 Interrupt events processed perinterrupt Truejumbo_frames no Transmit jumbo framesTruelarge_send yes Enable hardware TX TCPresegmentation Truemedia_speed Auto_Negotiation Media speedTruerom_mem 0xf8040000 ROM memory addressFalserx_hog 1000 RX buffers processed per RXinterrupt Truerxbuf_pool_sz 2048 Rcv buffer pool, make 2X rxdesc_que_szTruerxdesc_que_sz 1024 RX descriptor queue sizeTrueslih_hog 10 Max Interrupt events processedper interrupt Truetx_que_sz 8192 Software transmit queue size

Page 49: AIX Commands1

Truetxdesc_que_sz 1024 TX descriptor queue sizeTrueuse_alt_addr no Enable alternate ethernet addressTrue

# lsslot -c pci# Slot Description Device(s)U0.1-P1-I1 PCI-X capable, 64 bit, 133MHz slot Empty U0.1-P1-I2 PCI-X capable, 32 bit, 66MHz slot Empty U0.1-P1-I3 PCI-X capable, 32 bit, 66MHz slot pci9 lai0 U0.1-P1-I4 PCI-X capable, 64 bit, 133MHz slot Empty U0.1-P1-I5 PCI-X capable, 64 bit, 133MHz slot Empty U0.1-P1-I6 PCI-X capable, 64 bit, 133MHz slot Empty

Operating System and DevicesSplit a Mirrored Disk from a Volume GroupBeginning with AIX 5.2, snapshot support helps you protect theconsistency of your mirrored volume groups from potential disk failure.Using the snapshot feature, you can split off a mirrored disk or disksto use as a reliable (from the standpoint of the LVM metadata)point-in-time backup of a volume group, and, when needed, reliablyreintegrate the split disks into the volume group. In the followingprocedure, you first split off a mirrored disk from a volume group andthen you merge the split-off disk into the original volume group. Tofurther ensure the reliability of your snapshot, file systems must beunmounted and applications that use raw logical volumes must be in aknown state (a state from which the application can recover if you needto use the backup).

A volume group cannot be split if any one of the following is true:

A disk is already missing. The last non-stale partition would be on the split-off volume group. Any stale partitions exist in the volume group, unless you use the forceflag (-f) with the splitvg command.Furthermore, the snapshot feature (specifically, the splitvg command)cannot be used in enhanced or classic concurrent mode. The split-offvolume group cannot be made concurrent or enhanced concurrent and thereare limitations to the changes allowed for both the split-off and theoriginal volume group. For details, read the chvg command description inAIX 5L Version 5.2 Commands Reference.

Ensure that the volume group is fully mirrored and that the mirrorexists on a disk or set of disks that contains only this set of mirrors.

To enable snapshot support, split off the original volume group (origVG)to another disk or set of disks, using the following command: splitvg origVGAt this point, you now have a reliable point-in-time backup of theoriginal volume group. Be aware, however, that you cannot change theallocation on the split-off volume group. Reactivate the split-off disk and merge it into the original volumegroup using the following command: joinvg origVG

Page 50: AIX Commands1

At this point, the split-off volume group is now reintegrated with theoriginal volume group.

Configuring ntp

1) Stop the xntpd daemon

The xntpd daemon is managed by the System Resource Controller (SRC).To verify that the xntpd daemon is active : lssrc -s xntpd : statusshould be "active"To stop the xntpd subsystem : stopsrc -s xntpd

Note : xntpd is automatically started in /etc/rc.tcpip. To verify this :cat /etc/rc.tcpip | grep xntpd.

2) Modify the /etc/ntp.conf file

Put the following lines in the /etc/ntp.conf file :

server <IP address or FQDN of timeserver> preferdriftfile /etc/ntp.drifttracefile /etc/ntp.trace

3) Restart the xntp daemon

To restart the xntpd daemon :startsrc -s xntpd

4) Check status of time synchronization

To check the status of the time synchronisation, use the ntpq utility.ntpq -i : start ntpq interactively

ntpq> peer

remote refid st t when poll reachdelay offset disp==============================================================================* .PPS. 1 u 863 1024 377 0.92 0.160 0.47

The "offset" field displays the difference (in milliseconds) between thesystem time and the reference time.Type "quit" to exit the ntpq utility.

Kind of like ldd:dump -X32 -Tv /bin/ls

Getting security notices from IBM:https://techsupport.services.ibm.com/server/pseries.subscriptionSvcs?mode=2

Changing prngd to listen on a socket, using chsys:

Page 51: AIX Commands1

esmfcws-root> chssys -s prngd -a '-f /dev/egd-pool -m 666 tcp/localhost:708'0513-077 Subsystem has been changed.esmfcws-root> ps -ef | grep prng root 303186 1015878 0 19:19:43 pts/2 0:00 grep prng root 1007836 262212 0 19:04:42 - 0:01 /opt/freeware/sbin/prngd -f /dev/egd-pool -m 666esmfcws-root> stopsrc -s prngd0513-044 The prngd Subsystem was requested to stop.esmfcws-root> startsrc -s prngd0513-059 The prngd Subsystem has been started. Subsystem PID is 852062.esmfcws-root> ps -ef | grep prng root 852062 262212 0 19:20:42 - 0:01 /opt/freeware/sbin/prngd -f /dev/egd-pool -m 666 tcp/localhost:708 root 1007846 1015878 0 19:20:54 pts/2 0:00 grep prngesmfcws-root> /usr/lolocal lost+foundesmfcws-root> /usr/local/sbin/gen-pasNot bad, using prngd for entropycf4b01142c33d9bd06f1e50d6968f4daesmfcws-root>

Or if prngd isn't already partially set up:

esmf04m-root> mkssys -s prngd -p /opt/freeware/sbin/prngd -u root -a'-f /dev/egd-pool -m 666 tcp/localhost:708'0513-071 The prngd Subsystem has been added.esmf04m-root> lssrc -s prngdSubsystem Group PID Status prngd inoperativeesmf04m-root>

esmf04m-root> for i in 1 2 3 4 5 6 7 8; do ssh esmf0${i}m "mkssys -sprngd -p /opt/freeware/sbin/prngd -u root -a '-f /dev/egd-pool -m 666tcp/localhost:708'"; done0513-071 The prngd Subsystem has been added.0513-071 The prngd Subsystem has been added.0513-071 The prngd Subsystem has been added.0513-075 The new subsystem name is already on file.0513-071 The prngd Subsystem has been added.0513-071 The prngd Subsystem has been added.0513-071 The prngd Subsystem has been added.0513-071 The prngd Subsystem has been added.esmf04m-root> for i in 1 2 3 4 5 6 7 8;do ssh esmf0${i}m "stopsrc -s prngd"; done0513-004 The Subsystem or Group, prngd, is currently inoperative.0513-004 The Subsystem or Group, prngd, is currently inoperative.0513-004 The Subsystem or Group, prngd, is currently inoperative.0513-044 The prngd Subsystem was requested to stop.0513-004 The Subsystem or Group, prngd, is currently inoperative.0513-004 The Subsystem or Group, prngd, is currently inoperative.0513-004 The Subsystem or Group, prngd, is currently inoperative.0513-004 The Subsystem or Group, prngd, is currently inoperative.esmf04m-root> for i in 1 2 3 4 5 6 7 8; do ssh esmf0${i}m "startsrc-s prngd"; done0513-059 The prngd Subsystem has been started. Subsystem PID is 25880.0513-059 The prngd Subsystem has been started. Subsystem PID is 34508.0513-059 The prngd Subsystem has been started. Subsystem PID is 30670.

Page 52: AIX Commands1

0513-029 The prngd Subsystem is already active.Multiple instances are not supported.0513-059 The prngd Subsystem has been started. Subsystem PID is 37450.0513-059 The prngd Subsystem has been started. Subsystem PID is 21266.0513-059 The prngd Subsystem has been started. Subsystem PID is 27662.0513-059 The prngd Subsystem has been started. Subsystem PID is 42666.esmf04m-root>

Don't forget /etc/prngd.conf

Only JFS file systems can be large-file-enabled. If you use JFS2, theyhandle files greater than 2GB out of the box.

Mike Badar

Checking on whether the "Trusted Computing Base" is configured:tcbck

please issue the following commands:

fuser -c /mnt

and check for any PID that maybe locking your CD device. If you have any, you can kill them all bye issuing

fuser -ck /mnt

and try to eject the CDROM. If this doesn't work at all, then check for the cdromd daemon (new feature ported for Solaris into AIX) with the following command:

lssrc -a | grep cdrom

if cdromd is running, then you should umount the cdrom device:

cdmountcdumount /cdrom/cdXXcdeject

Linux, by default, requires any NFS mount to use a reserved port below 1024.AIX, by default, uses ports above 1024. Use the following command torestrict AIX to the reserved port range:

# /usr/sbin/nfso -o nfs_use_reserved_ports=1

Creating a subsystem:mkssys -s smbd -p /opt/freeware/sbin/smbd -u 0 -a "-D" -d -q -S -n 15-f 9 -G tcpipBut it's useless since smbd make fork.Sincerely,Lev

Page 53: AIX Commands1

AIX system firmware upgrade (pSeries?) :

Sysplanar is something like motherboard in Intel domain, i.e. it is hardware.It is possible to upgrade firmware when in maintenance mode - when thereis E1F1 on the LCD display right on the machine press key 1 (not on thenumeric keyboard) if you have ASCII terminal.If you have graphical console press functional key 'F1'you will be directed to standalone diagnostics menu

the firmware you can find here together with description: http://techsupport.services.ibm.com/server/mdownload2/download.html

if you cannot boot and have the shell prompt you can do it accordingthe paragraph 'Updating with the Diagnostic Service Aid Method' - seethe description from the link mentioned above.

in the diagnostics menu you can find 'current firmware as well (thereis something like 'Display config' there')

Diagnostics can be ran against a single device while online

use thediag -d devicename

bindprocessor -q ( will give you the number of proc. )lscfg -v ( will give your system info. )lsmcode -A ( will give you the proc. firmware + others )

chuser maxage=0 username

Some good stuff on OpenMP and AIX (among other things):http://www.rz.rwth-aachen.de/ewomp03/OMPtools.html

Someone on AIX-L indicated that this was a good vmtune for a database system:/usr/samples/kernel/vmtune -p 5 -P 20 ( to set the max perm and minperm values)

Getting an AIX machine's serial number:

esmf04m-root> uname -m0020D3FA4C00

LoadLeveler upgrade PMR# 70374-227 - website only showing linux downloadsof loadleveler, no AIX downloads

From a post on AIX-L:

IBM recommends the following formula to calculate the amount of pagingspace you need...

Page 54: AIX Commands1

For memories larger than 256 MB, the following is recommended:

total paging space = 512 MB + (memory size - 256 MB) * 1.25

For 1024MB RAM = 1600MB Paging Space

1 LP = 64 MB = add 17 LP's to = 1600MB

This is what we use while running AIX 5L.

Changing a forgotten root password on AIX:

1. Insert the product media for the same version and level as thecurrent installation into the appropriate drive. 2. Power on the machine. 3. When the screen of icons appears, or when you hear a doublebeep, press the F1 key repeatedly until the System Management Servicesmenu appears. 4. Select Multiboot. 5. Select Install From. 6. Select the device that holds the product media and then selectInstall. 7. Select the AIX version icon. 8. Define your current system as the system console by pressing theF1 key and then press Enter. 9. Select the number of your preferred language and press Enter. 10. Choose Start Maintenance Mode for System Recovery by typing 3and press Enter. 11. Select Access a Root Volume Group. A message displays explainingthat you will not be able to return to the Installation menus withoutrebooting if you change the root volume group at this point. 12. Type 0 and press Enter. 13. Type the number of the appropriate volume group from the listand press Enter. 14. Select Access this Volume Group and start a shell by typing 1and press Enter. 15. At the # (number sign) prompt, type the passwd command at thecommand line prompt to reset the root password. For example:

16. # passwd17. Changing password for "root"18. root's New password: Enter the new password again:

19. To write everything from the buffer to the hard disk and rebootthe system, type the following:

sync;sync;sync;reboot

turning off diagnostic lights:

/usr/lpp/diagnostics/bin/usysfault -s normal

AIX filesystems and quotas:

Page 55: AIX Commands1

http://unix.derkeiler.com/Newsgroups/comp.unix.aix/2003-11/0744.html/////bluesky's /home is JFS, not JFS2, according to the mount command on/home's NFS server.

I also called IBM support to verify what we've been seeing on the web. The tech I reached indicated that:

1) JFS2 does not support quotas in AIX 5.1 or AIX 5.22) Many customers have been requesting quotas for JFS23) He has not heard of any plans to add quota support to JFS2 for AIX 5.34) He would not be surprised if quotas for JFS2 are added to the IBM AIX roadmap sometime soon, given the high demand/////We now have reason to want to move from 5.1 to 5.3 (we want quotas on/ptmp, and we want /ptmp to be a bit under 2 terrabytes; JFS in AIX 5.1does quotas, but not 1T+ filesystems, and JFS 2 on AIX 5.1 does 1T+filesystems, but not quotas; I understand that 5.3's JFS2 does largefilesystems as well as quotas)./////The new piece of news is, that if we were to gateway lustre to AIX overSMB/CIFS, we -wouldn't- have to resort to "sharity", which was a productthat IBM was unlikely to be able to support. It turns out that AIX 5.2and up, include an SMB/CIFS client. So we could upgrade to AIX 5.3 (andwe want to anyway, to get quotas in JFS2), and use IBM's implementationof an SMB/CIFS client, with samba on esmft2./////I'm shy to even try IBM's JFS, because it comes from OS/2 and not AIX.JFS really lacked a _lot_ of traditional UNIX capabilities in its firstreleases on Linux, unlike XFS./////The consensus on comp.unix.aix appears to be that JFS (1) will not allowone-large /ptmp like Charlie wants.

Recall that we recently moved /ptmp from JFS2 to JFS to get quotas.

It turns out that in AIX 5.3, JFS2 can do quotas.

2005-06-23IBM informs me that PSSP is never going to be ported to AIX 5.3. There isa followon product like PSSP called "CSM", and it runs on recent AIX andLinux, but it is not going to support an SP2 switch, like the ESMF has.

Redirect console messages to a specific file of your choosing:swcons /tmp/console.messages

Checking if an AIX machine is still marketed and/or supported by IBM:

http://www-306.ibm.com/common/ssi/OIX.wss

Like tcpdump/ethereal?

Page 56: AIX Commands1

iptrace -e -i lo0 /tmp/iptrace.out, ( let it run for 5 minutes, kill it)ipreport /tmp/iptrace.out

# lscfg -vp | grep -e "Memory DIMM" -e "Size" Memory DIMM: Size........................256 Memory DIMM: Size........................256 Memory DIMM: Size........................256 Memory DIMM: Size........................256

Clipped from a message on AIX-L - outlines the procedure for replacinga bad disk in a logical volume:

u must procee in tyhos order:1- unmirror the rootvg (unmirror rootvg hdisk1)2- extrcat hdisk1 from rootvg (reducevg rootvg hdisk1) hidsk1 should not have any other data, if yes, move them first3- rmdev -dl hdisk14- put the new pv5- cvrmgrl6- extendvg rootvg "the new pv"7-mirrorvg rootvg hdsikxxx

/////And another:

Use this redbook, page 182, section 6.5.1.

http://www.redbooks.ibm.com/abstracts/SG245496.html?Open

On -some- IBM (PowerPC) machines, you boot to singleuser by hitting F5during the boot

Where to get firmware for pSeries machines:

http://techsupport.services.ibm.com/server/mdownload

"I believe the p in p-Series stands for Performance.While the i in i-Series stands for Integrated.""I believe the p in pSeries stands for Power as in the power 5 chip architecture the hardware uses."

OK, from the (0)> prompt enter either ? or h - these subcommands listall the available subcommands you can key into the kdb at the (0)>prompt. Unfortunately, unless you know what you are looking for itshard to understand the output.

The common commands to use are stat and staus - which will show thestatus of the system and dump, vmlog and vmstat will show any memory

Page 57: AIX Commands1

errors that may have caused the dump.

You really need an indepth knowledge of how the system works todecipher most of the output and Im afraid theres no easy way to do it.

This link has a list of all the kdb subcommands

http://www16.boulder.ibm.com/pseries/en_US/aixprggd/kdb/kdb_cmd.htm#kdb_cmd

Regards,

Paul (on AIX-L)

bindprocessor is for binding a process to a specific CPU

esmf04m-root> sysdumpdev -lprimary /dev/lv00secondary /dev/sysdumpnullcopy directory /var/adm/rasforced copy flag TRUEalways allow dump TRUEdump compression OFFWed Oct 26 13:43:31

From a IBM AIX partner:

GIL is a kernel process, which does TCP/IP timing. It handlestransmission errors, ACKs, etc. Normally it shouldn't consume too muchCPU, but it can take quite a lot of CPU when the system is using thenetwork a lot (like with NFS filesystems which are heavily used)..The kproc gil runs the TCP/IP timer driven operations. Every 200ms, andevery 500ms the GIL thread is kicked to go run protocol timers. With TCPup (which is ALWAYS the case), TCP timers are called which end uplooking at every connection on the system (to do retransmission, delayedacks,etc). In version 4 this work is all done on a multi-threaded kprocto promote concurrency and SMP scalability.gil.

GIL is one of the kprocs (kernel processes) in AIX 4.3.3, 5.1 and 5.2.Since the advent of topas in AIX 4.3.3 and changes made to the pscommand in AIX 5.1, system administrators have become aware of thisclass of processes, which are not new to AIX. These kprocs have nouser interfaces and have been largely undocumented in basedocumentation. Once a kproc is started, typically it stays in theprocess table until the next reboot. The system resources used by anyone kproc are accounted as kernel resources, so no separate account iskept of resources used by an individual kproc..Most of these kprocs are NOT described in base AIX documentation andthe descriptions below may be the most complete that can be found..GIL term is an acronym for "Generalized Interrupt Level" and wascreated by the Open Software Foundation (OSF), This is the networkingdaemon responsible for processing all the network interrupts, includingincoming packets, tcp timers, etc.

Page 58: AIX Commands1

.Exactly how these kprocs function and much of their expected behavioris considered IBM proprietary information.

In the event of a power failure, from "jessie" on the AIX-L mailing list:

check you error report for an entry that statesEPOW_SUS_CHRPif there is an entry post it in detail to have a look at the Power statusregisters, and the sense data.

If it is not a true failure such as a fan, or power supply then you wouldnotice in the logs that the problem started after a shutdown, or powerfailure...

"pstat -S will associate processor to process but notprocess to processor. It is a matter of opinion ifthis is what you want. "

Superb page on AIX:

http://www.douzhe.com/docs/jh/9/97757.html

...but I think there may be a bit of a mistake on how to do backups toa remote tape drive... dd -should- work for that, but IME, it doesn't.

AIX supports large pages with 32-bit and 64-bit kernels. Applications,either 32-bit or 64-bit,can take advantage of large pages. The extended common object file format(XCOFF orXCOFF64), the object file format for AIX, provides a flag to identifybinaries if they are set (orcleared) to use large pages (or turn the large pages flag) through ldedit10.The flag can alsobe turned on at load time (ld)10 with the following commands:ld command: ld -blpdata -o a.outldedit command: ldedit -blpdata a.out (or -bnolpdata a.out)

An AIX upgrade procedure:

I just went through this with my company, and wrote some directions asto what we should do; I will share this document with you. ******NOTE******Some of this is specific to my company, but you may find it usefulanyhow****************

You should do a complete configuration management scheme/snapshot ofyour system:1) execute df -Ik2) execute lsvg, lsvg -p for each vg, and lsvg -l for each vg3) execute lspv4) execute bootlist -m normal -o and bootlist -m service -o

Page 59: AIX Commands1

5) execute bootinfo -y and bootinfo -k6) execute lspv -a7) execute lsvg -M rootvg8) execute lsconf

You want to document everything from above so that you can have this tore-create your system should there be any mistakes or unfortunateevents.

This just helps you to know exactly what your system looks like, beforeyou make any changes.

Go to this site and you will get exactly what you need:http://www-03.ibm.com/servers/eserver/support/unixservers/aixfixes.html

Choose the -> AIX 5.3 link and choose follow the prompts to get you thecorrect maintenance level(s).

Please let me know if this is of any help.

Thanks.

LeRoy S. Phillips 'Phil'UNIX System Administrator (AIX/SAP)

From a message on IBM-AIX-L:

I get these stupid messages all the time and I just filter them and send them to junk.I've tried making the sysdumpdev bigger, but it comes back and wants it to be just a little bigger than I made it.IBM does recommend that you use a second sysdumpdev.

//////////////////////////////////// SYSTEM DUMP////////////////////////////////////IBM recommends: Don't mirror the system dump device Don't use compression on the dump device Don't use a secondary dump device unless it is on a separate device, separate cable and separate i/o card.

sysdumpdev -l Lists current dump destination.sysdumpdev -e Estimates dumpsize of the current system in bytes.sysdumpdev -L Displays information about the previous dump.sysdumpdev -c <-- the system dump device will not be compressedwhen the next dump is takensysdumpdev -p (dump device) -P Sets the default dump device, permanentlysysdumpdev -P -s /dev/sysdumpnull <-- makes the secondarydump device a bit bucket (recommended)

sysdumpstart -p Starts a dump and writes to the primary dump device.sysdumpstart -s Starts a dump and writes to the secondary dump device.

(MCA machine can also dump if key is in service position and the reset button is pressed)

Page 60: AIX Commands1

Analyze dump file :-echo "stat status t -m" | crash /var/adm/ras/vmcore.0

$ errptIDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTIONF89FB899 0822150005 P O dumpcheck The copy directory is too small

This message is the result of a dump device check. You can fix this by increasing the size of your dump device. If you are using the default dump device (/dev/hd6) then increase your paging size or go to smit dump and "select System Dump Compression". Myself, I don't like to use the default dump device so I create a sysdumplv and make sure I have enough space. To check space needed go to smit dump and select "Show Estimated Dump Size" this will give you an idea about the size needed.

The copy directory is whatever sysdumpdev says it is.Run sysdumpdev and you will get something like#sysdumpdevprimary /dev/hd6secondary /dev/sysdumpnullcopy directory /var/adm/rasforced copy flag TRUE always allow dump FALSEdump compression ON # sysdumpdev -e 0453-041 Estimated dump size in bytes: 57881395Divide this number by 1024. This is the free space that is needed in your copy directory. Compare it to a df -k or divide this number by 512. This is the free space that is needed in your copy directory. Compare it to a df

nim -o define-t mksysb -a server=master -a location=/mksysb/unix18/mksysb_unix18 -asource=unix18 -a mk_image=yes -a mksysb_flags=em mksysb_unix18

1. Mksysb to tape/CD/DVD2. Do a bosboot -ad on the 2nd hdisk (incase you have to boot from it)3. Unmirror the rootvg (reducevg rootvg hdiskxx)4. Perform upgrade5. If it goes wrong and you can get to a command line change the bootlist to boot from the 2nd hdisk

------------------------------------------------------------------------------------------------------------------------

The command I was looking for was the instfix command posted here bycdelgadop on Saturday. I overlooked it before posting my previous reply.

instfix -icq | grep ":-:"   was the command I was looking for.

Page 61: AIX Commands1

tr \\301 \\374 < file | tr \\332 \\334 | tr -d \\136

it replace Á by ü , replace Ú by Ü and remove the control caracter.

Migration Install from AIX 4.3.3 to AIX 5.2

Pre Migration•    remove the ess disks from the machine make the disks no longer"seen" from the machine (if you have any) this way when you reboot, it will not spend time scanning all theess disks again! •    Install the latest microcode if your machine is old hardware(not LPAR)•    The migration will not update the 4.3.3 documentation. You mustfirst un- install the 4.3.3 doc, do the migration, then installthe 5.1 doc. Uninstall the aix 4.3.3 docbos.html.en_US.cmds.cmds1 bos.html.en_US.cmds.cmds2 bos.html.en_US.cmds.cmds3 bos.html.en_US.cmds.cmds4 bos.html.en_US.cmds.cmds5 bos.html.en_US.cmds.cmds6 bos.html.en_US.files.files_ref bos.msg.En_US.sysmgt.nim.master_guibos.msg.en_US.sysmgt.nim.master_guiUninstall the aix 4.3.3 doc •    •    back up your motd, the migration replaces it with the standard"welcome to aix" •    remove java 1.3.0 •    make sure the machine not see the ESS disks or you will not beable to delete the DPO objectremove the DPO object ( rmdev -l dpo -d )remove ess code ibm2105.rteibmsdd.rte.432ibmpfe.essutil.rteibmpfe.essutil.rte.fibre.dataanything that has 2105 in it ( lslpp -l | grep -i 2105) anything that has sdd in itanything that has essutil in it

•    run lppchk -v and fix any problems first •    AIX requires certain user and group definitions to remainunchanged. Verify that your /etc/passwd has entries matching thefollowing:root:!:0:0::/:/bin/kshdeamon:!:1:1::/etc:bin:!:2:2::/bin:sys:!:3:3::/usr/sys:adm:!:4:4::/var/adm:uucp:!:5:5::/usr/lib/uucp:guest:!:100:100::/home/guest:nobody:!:4294967294:4294967294::/:Verify that your /etc/passwd has entries matching the following:It is important to verify that the preceding entries exist andmatch exactly. Also, verify that no other user has UIDs thatduplicate the preceding. The UID is the third colon-separated

Page 62: AIX Commands1

entry, the first number.Verify that your /etc/group file has entries matching thefollowing:system:!:0:rootstaff:!:1:bin:!:2:root,binsys:!:3:root,bin,sysadm:!:4:bin,admuucp:!:5:uucpmail:!:6:security:!:7:rootcron:!:8:rootprintq:!:9:audit:!:10:rootecs:!:28:nobody:!:4294967294:nobodyusr:!:100:guestVerify that your /etc/group file has entries matching thefollowing:

xlC.rte must be at 5.0.2.0 or better ( or apply IY17981 ) p 321

run usrck -n ALL ( make sure all errors are a known part of theenvironment) run grpck -n ALL ( make sure all errors are a known part of theenvironment ) backup any cron or at allow or deny files ( /usr/adm/cron.deny )if you have TCB then run tcbck -n ALL and correct any errors. (trusted computing base) space requirements /tmp 15 MB free, / 10 MB free, 80 MB ofunallocated PP's on rootvg disks

set your dump devices ( primary and secondary ) to sysdumpnullremove your dump lv's break all mirrors of the rootvg. You should have no mirroredcopies of rootvg during migrationreduce the rootvg to 1 PV

make sure you change your bootlist to reflect you have only onedisk ( bootlist -m normal hdisk0 )make sure the disk in your bootlist is also the disk you bootedfrom ls -l /dev/ipldevice /dev/rhdiskY ( where Y is the hdisk numberlisted in the bootlist ) if the numbers in the 6th column dont match, fix this beforegoing onmake sure /tmp has no bad file names. ( all files should bealphanumeric )make sure all logical volumes in all vg's are synced

backup your system using all disk install to the disk you justfreed up.

Migration set the bootlist to "cd0 hdisk0" load the 5.2 cd reboot themachinemake sure your set to do a "Migration" install and not apreservation installGo into the options, and make sure 64bit is enabled

when the installation is complete, it will ask if you want toaccept the license. choose yes and follow the prompts

Post Migration

Page 63: AIX Commands1

verify LPP with lppchk -v Verify current OS and Maintenance level with oslevel -r Check for previous level file sets still installed on the system

lslpp -l | grep 4.3 | grep COMMITTEDsome third party software may need to be removed by other supportgroups remove any old 4.3.3 file setsperfagent.html.en_US.usergd 4.3.3.0 must be removed for examplecheck for broken file sets lslpp -l | grep BROKENcorrect any problemsmake sure instfix sees your oslevel and ML level ( instfix -ik5100-03_AIX_ML) NOTE: 5.2 this does not work... there is no MLfor 5.2 yet

run lppchk -vm3 to see what file sets are not compatible with AIX5.2 most likely you will see a tivoli file set or two. remove them.re run the command. I had to removeperfagent.html.en_US.usergdInstall the AIX 5.1 DocI:bos.html.en_US.cmds.cmds1 5.1.0.0 I:bos.html.en_US.cmds.cmds2 5.1.0.0 I:bos.html.en_US.cmds.cmds3 5.1.0.0 I:bos.html.en_US.cmds.cmds4 5.1.0.0 I:bos.html.en_US.cmds.cmds5 5.1.0.0 I:bos.html.en_US.cmds.cmds6 5.1.0.0 I:bos.html.en_US.files.files_ref 5.1.0.0 Install the AIX 5.2 Docs ( always install the man pages! )

* Note: when doing installs, there is a new field that asks ifyou accept the license. Its default is "NO". If you install thisway, you will not get an error, but the software will not beavailable to you. I installed the man pages this way and the mancommand replied "there is not an entry for ls " To correct this,I had to reinstall with the license set to "YES". Once it didthat, all was fine.

remove the /etc/hosts.equiv the migration will create for youcheck /etc/security/user default stanza for repeat information.It does not delete the default info, but adds a complete new setof attributes underneath the old ones. The new attributes arecompletely wrong from a security standpoint, so you need todelete this. repeated info starts with pwdchecks= to the end ofthe stanza

remove IMNSearch file sets ( 9 of them ) remove bos.net.snapp ( System Networking Analysis and PerformancePilot )

comment out daytime and time which were added to inetd.confduring the migrationcomment out wsmserver from inetd.conf comment out cmsd, ttdbserver, and dtspc from inetd.conf

restart xntpd if you were using it. un comment in /etc/rc.tcpipcomment out hostmibd in /etc/rc.tcpip

comment out the httpdlite entry in /etc/inittab that was addedduring the migrationcomment out the ctrmc entry in /etc/inittabcomment out the itess entry in /etc/inittab

Page 64: AIX Commands1

install file set bos.adt.prof if its not already there.

change group on /etc/passwd and /etc/opasswd to security ( itwill be system after the migration this is wrong ) change permission's on /etc/passwd and /etc/opasswd to 644 ( itwill be 664 after the migration this is wrong )

check perl. The migration is going to install perl 5.8.0 in/usr/opt/perl5/lib/5.8.0 and change the link /usr/bin/perl topoint to this

install the ess drivers install java 131 ( /install/java131) FORCE install sysback again ( upgrade kills it. ) (if you havesysback) install ML 6 install latest patches you can get ml6 patches disk from ibm

run for a week or so before doing:

extend your rootvg to second disk.mirror rootvgrun bosboot on both diskscreate a dump LV on each disk in rootvguse sysdumpdev to point the primary and secondary dump space tothesereboot machinerun a test backup. ( smitty sysback )

Notes : 

The migration creates a group snapp id=12 admin=true users=registry=filesThe migration creates a new group "lp" GID 11 ( root and ID lp[see below ] need to be in this group ) the migration creates a new ID "lp" lp id=11 pgrp=lp groups=lp,printq home=/var/spool/lpshell=/bin/false login=truesu=true rlogin=true daemon=true admin=false sugroups=ALLadmgroups= tpath=nosakttys=ALL expires=0 auth1=SYSTEM auth2=NONE umask=77registry=files SYSTEM=fileslogintimes= loginretries=5 pwdwarntime=0 account_locked=falseminage=0 maxage=26 maxexpired=-1 minalpha=1 minother=1 mindiff=1 maxrepeats=2minlen=6 histexpire=0 histsize=5 pwdchecks= dictionlist= fsize=2097151 cpu=-1data=262144 stack=65536 core=2097151 rss=65536 nofiles=2000 roles= the migration creates a new ID "lp" /etc/sendmail.cf has been moved to /etc/mail/sendmail.cf and/etc/sendmail.cf is now a link to /etc/mail/sendmail.cf/etc/aliases has been moved to /etc/mail/aliases and /etc/aliasesis now a link to /etc/mail/aliases

/var/adm/cron/log exists will have to be trimmed from time totime.. p 383 AIX5.2 diff guideperformance tools moved to bos.perf.tools .... also must installp 394 AIX5.2 diff guide bos.sysmgt.tracebos.perf.perfstatperfagent.tools

Page 65: AIX Commands1

bos.libperfstat needs to be installed p 419 AIX5.2 diff guide

---------------Original Message--------------->Dear AIX brothers,>>- I plan some very strategic server upgrade from 4.3.3-ML11 to5.2-ML6.>Would you have some kind of wroten step by step procedure forthis >upgrade?>>- Because I have a 2 disk mirror on the rootvg, I thought thatbreaking >the mirror before the upgrade would help recover quickly afaulty >upgrade... >(Assuming that I have also a working mksysb tape of course...)>Any kind of advice on this side?>How to break the mirror / How to boot on the old mirror after afaulty >upgrade?>>Tks a million,>

AIX 4.1 filesystem enhancements1. Introduction5 significant areas of enhancements:• Large filesystems (>2 GB)• Block fragments• Block compression• Variable inodes• SMP support (will not be covered)

2. Large filesystems• Classic 32 bit UNIX uses signed 32 bit int for absolute byte addressing in the systemopen file table• Therefore largest filesystem size that is byte addressable is 2**32 bytes• AIX 4 uses a 64 bit long long for addressing a filesystem size up to a theoretical2**64 or 256GB• New data type offset_t defined in <sys/types.h>, and new system callllseek()• IBM has only tested up to 64GB• Maximum size of files is still 2GB

3. Block fragments• AIX V3 used fixed size 4K disk blocks for better performance.. Potentially verywasteful of space for small files• Block fragments attempt to minimize waste due to fragmentation while at the sametime preserving performance of large block size• Based on BSD Fast File System• Split a 4K disk block into 512, 1K, or 2K fragments at filesystem creation time. 4K“fragment” is default. (i.e. no splitting, backwards compatible with AIX V3)

Page 66: AIX Commands1

• only allocate as many fragments as required to store the file• Fragments are individually addressable• only applies to direct geometry files (i.e. no single or double indirection inodes) whichMeans limit of 32K• Files larger than 32K do not use fragments

Actual filesystem demographic data from /rc09Total of 59068 files, 2GB filesystem on  

sop02# of files < 512 bytes: 25232 42.72%# of files between 512 and 1023 bytes: 2978 5.04%# of files between 1024 and 2047 bytes: 5138 8.70%# of files between 2048 and 4095 bytes: 4581 7.76%# of files between 4096 and 32767 bytes:14292 24.20%# of files 32K and larger: 6847 11.59%

Effect of various fragment sizes on /rc09Fragment size 512 1K 2K 4K Mbytes used 1482 1500 1538 1622• Savings of 8.6% if we used 512 byte fragments instead of full 4K blocks• Assumes no fragmentation, figure will be lower in real life• defragfs command is provided to combine fragments from partially filled blocks• Doesn’t look too impressive! However.....

4. Disk block compression• Transparent compression/decompression functionally like DOS 6.X and Stacker butwithout the danger• Lempel-Ziv (LZ) algorithm• Compression is done on a block rather than on the entire file for better performancebut slightly lower compression ratios• Needed for low overhead random I/O• Requires fragments smaller than 4K• Compression done before data is written to disk• Requires 50 CPU cycles/byte for compress and 10 CPU cycles/byte for decompress• Will only occupy fragments needed to hold data rather than entire block• Savings of 50% possible on executables and ASCII text. Syslog savings 75%because of large number of repeating characters.• Uses conservative block allocation to prevent loss of data in a filesystem full situation• Supports user defined compression algorithms• lsfs -q command to display compression status of a filesystem

5. Variable inodes• AIX V3 and V4 default will create an inode for every 4K data block. NBPI (numberof blocks per inode) in this case is 4096.• NBPI is ratio of blocks to inodes• AIX 4.1 NBPI of 512, 1K, 2K, 4K, 8K and 16K. e.g. NBPI = 16K means 1 inode for4 4K data blocks• Small NBPI good for filesystems with many small files and vice versa• NBPI determined at filesystem creation time• Inodes in AIX JFS can be increased by simply enlarging the filesystem• NBPI also determines maximum size of filesystem. e.g. NBPI value of 16K requiredto create a 256GB filesystem.

Page 67: AIX Commands1

6. Deployment possibilities• User filesystems (especially on homer cluster) could use fragments• NNTP can use fragments as well as a lower NBPI ratio• Filesystems will few large files will benefit by setting NBPI to 16K• Read-mostly filesystems such as /usr/local can use compression as well as fragments• Syslog and similar data will score huge gains by using compression• Others?• Compression and 512 byte fragments are in use right now on ozzo:/s1

Understanding Fragments and a Variable Number of I-NodesThe journaled file system (JFS) fragment support allows disk space to be divided into allocation units that are smaller than the default size of 4096 bytes. Smaller allocation units or "fragments" minimize wasted disk space by more efficiently storing the data in a file or directory's partial logical blocks. The functional behavior of JFS fragment support is based on that provided by Berkeley Software Distribution (BSD) fragment support. Similar to BSD, JFS fragment support allows users to specify the number of i-nodes that a file system has.

Disk Utilization Many UNIX file systems only allocate contiguous disk space in units equal in size to the logical blocks used for the logical division of files and directories. These allocation units are typically referred to as "disk blocks" and a single disk block is used exclusively to store the data contained within a single logical block of a file or directory. Using a relatively large logical block size (4096 bytes for example) and maintaining disk block allocations that are equal in size to the logical block are advantageous for reducing the number of disk I/O operations that must be performed by a single file system operation, since a file or directory's data is stored on disk in a small number of large disk blocks rather than in a large number of small disk blocks. For example, a file with a size of 4096 bytes or less would be allocated a single 4096-byte disk block if the logical block size is 4096 bytes. A read or write operation would therefore only have to perform a single disk I/O operation to access the data on the disk. If the logical block size were smaller requiring more than one allocation for the same amount of data, then more than one disk I/O operation may be required to access the data. A large logical block and equal disk block size are also advantageous for reducing the amount of disk space allocation activity that must be performed as new data is added to files and directories, since large disk blocks hold more data.Restricting the disk space allocation unit to the logical block size can, however, lead to wasted disk space in a file system containing numerous files and directories of a small size. Wasted disk space occurs when a logical block's worth of disk space is allocated to a partial logical block of a file or directory. Since partial logical blocks always contain less than a logical block's worth of data, a partial logical block will only consume a portion of the disk space allocated to it. The remaining portion remains unused since

Page 68: AIX Commands1

no other file or directory can write its contents to disk space that has already been allocated. The total amount of wasted disk space can be large for file systems containing a large number of small files and directories. A file system using 4096-byte allocation units may experience up to 45% wasted disk space. (Statistic taken from UNIX System Manager's Manual, Computer Systems Research Group, University of California at Berkeley, The Regents of the University of California and/or Bell Telephone Laboratories, 1988, SMM 14.)

Optimizing Disk UtilizationIn the JFS, however, the disk space allocation unit, referred to as a fragment, can be smaller than the logical block size of 4096 bytes. With the use of fragments smaller than 4096 bytes, the data contained within a partial logical block can be stored more efficiently by using only as many fragments as are required to hold the data. For example, a partial logical block that only has 500 bytes could be allocated a fragment of 512 bytes (assuming a fragment size of 512 bytes), thus greatly reducing the amount of wasted disk space. If the storage requirements of a partial logical block increase, one or more additional fragments will be allocated.

FragmentsThe fragment size for a file system is specified during its creation. The allowable fragment sizes for journaled file systems (JFS) are 512, 1024, 2048, and 4096 bytes. For consistency with previous verions of AIX Version 3, the default fragment size is 4096 bytes. Different file systems can have different fragment sizes, but only one fragment size can be used within a single file system. Different fragment sizes can also coexist on a single system (machine) so that users can select a fragment size most appropriate for each file system. JFS fragment support provides a view of the file system as a contiguous series of fragments rather than as a contiguous series of disk blocks. To maintain the efficiency of disk operations, however, disk space is often allocated in units of 4096 bytes so that the disk blocks or allocation units remain equal in size to the logical blocks. A disk-block allocation in this case can be viewed as an allocation of 4096 bytes of contiguous fragments. Both operational overhead (additional disk seeks, data transfers, and allocation activity) and better utilization of disk space increase as the fragment size for a file system decreases. To maintain the optimum balance between increased overhead and increased usable disk space, the following factors apply to JFS fragment support:

Disk space allocations of 4096 bytes of fragments are maintained for a file or directory's logical blocks where possible.

Only partial logical blocks for files or directories less than 32KB in size can be allocated less than 4096 bytes of fragments.

Maintaining 4096-byte disk space allocations allows disk operations to be more efficient as described previously in "Disk Utilization." As the files and directories within a file system grow beyond 32KB in size, the benefit of maintaining disk space allocations of less than 4096 bytes for partial logical blocks diminishes. The disk space savings as a percentage of

Page 69: AIX Commands1

total file system space grows small while the extra performance cost of maintaining small disk space allocations remains constant. Since disk space allocations of less than 4096 bytes provide the most effective disk space utilization when used with small files and directories, the logical blocks of files and directories equal to or greater than 32KB are always allocated 4096 bytes of fragments. Any partial logical block associated with such a large file or directory is also allocated 4096 bytes of fragments.

Variable Number of I-Nodes Since fragment support optimizes disk space utilization, it increases the number of small files and directories that can be stored within a file system. However, disk space is only one of the file system resources required by files and directories: each file or directory also requires a disk i-node. The JFS allows the number of disk i-nodes created within a file system to be specified in case more or fewer than the default number of disk i-nodes is desired. The number of disk i-nodes can be specified at file system creation as the number of bytes per i-node (NBPI). For example, an NBPI value of 1024 causes a disk i-node to be created for every 1024 bytes of file system disk space. Another way to look at this is that a small NBPI value (512 for instance) results in a large number of i-nodes, while a large NBPI value (such as 16,384) results in a small number of i-nodes.The set of allowable NBPI values vary according to the allocation group size (agsize). The default is 8MB. In AIX Version 4.1, agsize is fixed at 8MB. The allowable NBPI values are 512, 1024, 2048, 4096, 8192, and 16,384 with an agize of 8MB.In AIX Version 4.2 or later, a larger agsize may be used. The allowable values for agsize are 8, 16, 32, and 64. The range of allowable NBPI values scales up as agsize increases. If the agsize is doubled to 16MB, the range of NBPI values also double: 1024, 2048, 4096, 8193, 16384, and 32768.For consistency with previous versions of AIX Version 3, the default NBPI value is 4096, and the default agsize is 8. The desired NBPI and agsize values are specified during file system creation. If the file system size is increased, the NBPI and agsize values remain set to the values specified during the file system's creation.

Specifying Fragment Size and NBPI Fragment size and the number-of-bytes-per-i-node (NBPI) value are specified during the file system's creation with the crfs and mkfs commands or by using the System Management Interface Tool (SMIT). The decision of fragment size and how many i-nodes to create for the file system should be based on the projected number of files contained by the file system and their size.

Identifying Fragment Size and NBPI The file-system-fragment size and the number-of-bytes-per-i-node (NBPI) value can be identified through the lsfs command or the System Management Interface Tool (SMIT). For application programs, the statfs subroutine can be used to identify the file system fragment size.

Page 70: AIX Commands1

Compatibility and MigrationPrevious versions of AIX are compatible with the current JFS, although file systems with a nondefault fragment size, NBPI value, or allocation group size may require special attention if migrated to a previous version.

File System Images The JFS fully supports JFS file system images created under previous versions of AIX. These file system images and any JFS file system image created with the default fragment size and NBPI value of 4096 bytes, and default allocation group size (agsize) of 8 can be interchanged with the current and previous versions of AIX without requiring any special migration activities. JFS file system images created with a fragment size or NBPI value or agsize other than the default values may be incompatible with previous versions of AIX. Specifically, only file system images less than or equal to 2G in size and created with the default parameters can be interchanged amongst AIX Versions 3.2, 4.1 and 4.2. File system images created with fragment size of either 512, 1024, 2048, or 4096, and an NBPI value of either 512, 1024, 2048, 4096, 8192, or 16384, and a agsize of 8M can ge interchanges amongst AIX Version 4.1 and AIX Version 4.2. Finally, creating a file system with NBPI value greater than 16384 or with an agsize greater than 8M will result in a JFS file system that is only recognized on AIX Version 4.2.The following procedure must be used to migrate incompatible file systems from one version of AIX to another:

Backup the file system by file name on the source system.

Create a file system on the destination system.

Restore the backed-up files on the destination system.

Backup/Restore Although backup and restore sequences can be performed between file systems with different fragment sizes and NBPI values, due to increased disk utilization and a large number of i-nodes, restore operations may fail due to a lack of free fragments or disk i-nodes if the fragment size or NBPI value of the source file system is smaller than the fragment size or NBPI value of the target file system. This is of particular interest for full file system backup and restore sequences and may even occur when the total file system size of the target file system is larger than that of the source file system.

Device Driver Limitations A device driver must provide disk block addressability that is the same as the file system fragment size. For example, if a JFS file system was made on a user supplied RAM disk device driver, the driver must allow 512 byte blocks to contain a file system that had 512 byte fragments. If the driver

Page 71: AIX Commands1

only allowed page level addressability, a JFS with a fragment size of 4096 bytes could only be used.

Note: Any valid NBPI value can be specified for any device.

Performance Costs Although file systems that use fragments smaller than 4096 bytes as their allocation unit may require substantially less disk space than those using the default allocation unit of 4096 bytes, the use of smaller fragments may incur performance costs.

Increased Allocation ActivitySince disk space is allocated in smaller units for a file system with a fragment size other than 4096 bytes, allocation activity may occur more often when files or directories are repeatedly extended in size. For example, a write operation that extends the size of a zero-length file by 512 bytes results in the allocation of one fragment to the file, assuming a fragment size of 512 bytes. If the file size is extended further by another write of 512 bytes, an additional fragment must be allocated to the file. Applying this example to a file system with 4096-byte fragments, disk space allocation would occur only once, as part of the first write operation. No additional allocation activity must be performed as part of the second write operation since the initial 4096-byte fragment allocation is large enough to hold the data added by the second write operation.Allocation activity adds performance overhead to file system operations. However, allocation activity can be minimized for file systems with fragment sizes smaller than 4096 bytes if files are extended by 4096 bytes at a time when possible.

Free Space FragmentationUsing fragments smaller than 4096 bytes may cause greater fragmentation of the disk's free space. For example, consider an area of the disk that is divided into eight fragments of 512 bytes each. Suppose that different files, requiring 512 bytes each, have written to the first, fourth, fifth, and seventh fragments in this area of the disk, leaving the second, third, sixth, and eighth fragments free. Although four fragments representing 2048 bytes of disk space are free, no partial logical block requiring four fragments (or 2048 bytes) will be allocated for these free fragments, since the fragments in a single allocation must be contiguous.

Page 72: AIX Commands1

Since the fragments allocated for a file or directory's logical blocks must be contiguous, free space fragmentation may cause a file system operation that requests new disk space to fail even though the total amount of available free space is large enough to satisfy the operation. For example, a write operation that extends a zero-length file by one logical block requires 4096 bytes of contiguous disk space to be allocated. If the file system free space is fragmented and consists of 32 noncontiguous 512-byte fragments or a total of 16KB of free disk space, the write operation will fail, since eight contiguous fragments (or 4096 bytes of contiguous disk space) are not available to satisfy the write operation.A file system with an unmanageable amount of fragmented free space can be defragmented with the defragfs command. The execution of defrags has an impact on performance.

Increased Fragment Allocation Map SizeMore virtual memory and file system disk space may be required to hold fragment allocation maps for file systems with a fragment size smaller than 4096 bytes. Fragments serve as the basic unit of disk space allocation, and the allocation state of each fragment within a file system is recorded in the file system's fragment allocation map.

defragfs CommandPurposeIncreases a file system's contiguous free space.

Syntaxdefragfs [ -q | -r ] { Device | FileSystem }

DescriptionThe defragfs command increases a file system's contiguous free space by reorganizing allocations to be contiguous rather than scattered across the disk. You can specify the file system to be defragmented with the Device variable, the path name of the logical volume (for example, /dev/hd4). You can also specify it with the FileSystem variable, which is the mount point in the /etc/filesystems file. The defragfs command is intended for fragmented and compressed file systems. However, you can use the defragfs command to increase contiguous free space in nonfragmented file systems.You must mount the file system read-write for this command to run successfully. Using the -q flag or the -r flag generates a fragmentation report. These flags do not alter the file system.

Flags-q Reports the current state of the file system.-r Reports the current state of the file system and the state that would result if the defragfs command is

run without either -q or -r flag.

Examples To defragment the /data1 file system located on the /dev/lv00 logical volume, enter:

defragfs /data1

Page 73: AIX Commands1

To defragment the /data1 file system by specifying its mount point, enter:

defragfs /data1

To generate a report on the /data1 file system that indicates its current status as well as its status after being defragmented, enter:

defragfs -r /data1

Files/etc/filesystems Lists the known file systems and defines their

characteristics.

Related InformationThe crfs command, the lsfs command, the mkfs command.

[ Bottom of Page | Previous Page | Next Page | Index | Feedback ]

Commands Reference, Volume 3, i - mmkfs CommandPurposeMakes a file system.

Syntaxmkfs [ -b Boot ] [ -l Label ] [ -i i-Nodes ] [ -o Options ] [ -p Prototype ] [ -s Size ] [ -v VolumeLabel ] [ -V VfsName ] Device

DescriptionThe mkfs command makes a new file system on a specified device. The mkfs command initializes the volume label, file system label, and startup block.The Device parameter specifies a block device name, raw device name, or file system name. If the parameter specifies a file system name, the mkfs command uses this name to obtain the following parameters from the applicable stanza in the /etc/filesystems file, unless these parameters are entered with the mkfs command:dev Device namevol Volume IDsize File system sizeboot Program to be installed in the startup blockvfs Definition of the virtual file systemoptions File-system implementation-specific options of the form Keyword, Keyword=ValueNotes:

The file system is created with the setgid (set group ID) bit enabled. The setgid bit determines the default group permissions. All directories created under the new file system have the same default group permissions.

The mkfs command does not alter anything in a mounted file system, including the file system label. The file system label changes when you change the mount point, unless the file system is mounted.

For information about creating a filesystem on a striped logical volume, refer to File Systems on Striped Logical Volumes in the mklv documentation.

Flags-b Boot Names the program to be installed in block 0 of the new file system.-i i-Nodes Specifies the initial number of i-nodes on the file system. This flag is ignored when

creating a journaled file system.

Page 74: AIX Commands1

-l Label Specifies the file system label for the new file system.-o Options Specifies a comma-separated list of virtual file system implementation-specific options.

The following options are specific to the Journaled File System (JFS):-o ag={ 8 | 16 | 32 | 64 } Specifies the allocation group size in megabytes. An allocation group is a

grouping of inodes and disk blocks similar to BSD cylinder groups. The default ag value is 8.

-o bf={ true | false } Specifies a large file enabled file system. See JFS and large files for more information. If you do not need a large file enabled file system, set this option to false; this is the default. Specifying bf=true requires a fragment size of 4096 and compress=no.

-o frag={ 512 | 1024 | 2048 | 4096 }

Specifies the JFS fragment size in bytes. A file system fragment is the smallest unit of disk storage that can be allocated to a file. The default fragment size is 4096 bytes.

-o compress={ no | LZ } Specifies data compression. If you do not want data to be compressed, set this option to no. Selecting compression requires a fragment size of 2048 or less.

-o nbpi={ 512 | 1024 | 2048 | 4096 |8192 | 16384 | 32768 | 65536 | 131072 }

Specifies the number of bytes per i-node (nbpi). The nbpi is the ratio of file system size in bytes to the total number of i-nodes. The default nbpi value is 4096 bytes. The values 32768, 65536, and 131072 only apply to AIX 4.2 or later.

Notes:

File systems created with an ag value greater than 8 is not recognized on an AIX 4.1 system.

The ag, bf, compress, frag, and nbpi attributes are set at file system creation and cannot be changed after the file system is successfully created. The size attribute defines the minimum file system size, and you cannot decrease it after the file system is created.

The root filesystem ( / ) cannot be compressed.

Some nbpi values and allocation group sizes are mutually exclusive. See "Understanding JFS Size Limitations" for information.

The following options are specific to the Enhanced Journaled File System (JFS2):-o agblksize={ 512 | 1024 | 2048 | 4096 }

Specifies the JFS2 block size in bytes. A file system block is the smallest unit of disk storage that can be allocated to a file. The default block size is 4096 bytes.

-o name=mountpoint Specifies the mount point for the file system.-o log=LVName Specifies the log logical volume name. The specified logical volume is the

logging device for the new JFS2.-o log=INLINE Specifies to place the log in the logical volume with

the JFS2 file system. The INLINE log will default to .4% of the logical volume size if logsize is not specified.

-o logsize=Value Specifies the size for an INLINE log in MBytes. Ignored if INLINE log not being used. Cannot be greater than 2047 MBytes and cannot be greater than 10% of the size of the filesystem.

-o ea={v1 | v2} Specifies the format to be used to store named extended attributes in the JFS2 file system. The v2 format provides support for scalable named extended attributes as well as support for NFS4 ACLs. The v1 format is compatible with prior releases of AIX. The default format is v1.

Note:

Page 75: AIX Commands1

The agblksize attribute is set at file system creation and cannot be changed after the file system is successfully created. The size attribute defines the minimum file system size, and you cannot decrease it after the file system is created. The ea attribute format is set at file system creation. The chfs command can be used to convert the extended attribute format from v1 to v2, but the format cannot be converted back. The conversion is done in an on-demand manner such that any extended attribute or ACL writes cause the conversion for that file object to occur.-p Prototype Specifies the name of the prototype file. Options specified on the command line

override attributes in the prototype file.-s Size Specifies the size of the file system. Size can be specified in units of 512-byte

blocks, Megabytes (suffix M should be used) or Gigabytes (suffix G should be used). See JFS and JFS2 for more information.

Notes:

The volume group in which the file system resides defines a maximum logical volume size and also limits the file system size.

The -s Size flag specifies the minimum file size and cannot be decreased after the file system has been successfully created.

-v VolumeLabel Specifies the volume label for the new file system.-V VfsName Specifies the virtual file system (VFS) type. The VFS must have an entry in the

/etc/vfs file.

SecurityAccess Control: Only the root user or a member of the system group can run this command.

Examples To specify the volume and file system name for a new file system, type:

mkfs -lworks -vvol001 /dev/hd3This command creates an empty file system on the /dev/hd3 device, giving it the volume serial number vol001 and file system name works. The new file system occupies the entire device. The file system has a default fragment size (4096 bytes) and a default nbpi ratio (4096).

To create a file system with nondefault attributes, type:

mkfs -s 8192 -o nbpi=2048,frag=512 /dev/lv01This command creates an empty 4 MB file system on the /dev/lv01 device with 512-byte fragments and 1 i-node for each 2048 bytes.

To create a large file enabled file system, type:

mkfs -V jfs -o nbpi=131072,bf=true,ag=64 /dev/lv01This creates a large file enabled JFS file system with an allocation group size of 64 megabytes and 1 inode for every 131072 bytes of disk. The size of the file system will be the size of the logical volume lv01.

To create a file system with nondefault attributes, type:

mkfs -s 4M -o nbpi=2048, frag=512 /dev/lv01This command creates an empty 4 MB file system on the /dev/lv01 device with 512-byte fragments and one i-node for each 2048 bytes.

To create a JFS2 file system which can support NFS4 ACLs, type:

mkfs -V jfs2 -o ea=v2 /dev/lv01This command creates an empty file system on the /dev/lv01 device with v2 format for extended attributes.

Page 76: AIX Commands1

Files/etc/vfs Contains descriptions of virtual file system types./etc/filesystems Lists the known file systems and defines their characteristics.

Related InformationThe fsck command, mkproto command, proto command.The ioctl subroutine.The dir file, filesystems file, filsys.h file.File systems in Operating system and device management.Understanding JFS Size Limitations in Operating system and device management.

JFS and JFS2The journaled file system (JFS) and the enhanced journaled file system (JFS2) are built into the base operating system. Both file system types link their file and directory data to the structure used by the AIX® Logical Volume Manager for storage and retrieval. A difference is that JFS2 is designed to accommodate a 64-bit kernel and larger files.The following sections describe these file systems. Unless otherwise noted, the following sections apply equally to JFS and JFS2.

JFS and JFS2 functions Enhanced Journaled File System (JFS2) is a file system, introduced in AIX 5.1, that provides the capability to store much larger files than the existing Journaled File System (JFS).

JFS and JFS2 disk space segmentation Many UNIX® file systems only allocate contiguous disk space in units equal in size to the logical blocks used for the logical division of files and directories. These allocation units are typically referred to as disk blocks and a single disk block is used exclusively to store the data contained within a single logical block of a file or directory.

Variable number of i-nodes Segmenting disk space at sizes smaller than 4096 bytes optimizes disk space utilization, but it increases the number of small files and directories that can be stored within a file system.

JFS and JFS2 size limitations You define the maximum size for a JFS when you create the file system. The decision of what size to define for a JFS is based on several significant issues.

Sparse files A file is a sequence of indexed blocks. Blocks are mapped from the i-node to the logical offset of the file they represent.

JFS and large files You can create large files with the JFS file system type.

JFS data compression JFS supports fragmented and compressed file systems, which save disk space by allowing a logical block to be stored on the disk in units or "fragments" smaller than the full block size of 4096 bytes.

JFS online backups and JFS2 snapshots You can make an point-in-time image of a JFS file system or of a JFS2 file system (AIX 5.2 and later), which you can then use for backup purposes. There are differences, however, in the requirements and behavior of this image for each file system type.

Page 77: AIX Commands1

Compatibility and migration JFS file systems are fully compatible within AIX 5.1 and AIX 5.2. Previous supported versions of the operating system are compatible with the current JFS, although file systems with a nondefault fragment size, NBPI value, or allocation group size might require special attention if migrated to a previous version.

Parent topic: File system types

Variable number of i-nodesSegmenting disk space at sizes smaller than 4096 bytes optimizes disk space utilization, but it increases the number of small files and directories that can be stored within a file system.However, disk space is only one of the file system resources required by files and directories: each file or directory also requires a disk i-node.

JFS and i-nodes JFS allows you to specify the number of disk i-nodes created within a file system in case more or fewer than the default number of disk i-nodes is desired.

JFS2 and i-nodes JFS2 allocates i-nodes as needed.

JFS and i-nodesJFS allows you to specify the number of disk i-nodes created within a file system in case more or fewer than the default number of disk i-nodes is desired. The number of disk i-nodes at file system creation is specified in a value called as the number of bytes per i-node or NBPI. For example, an NBPI value of 1024 causes a disk i-node to be created for every 1024 bytes of file system disk space. Another way to look at this is that a small NBPI value (512 for instance) results in a large number of i-nodes, while a large NBPI value (such as 16,384) results in a small number of i-nodes.For JFS file systems, one i-node is created for every NBPI bytes of allocation group space allocated to the file system. The total number of i-nodes in a file system limits the total number of files and the total size of the file system. An allocation group can be partially allocated, though the full number of i-nodes per allocation group is still allocated. NBPI is inversely proportional to the total number of i-nodes in a file system. The JFS restricts all file systems to 16M (224) i-nodes.The set of allowable NBPI values vary according to the allocation group size (agsize). The default is 8 MB. The allowable NBPI values are 512, 1024, 2048, 4096, 8192, and 16,384 with an agsize of 8 MB. A larger agsize can be used. The allowable values for agsize are 8, 16, 32, and 64. The range of allowable NBPI values scales up as agsize increases. If the agsize is doubled to 16 MB, the range of NBPI values also double: 1024, 2048, 4096, 8193, 16384, and 32768.Fragment size and the NBPI value are specified during the file system's creation with Web-based System Manager, the System Management Interface Tool (SMIT), or the crfs and mkfs commands. The decision of fragment size and how many i-nodes to create for the file system is based on the projected number and size of files contained by the file system.

Page 78: AIX Commands1

You can identify fragment size and NBPI value using the Web-based System Manager, the System Management Interface Tool (SMIT), or the lsfs command. For application programs, use the statfs subroutine to identify the file system fragment size.Parent topic: Variable number of i-nodes

chfs CommandPurposeChanges attributes of a file system.

Syntaxchfs [ -n NodeName ] [ -m NewMountPoint ] [ -u MountGroup ] [ -A { yes | no } ] [ -p { ro | rw } ] [ -t { yes | no } ] [ -a Attribute=Value ] [ -d Attribute ] FileSystem

DescriptionThe chfs command changes the attributes of a file system. The new mount point, automatic mounts, permissions, and file system size can be set or changed. The FileSystem parameter specifies the name of the file system, expressed as a mount point.Some file system attributes are set at the time the file system is created and cannot be changed. For the Journaled File System (JFS), such attributes include the fragment size, block size, number of bytes per i-node, compression, and the minimum file system size. For the Enhanced Journaled File System (JFS2), the block size cannot be changed.You can use the File Systems application in Web-based System Manager to change file system characteristics. You could also use the System Management Interface Tool (SMIT) smit chfs fast path to run this command.Note:For information about changing a filesystem on a striped logical volume, refer to File Systems on Striped Logical Volumes in the chlv documentation.

Flags-A Specifies the attributes for auto-mount.

yesFile system is automatically mounted at system restart.

noFile system is not mounted at system restart.

-d Attribute Deletes the specified attribute from the /etc/filesystems file for the specified file system.-m NewMountPoint Specifies a new mount point for the specified file system.-n NodeName Specifies a node name for the specified file system. The node name attribute in the

/etc/filesystems file is updated with the new name. The node name attribute is specific to certain remote virtual file system types, such as the NFS (Network File System) virtual file system type.

-p Sets the permissions for the file system. ro

Specifies read-only permissions. rw

Specifies read-write permissions. -t Sets the accounting attribute for the specified file system.

yesFile system accounting is to be processed by the accounting subsystem.

Page 79: AIX Commands1

noFile system accounting is not to be processed by the accounting subsystem; this is the default.

-u MountGroup Specifies the mount group. Mount groups are used to group related mounts, so that they can be mounted as one instead of mounting each individually. For example, when performing certain tests, if several scratch file systems always need to be mounted together, they can each be placed in the test mount group. They can then all be mounted with a single command, such as the mount -t test command.

-a Attribute=Value Specifies the Attribute=Value pairs dependent on virtual file system type. To specify more than one Attribute=Value pair, provide multiple -a Attribute=Value parameters.

The following attribute/value pairs are specific to the Journaled File System (JFS):-a size=NewSize

Specifies the size of the Journaled File System. Size can be specified in units of 512-byte blocks, Megabytes or Gigabytes. If Value has the M suffix, it is interpreted to be in Megabytes. If Value has a G suffix, it is interpreted to be in Gigabytes. If Value begins with a +, it is interpreted as a request to increase the file system size by the specified amount. If the specified size is not evenly divisible by the physical partition size, it is rounded up to the closest number that is evenly divisible. The volume group in which the file system resides defines a maximum logical volume size and also limits the file system size.The maximum size of a JFS file system is a function of its fragment size and the nbpi value. These values yield the following size restrictions: NBPI Minimum AG Size Fragment Size Maximum Size (GB) 512 8 512, 1024, 2048, 4096 8 1024 8 512, 1024, 2048, 4096 16 2048 8 512, 1024, 2048, 4096 32 4096 8 512, 1024, 2048, 4096 64 8192 8 512, 1024, 2048, 4096 128 16384 8 1024, 2048, 4096 256 32768 16 2048, 4096 512 65536 32 4096 1024131072 64 4096 1024

-a log=LVNameSpecifies the full path name of the filesystem logging logical volume name of the existing log to be used. The log device for this filesystem must reside on the same volume group as the filesystem.

-a splitcopy=NewMountPointNameSplits off a mirrored copy of the file system and mounts it read-only at the new mount point. This provides a copy of the file system with consistent JFS meta-data that can be used for backup purposes. User data integrity is not guaranteed, so it is recommended that file system activity be minimal while this action is taking place. Only one copy may be designated as an online split mirror copy.

-a copy=Copy#Specifies which mirror copy to split off when used in conjunction with the splitcopy attribute. The default copy is the second copy. Valid values are 1, 2, or 3.

The following attribute/value pairs are specific to the Enhanced Journaled File System (JFS2):-a size=NewSize

Specifies the size of the Enhanced Journaled File System in 512-byte blocks, Megabytes or Gigabytes. If Value has the M suffix, it is interpreted to be in Megabytes. If Value has a G suffix, it is interpreted to be in Gigabytes. If Value begins with a +, it is interpreted as a request to increase the file system size by the specified amount. If Value begins with a -, it is interpreted as a request to reduce the file system size by the specified amount.

Page 80: AIX Commands1

If the specified size does not begin with a + or -, but it is greater or smaller than the file system current size, it is also a request to increate or reduce the file system size.If the filesystem has an inLinelog, the inLinelog size remains unchanged if this file system's new size is as same as the current file system size. If the specified size is not evenly divisible by the physical partition size, it is rounded up to the closest number that is evenly divisible.This attribute is required when creating a JFS2 file system unless the -d flag has been specified. The volume group in which the file system resides defines a maximum logical volume size and limits the file system size. The maximum size is determined by the file system block size:fs block size (byte) MAX fssize (TB)===========================================512 41024 82048 164096 32When a request to reduce the file system size is successful, the logical volume should be equal to or smaller than the original LV size depending on the requested filesystem size.Both size and logsize attributes can be specified in one chfs request to resize the filesystem and its inLinelog sizes.Notes:

JFS2 does not have nbpi or fragment size values to affect the resulting size of the file system.

You cannot shrink a filesystem if the requested size is less that a physical partition size. At least one physical partition size is asked to be reduced.

Shrinking a file system that has snapshots is not allowed.

During a shrink of the file system, writes to the file system are blocked.

During the period that the shrink or extend is running, the file system is not accessible. Large file systems with inline logs might not be usable for as long as several minutes. The inline log must be completely reformatted.

When the new file system size is specified, but its inLinelog size is NOT specified, the new logsize will be adjusted (extended/shrunk) proportionally, based on the specified extended/shrunk file system size. The log size increase or reduction should not be more than 40% of the file system size increase or reduction.

When a new file system size is not specified and there is an inLinelog, if a new logsize is specified, the file system size might be changed to include the new log size.

The freed space reported by the df command is not necessary the space that can be truncated by a shrinkFS request due to filesystem fragmentation. A fragmented filesystem may not be shrunk if it does not have enough free space for an object to be moved out of the region to be truncated, and shrinkFS does not perform filesystem defragmentation. In this case, the chfs command should fail with the returned code 28 (ENOSPC).

-a [ log | logname ]=LVNameSpecifies the full path name of the filesystem logging logical volume name of the existing log to be used. The log device for this

Page 81: AIX Commands1

filesystem must reside on the same volume group as the filesystem. Keyword INLINE can be used to specify that the log is in the logical volume with the JFS2 file system. The file system must have been created with an INLINE log to use this option. This option updates the /etc/filesystems file so that if the name of the logical volume containing the file system changes the log will be recognized.Note:For a file system using OUTLINE log, this option can be used to change the outline log from one logical volume to another logical volume as long as the logical volume is properly formatted and the type of the logical volume is jfs2log. If a file systems is mounted at the time chfs is called to change the outline log, the /etc/filesystems will show the change, but the actual log will not be changed until the next mount for the file system (which follows a umount operation or a system crash and recovery). For a file system using INLINE log, this option does not support switching logs between INLINE and OUTLINE log. Currently, to switch from inlinelog to outlinelog (or vise versa), the file system has to be removed and recreated. In release AIX 5L(TM) and AIX 5.1, if the file system is using inlinelog, the log entry is the same as the file system in /etc/filesystems: EX: /j2.1: dev = /dev/fslv00 vfs = jfs2 log = /dev/fslv00 mount = false account = falseBut, from AIX 5.2 and later releases, if the file system is using inlinelog, the log entry is the keyword INLINE in /etc/filesystems: EX: /j2.23: dev = /dev/fslv04 vfs = jfs2 log = INLINE mount = false options = rw account = falseIf the file system was created at AIX 5L or AIX 5.1, and later upgraded to AIX 5.2 or later releases, then chfs can be used to alter the inlinelog name in /etc/filesystems.

-a logsize=LogSizeSpecifies the size for an INLINE log in MBytes. The input size must be a positive value. If the inline log size is greater than or equal to 1, the input size must be an integer. If the input is floating point value of less than 1 and greater than or equal to 0, the input size is ignored and the default inline log size is taken. If value begins with a + (plus sign), it is interpreted as a request to increase the INLINE log size by the specified amount. If value begins with a - (minus sign), it is interpreted as a request to reduce the INLINE log size by the specified amount. The input is ignored if an INLINE log not being used. The INLINE log size cannot be greater than 10% of the size of the file system and it cannot be greater than 2047 MBytes.

-a ea=v2Converts the JFS2 file system extended attribute (ea) format. A JFS2 file system using the v1 format can be converted to one using v2 format. After it is converted the file system cannot be converted back to v1. The conversion is done in an on-demand manner such that any extended attribute or ACL writes cause the conversion for that file object to occur. The v2 format provides support for scalable named extended attributes as well as support for NFS4 ACLs. The v1 format is compatible with prior releases of AIX(R).

-a freeze={ timeout | 0 | off}Specifies that the file system must be frozen or thawed, depending on the value of timeout. The act of freezing a file system produces a nearly consistent on-disk image of the file system, and writes all dirty file system metadata and user data to the disk. In its frozen state, the file system is read-only,

Page 82: AIX Commands1

and anything that attempts to modify the file system or its contents must wait for the freeze to end. The value of timeout must be either 0, off, or a positive number. If a positive number is specified, the file system is frozen for a maximum of timeout seconds. If timeout is 0 or off, the file system will be thawed, and modifications can proceed.

-a refreeze={timeout}Specifies that the timeout for a frozen file system be reset. The timeout is reset to the value specified. The file system must still be frozen (using the -a freeze option or the fscntl interface).

-a vix={yes|no}Specifies whether the file system can allocate inode extents smaller than the default of 16K if there are no contiguous 16K extents free in the file system. After a file system is enabled for small free extents, it cannot be accessed on earlier versions of AIX and the marking cannot be removed. yesFile system can allocate variable length inode extents. noFile system must use default size of 16 KB for inode extents. This has no effect if the file system already contains variable length inode extents.

SecurityAccess Control: Only the root user or a member of the system group can run this command.

Examples To change the file system size of the /test Journaled File System, enter:

chfs -a size=24576 /testThis command changes the size of the /test Journaled File System to 24576 512-byte blocks, or 12MB (provided it was previously no larger than this).

To increase the size of the /test Journaled File System, enter:

chfs -a size=+8192 /testThis command increases the size of the /test Journaled File System by 8192 512-byte blocks, or 4 MB.

To convert a JFS2 file system to a version which can support NFS4 ACLs, type:

chfs -a ea=v2 /test

To change the mount point of a file system, enter:

chfs -m /test2 /testThis command changes the mount point of a file system from /test to /test2.

To delete the accounting attribute from a file system, enter:

chfs -d account /homeThis command removes the accounting attribute from the /home file system. The accounting attribute is deleted from the /home: stanza of the /etc/filesystems file.

To split off a copy of a mirrored file system and mount it read-only for use as an online backup, enter:

chfs -a splitcopy=/backup -a copy=2 /testfsThis mount a read-only copy of /testfs at /backup.

To change the file system size of the /test Journaled File System, enter:

chfs -a size=64M /testThis command changes the size of the /test Journaled File System to 64MB (provided it was previously no larger than this).

Page 83: AIX Commands1

To reduce the size of the /test JFS2 file system, enter:

chfs -a size=-16M /testThis command reduces the size of the /test JFS2 file system by 16MB.

To freeze a file system, enter:

chfs -a freeze=60 /adlThis command freezes the /adl file system for a maximum of 60 seconds.

To thaw a file system, enter:

chfs -a freeze=off /zmlThis command thaws the /zml file system.

File/etc/filesystems Lists the known file systems and defines their characteristics.

Related InformationThe crfs command, mkfs command, mklv command.The System accounting in Operating system and device management explains the file system accounting subsystem.The File systems in Operating system and device management explains file system types, management, structure, and maintenance.For information on installing the Web-based System Manager, see Chapter 2: Installation and System Requirements in AIX 5L Version 5.3 Web-based System Manager Administration Guide.

System User's Guide: Operating System and Devices

Related InformationCommands OverviewProcesses OverviewInput and Output Redirection OverviewFile Systems OverviewDirectory OverviewFiles OverviewLinking Files and DirectoriesBackup Files and Storage MediaFile and System Security

Directory OverviewA directory is a unique type of file that contains only the information needed to access files or other directories. As a result, a directory occupies less space than other types of files. It also gives the file system structure flexibility and depth. Directories enable you to group files and other directories, allowing you to organize the file system into a modular hierarchy. Unlike other types of files, a special set of commands control directories. Directories contain directory entries. Each entry contains a file or subdirectory name and an index node reference number (i-node number). To increase speed and enhance use of disk space, the data in a file is stored at various locations in the computer's memory. The i-node contains the addresses used to locate all the scattered blocks of

Page 84: AIX Commands1

data associated with a file. The i-node also records other information about the file including time of modification and access, access modes, number of links, file owner, and file type. It is possible to link several

names for a file to the same i-node by creating directory entries with the ln command.

File Ownership and User GroupsInitially, a file's owner is identified by the user ID of the person who created the file. The owner of a file determines who may read, write (modify), or execute the file. Ownership can be changed with the chown command.Every user ID is assigned to a group with a unique group ID. The system manager creates the groups of users when setting up the system. When a new file is created, the operating system assigns permissions to the user ID that created it, to the group ID containing the file owner, and to a group called others, consisting of all other users. The id command shows your user ID (UID), group ID (GID), and the names of all groups you belong to. In file listings (such as the listings shown by the li or ls command), the three groups of users are always represented in the following order: user, group, and others. If you need to find out your group name, the groups command shows all the groups for a user ID.

Changing File or Directory Ownership (chown Command) You can change the owner of your files with the chown command.When the -R option is specified, the chown command recursively descends through the directory structure from the specified directory. When symbolic links are encountered, the ownership of the file or directory pointed to by the link is changed; the ownership of the symbolic link is not changed.

Note: Only the root user can change the owner of another file. No errors are reported when the -f option is specified.

For example, to change the owner of the file program.c, enter:chown jim program.cThe user access permissions for program.c now apply to jim. As the owner, jim can use the chmod command to permit or deny other users access to program.c.For example, to change the owner and group of all files in the directory /tmp/src to owner john and group build, enter:chown -R john:build /tmp/srcSee the chown command in the AIX Version 4.3 Commands Reference for the exact syntax.

File and Directory Access Modes Every file has an owner. For new files, the user who creates the file is the owner of that file. The owner assigns an access mode to the file. Access modes grant other system users permission to read, modify, or execute the file. Only the file's owner or users with root authority can change the access mode of a file.There are the three classes of users: user/owner, group, and all others. Access is granted to these groups in some combination of three modes: read, write, or execute. When a new file is created, the default permissions are read, write, and execute permission for the user who created the file. The other two groups have read and execute permission. The following

Page 85: AIX Commands1

table illustrates the default file access modes for the three sets of user groups: Classes Read Write ExecuteOwner Yes Yes YesGroup Yes No YesOthers Yes No YesFiles can be read (r), written (w), or executed (x). The system determines who has permission and the level of permission they have for each of these activities. Access modes are represented two ways in the operating system: symbolically and numerically.

Symbolic Representation of Access Modes Access modes are represented symbolically, as follows:r Indicates read permission, which allows users to view the contents of a file.w Indicates write permission, which allows users to modify the contents of a file.x Indicates execute permission. For executable files (ordinary files that contain programs), execute

permission means that the program can be run. For directories, execute permission means the contents of the directory can be searched.

For example, a file with the access modes set to rwxr-xr-x gives read and execute permission to all three groups, but write permission only to the owner of the file. This is the symbolic representation of the default setting. The ls command, when used with the -l (lower case L) flag, gives a detailed listing of the current directory. The first 10 characters in the ls -l listing show the file type and permissions for each of the three groups. The ls -l command also tells you the owner and group associated with each file and directory.The first character indicates the type of file. The remaining nine characters contain the file permission information for each of the three classes of users. The following symbols are used to represent the type of file:- Regular filesd Directoryb Block special filesc Character special filesp Pipe special filesl Symbolic linkss Sockets.For example, this is a sample ls -l listing:-rwxrwxr-x   2   janet   acct   512 Mar 01 13:33 januaryHere, the first - (dash) indicates a regular file. Characters 2 through 4, rwx, represent the user's access mode (read, write, and execute). Characters 5 through 7, rwx, indicate the group's access modes (read, write, and execute). Characters 8 through 10, r-x, indicate read and execute access for all other users. Dashes within the last 9 characters indicate no permission is given.janet is the file owner and acct is the name of Janet's group. 512 is the file size in bytes, Mar 01 13:33 is the last date and time of modification, and january is the file name. The 2 indicates how many links exist to the file.

Numeric Representation of Access Modes Numerically, read access is represented by a value of 4, write permission is represented by a value of 2, and execute permission is represented by a value of 1. The total value between 1 and 7 represents the access mode for

Page 86: AIX Commands1

each group (user, group, and other). The following table illustrates how to determine the numerical values for each level of access:Total Value Read Write Execute0 - - -1 - - 12 - 2 -3 - 2 14 4 - -5 4 - 16 4 2 -7 4 2 1When a file is created, the default file access mode is 755. This means the user has read, write, and execute permissions (4+2+1=7), the group has read and execute permission (4+1=5), and all others have read and execute permission (4+1=5). Access permission modes can be changed for files you own by running the chmod (change mode) command.

Displaying Group Information (lsgroup Command) You can display the attributes of all the groups on the system or of the groups specified with the lsgroup command. If one or more attributes cannot be read, the lsgroup command lists as much information as possible. The attribute information displays as Attribute=Value definitions, each separated by a blank space.For example, to list all of the groups on the system, enter:lsgroup ALLThe system displays each group, group ID, and all of the users in the group in a list similar to the following:system 0 arne,pubs,ctw,geo,root,chucka,noer,su,dea,backup,build,janice,denisestaff 1 john,ryan,flynn,daveb,jzitt,glover,maple,kengordon,mbradybin 2 root,binsys 3 root,su,bin,sysTo display specific attributes for all groups, you can use one of two styles for listing specific attributes for all groups:

You can list attributes in the form Attribute=Value separated by a blank space. This is the default style. For example, to list the ID and users for all of the groups on the system, enter:

lsgroup -a id users ALL | pgA list similar to the following displays: system id=0users=arne,pubs,ctw,geo,root,chucka,noer,su,dea,backup,buildstaff id=1 users=john,ryan,flynn,daveb,jzitt,glover,maple,ken

You can also list the information in stanza format. For example, to list the ID and users for all of the groups on the system in stanza format, enter:

lsgroup -a -f id users ALL | pgA list similar to the following displays: system:   id=0   users=pubs,ctw,geo,root,chucka,noer,su,dea,backup,build staff:   id=1   users=john,ryan,flynn,daveb,jzitt,glover,maple,ken

Page 87: AIX Commands1

bin:   id=2   users=root,bin sys:   id=3   users=root,su,bin,sys

To display all attributes for a specific group, you can use one of two styles for listing specific attributes for all groups::

You can list each attribute in the form Attribute=Value separated by a blank space. This is the default style. For example, to list all attributes for the group system, enter:

lsgroup systemA list similar to the following displays: system id=0 users=arne,pubs,ctw,geo,root,chucka,noer,su,dea,backup,build,janice,denise

You can also list the information in stanza format. For example, to list all attributes for the group bin in stanza format, enter:

lsgroup -f systemA list similar to the following displays: system:   id=0   users=arne,pubs,ctw,geo,root,chucka,noer,su,dea,backup,build,janice,denise

To list specific attributes for a specific group, enter:lsgroup -a Attributes GroupFor example, to list the ID and users for group bin, enter:lsgroup -a id users binA list similar to the following displays:bin id=2 users=root,bin See the lsgroup command in the AIX Version 4.3 Commands Reference for the exact syntax.

Changing File or Directory Permissions (chmod Command) You can modify the read, write, and execute permissions of specified files and modify the search permission codes of specified directories with the chmod command.For example, to add a type of permission to files chap1 and chap2, enter:chmod g+w chap1 chap2This adds write permission for group members to the files chap1 and chap2.For example, to make several permission changes at once to the mydir directory, enter:chmod go-w+x mydirThis denies (-) group members (g) and others (o) the permission to create or delete files (w) in mydir and allows (+) group members and others to search mydir or use (x) it in a path name. This is equivalent to the command sequence:chmod g-w mydirchmod o-w mydirchmod g+x mydirchmod o+x mydir

Page 88: AIX Commands1

For example, to permit only the owner to use a shell procedure named cmd as a command, enter:chmod u=rwx,go= cmdThis gives read, write, and execute permission to the user who owns the file (u=rwx). It also denies the group and others the permission to access cmd in any way (go=).For example, to use the numeric mode form of the chmod command to change the permissions of the file text, enter:chmod 644 textThis sets read and write permission for the owner, and it sets read-only mode for the group and others.See the chmod command in the AIX Version 4.3 Commands Reference for more information and the exact syntax.

chmod CommandPurposeChanges file modes.

SyntaxTo Change File Modes Symbolicallychmod [ -R ] [ -h ] [ -f ] [ [ u ] [ g ] [ o ] | [ a ] ] { { - | + | = } [ r ] [ w ] [ x ] [ X ] [ s ] [ t ] } { File ... | Directory ... }

To Change File Modes Numericallychmod [ -R ] [ -h ] [ -f ] PermissionCode { File ... | Directory ... }

DescriptionThe chmod command modifies the mode bits and the extended access control lists (ACLs) of the specified files or directories. The mode can be defined symbolically or numerically (absolute mode).When a symbolic link is encountered and you have not specified the -h flag, the chmod command changes the mode of the file or directory pointed to by the link and not the mode of the link itself. If you specify the -h flag, the chmod command prevents this mode change.If you specify both the -h flag and the -R flag, the chmod command descends the specified directories recursively, and when a symbolic link is encountered, the mode of the file or directory pointed to by the link is not changed.

Flags-f Suppresses all error reporting except invalid permissions and usage statements.-h Suppresses a mode change for the file or directory pointed to by the encountered symbolic link.

Note: This behavior is slightly different from the behavior of the -h flag on the chgrp and chown commands because mode bits cannot be set on symbolic links.

-R Descends only directories recursively, as specified by the pattern File...|Directory.... The -R flag changes the file mode bits of each directory and of all files matching the specified pattern. See Example 6. When a symbolic link is encountered and the link points to a directory, the file mode bits of that directory are changed but the directory is not further traversed.

Page 89: AIX Commands1

Symbolic ModeTo specify a mode in symbolic form, you must specify three sets of flags.

Note: Do not separate flags with spaces.

The first set of flags specifies who is granted or denied the specified permissions, as follows:u File owner.g Group and extended ACL entries pertaining to the file's group.o All others.a User, group, and all others. The a flag has the same effect as specifying the ugo flags together. If none

of these flags are specified, the default is the a flag and the file creation mask (umask) is applied.The second set of flags specifies whether the permissions are to be removed, applied, or set:- Removes specified permissions.+ Applies specified permissions.= Clears the selected permission field and sets it to the permission specified. If you do not specify a

permission following =, the chmod command removes all permissions from the selected field.The third set of flags specifies the permissions that are to be removed, applied, or set:r Read permission.w Write permission.x Execute permission for files; search permission for directories.X Execute permission for files if the current (unmodified) mode bits have at least one of the user, group,

or other execute bits set. The X flag is ignored if the File parameter is specified and none of the execute bits are set in the current mode bits.

Search permission for directories. s Set-user-ID-on-execution permission if the u flag is specified or implied. Set-group-ID-on-execution

permission if the g flag is specified or implied.t For directories, indicates that only file owners can link or unlink files in the specified directory. For

files, sets the save-text attribute.

Numeric or Absolute ModeThe chmod command also permits you to use octal notation for the mode. The numeric mode is the sum of one or more of the following values:4000 Sets user ID on execution.2000 Sets group ID on execution.1000 Sets the link permission to directories or sets the save-text attribute for

files.0400 Permits read by owner.0200 Permits write by owner.0100 Permits execute or search by owner.0040 Permits read by group.0020 Permits write by group.0010 Permits execute or search by group.0004 Permits read by others.0002 Permits write by others.0001 Permits execute or search by others.

Notes:

Specifying the mode numerically disables any extended ACLs. Refer to "Access Control Lists" in AIX Version 4.3 System User's Guide: Operating System and Devices for more information.

Changing group access permissions symbolically also affects the extended ACL entries. The group entries in the ACL that are equal to the owning group of the file are

Page 90: AIX Commands1

denied any permission that is removed from the mode. Refer to "Access Control Lists" for more information.

You can specify multiple symbolic modes separated with commas. Operations are performed in the order they appear from left to right.

You must specify the mode symbolically when removing the set-group-ID-on-execution permission from directories.

SecurityAccess Control: This program should be installed as a normal user program in the Trusted Computing Base.Only the owner of the file or the root user can change the mode of a file.

Exit StatusThis command returns the following exit values:0 The command executed successfully and all requested changes were

made.>0 An error occurred.

Examples To add a type of permission to several files:

chmod g+w chap1 chap2This adds write permission for group members to the files chap1 and chap2.

To make several permission changes at once:

chmod go-w+x mydirThis denies group members and others the permission to create or delete files in mydir (go-w) and allows group members and others to search mydir or use it in a path name (go+x). This is equivalent to the command sequence: chmod g-w mydirchmod o-w mydirchmod g+x mydirchmod o+x mydir

To permit only the owner to use a shell procedure as a command:

chmod u=rwx,go= cmdThis gives read, write, and execute permission to the user who owns the file (u=rwx). It also denies the group and others the permission to access cmd in any way (go=). If you have permission to execute the cmd shell command file, then you can run it by entering:cmd

Note: Depending on the PATH shell variable, you may need to specify the full path to the cmd file.

To use Set-ID Modes:

chmod ug+s cmdWhen the cmd command is executed, the effective user and group IDs are set to those that own the cmd file. Only the effective IDs associated with the child process that runs the cmd command are changed. The effective IDs of the shell session remain unchanged. This feature allows you to permit access to restricted files. Suppose that the cmd program has the Set-User-ID Mode enabled and is owned by a user called dbms. The user dbms is not actually a person, but might be associated with a database management system. The user betty does not have permission to access any of dbms's data

Page 91: AIX Commands1

files. However, she does have permission to execute the cmd command. When she does so, her effective user ID is temporarily changed to dbms, so that the cmd program can access the data files owned by the user dbms.This way the user betty can use the cmd command to access the data files, but she cannot accidentally damage them with the standard shell commands.

To use the absolute mode form of the chmod command:

chmod 644 textThis sets read and write permission for the owner, and it sets read-only mode for the group and others. This also removes all extended ACLs that might be associated with the file.

To recursively descend directories and change file and directory permissions given the tree structure:

./dir1/dir2/file1

./dir1/dir2/file2

./dir1/file1

enter this command sequence:chmod -R 777 f*which will change permissions on ./dir1/file1. But given the tree structure of:./dir1/fdir2/file1./dir1/fdir2/file2./dir1/file3the command sequence:chmod -R 777 f*will change permissions on: ./dir1/fdir2./dir1/fdir2/file1./dir1/fdir2/file2./dir1/file3

File/usr/bin/chmod Contains the chmod command .

Related InformationThe acledit command, aclget command, aclput command, chown command, chgrp command, ls command.The chmod subroutine, fchmod subroutine.File Ownership and User Groups in AIX Version 4.3 System User's Guide: Operating System and Devices introduces file ownership and permissions to access files and directories.Security Administration in AIX Version 4.3 System Management Concepts: Operating System and Devices describes system security.Trusted Computing Base Overview in AIX Version 4.3 System Management Guide: Operating System and Devices describes the part of the system that is responsible for enforcing system information security policies.

Page 92: AIX Commands1

Because directories often contain information that should not be available to all users of the system, directory access can be protected. By setting a directory's permissions, you can control who has access to the directory, also determining which users (if any) can alter information within the directory. See File and Directory Access Modes for more information.This section discusses:

Types of Directories

Directory Organization

Directory Naming Conventions

Directory Path Names

Directory Abbreviations

Directory Handling Procedures

Directory Handling ProceduresThere are a variety of ways to work with directories and their contents.The command and an example are presented for each of the following directory tasks:

Creating a Directory ( mkdir Command)

Moving or Renaming a Directory ( mvdir Command)

Displaying Your Current Directory ( pwd Command)

Changing to Another Directory ( cd Command)

Copying a Directory ( cp Command)

Displaying Contents of a Directory ( li and ls Commands)

Deleting or Removing a Directory ( rmdir Command)

Comparing Contents of Directories ( dircmp Command)

Creating a Directory (mkdir Command) The mkdir command creates one or more new directories specified by the Directory parameter. Each new directory contains the standard entries . (dot) and .. (dot dot). You can specify the permissions for the new directories with the -m Mode flag.When a new directory is created, it is created within the current, or working, directory unless you specify an absolute path name to another location in the file system.For example, to create a new directory called Test in the current working directory with default permissions, enter:mkdir TestFor example, to create a new directory called Test with rwxr-xr-x permissions in a previously created /home/demo/sub1 directory, enter:mkdir -m 755 /home/demo/sub1/TestFor example, to create a new directory called Test with default permissions in the /home/demo/sub2 directory, enter:

Page 93: AIX Commands1

mkdir -p /home/demo/sub2/TestThe -p flag creates the /home, /home/demo, and /home/demo/sub2 directories if they do not already exist.See the mkdir command in the AIX Version 4.3 Commands Reference for the exact syntax.

Moving or Renaming a Directory (mvdir Command) The mvdir command moves directories or renames a directory.For example, to move a directory, enter:mvdir book manualThis moves the book directory under the directory named manual, if manual exists. Otherwise, the book directory is renamed to manual.>For example, to move and rename a directory, enter:mvdir book3 proj4/manualThis moves book3 to the directory named proj4 and renames it manual (if manual did not previously exist).See the mvdir command in the AIX Version 4.3 Commands Reference for the exact syntax.

Displaying Your Current Directory (pwd Command) The pwd command writes to standard output the full path name of your current directory (from the /(root) directory). All directories are separated by a / (slash). The /(root) directory is represented by the first / (slash), and the last directory named is your current directory.For example, to display your current directory, enter:pwdThe full path name of your current directory is displayed similar to the following:/home/thomasSee the pwd command in the AIX Version 4.3 Commands Reference for the exact syntax.

Changing to Another Directory (cd Command) The cd command moves you from your present directory to another directory. You must have execute (search) permission in the specified directory.If you do not specify a Directory parameter, the cd command moves you to your login directory ($HOME in the ksh and bsh environments, or $home in the csh environment). If the specified directory name is a full path name, it becomes the current directory. A full path name begins with a / (slash) indicating the /(root) directory, a . (dot) indicating current directory, or a .. (dot dot) indicating parent directory. If the directory name is not a full path name, the cd command searches for it relative to one of the paths specified by the $CDPATH shell variable (or $cdpath csh variable). This variable has the same syntax as, and similar semantics to, the $PATH shell variable (or $path csh variable).For example, to change to your home directory, enter:cdFor example, to change to the /usr/include directory, enter:cd /usr/includeThis changes the current directory to /usr/include.

Page 94: AIX Commands1

For example, to go down one level of the directory tree to the sys directory, enter:cd sysIf the current directory is /usr/include and it contains a subdirectory named sys, then /usr/include/sys becomes the current directory.For example, to go up one level of the directory tree, enter:cd ..The special file name, .. (dot dot), refers to the directory immediately above the current directory, its parent directory.See the cd command in the AIX Version 4.3 Commands Reference for the exact syntax.

Copying a Directory (cp Command) The cp or copy command creates a copy of the contents of the file or directory specified by the SourceFile or SourceDirectory parameters into the file or directory specified by the TargetFile or TargetDirectory parameters. If the file specified as the TargetFile exists, the copy writes over the original contents of the file. If you are coping more than one SourceFile, the target must be a directory.To place a copy of the SourceFile into a directory, specify a path to an existing directory for the TargetDirectory parameter. Files maintain their respective names when copied to a directory unless you specify a new file name at the end of the path. The cp command also copies entire directories into other directories if you specify the -r or -R flags.For example, to copy all the files in a directory to a new directory, enter:cp /home/janet/clients/* /home/nick/customersThis copies only the files in the clients directory to the customers directory.For example, to copy a directory, including all its files and subdirectories, to another directory, enter:cp -R /home/nick/clients /home/nick/customersThis copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, under the customers directory.See the cp command in the AIX Version 4.3 Commands Reference for the exact syntax.

Displaying Contents of a Directory (li and ls Commands) You can display the contents of a directory by using either the li command or the ls command.

li command The li command lists information about each named File and the files in each named Directory. If File is an archived file and the -Rq flag is specified, the li command lists the files in the archive. If you do not specify a File or Directory, the li command displays the contents of the current directory.When the li command displays the contents of a directory, it does not show entries for files whose names begin with a . (dot) unless you use the -a flag.The li command lists file and directory names in alphabetical order. Control characters in file names are displayed in expanded form (for example, ^ D, \177).For example, to list the files and directories in the current directory, enter:

Page 95: AIX Commands1

liFor example, you can list the files and directories separated out by files, executable files, symbolic links, and directories. The executable files are surrounded by right and left angle brackets ( < >), symbolic links are surrounded by at signs (@), and directories are surrounded by brackets ([ ]). To see this listing, enter:li -vFor example, to list all files and directories in the current directory, including those with names beginning with a . (dot), enter:li -aFor example, to display detailed information, enter:li -l chap1 .profileThis displays an extended listing with detailed information about chap1 and the .profile file.For example, to display detailed information about a directory, enter:li -d -l . manual manual/chap1This displays a long listing for the . (dot) and manual directories, and for the manual/chap1 file.For example, to list the contents of each directory in a tree, enter:li -R manualThis lists the names in each subdirectory of the tree that starts with manual.See the li command in the AIX Version 4.3 Commands Reference for the exact syntax.

ls command The ls command writes to standard output the contents of each specified Directory or the name of each specified File, along with any other information you ask for with the flags. If you do not specify a File or Directory, the ls command displays the contents of the current directory.By default, the ls command displays all information in alphabetic order by file name. If the command is executed by a user with root authority, it uses the -A flag by default, listing all entries except . (dot) and .. (dot dot). To show all entries for files, including those that begin with a . (dot), use the ls -a command.There are three main ways to format the output:

List one entry per line using the -l flag.

List entries in multiple columns by specifying either the -C or -x flag. The -C flag is the default format when output is to a tty.

List entries in a comma-separated series by specifying the -m flag.

To determine the number of character positions in the output line, the ls command uses the $COLUMNS environment variable. If this variable is not set, the command reads the terminfo file. If the ls command cannot determine the number of character positions by either of these methods, it uses a default value of 80.The information displayed with the -e and -l flags is interpreted as follows:If the first character is:d Entry is a directory.b Entry is a block special file.

Page 96: AIX Commands1

c Entry is a character special file.l Entry is a symbolic link.p Entry is a first-in, first-out (FIFO) pipe special

file.s Entry is a local socket.- Entry is an ordinary file.The next nine characters are divided into three sets of three characters each. The first three characters show the owner's permission. The next set of three characters shows the permission of the other users in the group. The last set of three characters shows the permission of anyone else with access to the file. The three characters in each set show read, write, and execute permission of the file. Execute permission of a directory lets you search a directory for a specified file.Permissions are indicated as follows:r Read permission grantedt Only the directory owner or the file owner can delete or rename a file within that directory, even if

others have write permission to the directory.w Write (edit) permission grantedx Execute (search) permission granted- Corresponding permission not granted.The information displayed with the -e flag is the same as with the -l flag, except for the addition of an 11th character interpreted as follows:+ Indicates a file has extended security information. For example, the file may have extended ACL, TCB,

or TP attributes in the mode. - Indicates a file does not have extended security information.When the size of the files in a directory are listed, the ls command displays a total count of blocks, including indirect blocks.For example, to list all files in the current directory, enter:ls -aThis lists all files, including

. (dot)

.. (dot dot)

Other files whose names may or may not begin with a . (dot)

For example, to display detailed information, enter:ls -l chap1 .profileThis displays a long listing with detailed information about chap1 and .profile.For example, to display detailed information about a directory, enter:ls -d -l . manual manual/chap1This displays a long listing for the directories . and manual, and for the file manual/chap1. Without the -d flag, this would list the files in the . and manual directories instead of the detailed information about the directories themselves.See the ls command in the AIX Version 4.3 Commands Reference for the exact syntax.

Deleting or Removing a Directory (rmdir Command) The rmdir command removes the directory, specified by the Directory parameter, from the system. The directory must be empty (it can only contain . and ..) before you can remove it, and you must have write

Page 97: AIX Commands1

permission in its parent directory. Use the ls -a Directory command to check whether the directory is empty.For example, to empty and remove a directory, enter:rm mydir/* mydir/.* rmdir mydirThis removes the contents of mydir, then removes the empty directory. The rm command displays an error message about trying to remove the directories . (dot) and .. (dot dot), and then the rmdir command removes them and the directory itself. Note that rm mydir/* mydir/.* first removes files with names that do not begin with a dot, and then removes those with names that do begin with a dot. You may not realize that the directory contains file names that begin with a dot because the ls command does not normally list them unless you use the -a flag.For example, to remove the /tmp/jones/demo/mydir directory structure and all the directories beneath it, enter:cd /tmprmdir -p jones/demo/mydirThis removes the jones/demo/mydir directory from the /tmp directory. If a directory is not empty or you do not have write permission to it when it is to be removed, the command terminates with appropriate error messages.See the rmdir command in the AIX Version 4.3 Commands Reference for the exact syntax.

Comparing Contents of Directories (dircmp Command) The dircmp command compares the two directories specified by the Directory1 and Directory2 parameters and writes information about their contents to standard output. First, the dircmp command compares the file names in each directory. If the same file name appears in both, the dircmp command compares the contents of both files.In the output, the dircmp command lists the files unique to each directory. It then lists the files with identical names in both directories, but with different contents. If no flag is specified, it also lists files that have identical contents as well as identical names in both directories.For example, to summarize the differences between the files in the proj.ver1 and proj.ver2 directories, enter:dircmp proj.ver1 proj.ver2This displays a summary of the differences between the directories proj.ver1 and proj.ver2. The summary lists separately the files found only in one directory or the other, and those found in both. If a file is found in both directories, the dircmp command notes whether the two copies are identical.For example, to show the details of the differences between the files in the proj.ver1 and proj.ver2 directories, enter:dircmp -d -s proj.ver1 proj.ver2The -s flag suppresses information about identical files. The -d flag displays a diff listing for each of the differing files found in both directories.See the dircmp command in the AIX Version 4.3 Commands Reference for the exact syntax.

Page 98: AIX Commands1

Types of Directories Directories can be defined by the operating system, the system administrator, or users. The system-defined directories contain specific kinds of system files, such as commands. At the top of the file system hierarchy is the system-defined /(root) directory. The /(root) directory usually contains the following standard system-related directories:/dev Contains special files for I/O devices./etc Contains files for system initialization and system management./home Contains login directories for the system users./tmp Contains files that are temporary and can be deleted in a specified number of

days. /usr Contains the lpp, include, and other system directories./usr/bin Contains user executable programs.Some directories, such as your login or home directory ($HOME), are defined and customized by the system administrator. When you log in to the operating system, the login directory is the current directory.Directories that you create are called user-defined directories. These directories help you organize and maintain your files.

Directory Organization Directories contain files, subdirectories, or a combination of both. A subdirectory is a directory within a directory. The directory containing the subdirectory is the parent directory.For the operating system to track and find directories, each directory has an entry for the parent directory in which it was created, .. (dot dot), and an entry for the directory itself, . (dot). In most directory listings, these files are hidden.

Directory TreeStructures of parent directories, subdirectories, and files are called file systems. Directory structures are often compared to an inverted tree. The root directory, symbolized by a / (slash), is the base and pictured at the top of the directory tree. Subdirectories and files branch downward from the root directory. The file system structure of directories can easily become complex. Attempt to keep the file and directory structure as simple as possible. Also, create files and directories with easily recognizable names. This makes working with files easier.

Parent Directory Each directory, except for /(root), has one parent directory and may have one or more child directories. In the Example of Directory Structures illustration, C is parent to E, and C is child to /(root).

Home Directory When you log in, the system puts you in a directory called your home directory or login directory. This directory is set up by the system administrator for each user. Your home directory is where you keep your personal files. Normally, directories you create for your own use will be subdirectories of your home directory. To return to your home directory at any time, enter the cd command at the prompt.

Page 99: AIX Commands1

Working Directory You are always working within a directory. Whichever directory you are currently working in is called your current or working directory. The pwd (present working directory) command reports the name of your working directory. The cd command allows you to change working directories.

Directory Naming Conventions The name of each directory must be unique within the directory where it is stored. This ensures that the directory also has a unique path name in the file system. Directories follow the same naming conventions as files as explained in File Naming Conventions .

Directory Path Names Each file and directory can be reached by a unique path, known as the path name, through the file system tree structure. The path name specifies the location of a directory or file within the file system.

Note: Path names cannot exceed 1023 characters.

The file system uses two kinds of path names:absolute path names Traces the path from the /(root) directory. Absolute path names always begin with

the / (slash) symbol.relative path name Traces the path from the current directory through its parent or its subdirectories

and files.An absolute path name represents the complete name of a directory or file from the /(root) directory downward. Regardless of where you are working in the file system, you can always find a directory or file by specifying its absolute path name. Absolute path names start with a / (slash), the symbol representing the root directory. The path name /A/D/9 is the absolute path name for 9. The first / (slash) represents the /(root) directory, which is the starting place for the search. The remainder of the path name directs the search to A, then to D, and finally to 9. There are two files named 9. This is possible because the absolute path names to the files give each file a unique name within the file system. The path names /A/D/9 and /C/E/G/9 specify two unique files named 9.Unlike full path names, relative path names specify a directory or file based on the current working directory. For relative path names, you can use the notation .. (dot dot) to move upward in the file system hierarchy. The .. (dot dot) represents the parent directory. Because relative path names specify a path starting in the current directory, they do not begin with a / (slash). Relative path names are used to specify the name of a file in the current directory or the path name of a file or directory above or below the level of the current directory in the file system. If D is the current directory, the relative path name for accessing 10 is F/10, but the absolute path name is always /A/D/F/10. Also, the relative path name for accessing 3 is ../../B/3.You can also represent the name of the current directory by using the notation . (dot). The . (dot) notation is commonly used when running programs that read the current directory name.

Directory Abbreviations Abbreviations provide a quick and convenient way for specifying certain directories. The following is a list of abbreviations.

Page 100: AIX Commands1

Abbreviation Meaning. The current working directory... The directory above the current working directory (the parent

directory).~ Your home directory (this is not true for the Bourne shell).$HOME Your home directory (this is true for all shells).

Directory OverviewA directory is a unique type of file that contains only the information needed to access files or other directories. As a result, a directory occupies less space than other types of files. It also gives the file system structure flexibility and depth. Directories enable you to group files and other directories, allowing you to organize the file system into a modular hierarchy. Unlike other types of files, a special set of commands control directories. Directories contain directory entries. Each entry contains a file or subdirectory name and an index node reference number (i-node number). To increase speed and enhance use of disk space, the data in a file is stored at various locations in the computer's memory. The i-node contains the addresses used to locate all the scattered blocks of data associated with a file. The i-node also records other information about the file including time of modification and access, access modes, number of links, file owner, and file type. It is possible to link several names for a file to the same i-node by creating directory entries with the ln command. Because directories often contain information that should not be available to all users of the system, directory access can be protected. By setting a directory's permissions, you can control who has access to the directory, also determining which users (if any) can alter information within the directory. See File and Directory Access Modes for more information.This section discusses:

Types of Directories

Directory Organization

Directory Naming Conventions

Directory Path Names

Directory Abbreviations

Directory Handling Procedures

Types of Directories Directories can be defined by the operating system, the system administrator, or users. The system-defined directories contain specific kinds of system files, such as commands. At the top of the file system hierarchy is the system-defined /(root) directory. The /(root) directory usually contains the following standard system-related directories:/dev Contains special files for I/O devices./etc Contains files for system initialization and system management./home Contains login directories for the system users.

Page 101: AIX Commands1

/tmp Contains files that are temporary and can be deleted in a specified number of days.

/usr Contains the lpp, include, and other system directories./usr/bin Contains user executable programs.Some directories, such as your login or home directory ($HOME), are defined and customized by the system administrator. When you log in to the operating system, the login directory is the current directory.Directories that you create are called user-defined directories. These directories help you organize and maintain your files.

Directory Organization Directories contain files, subdirectories, or a combination of both. A subdirectory is a directory within a directory. The directory containing the subdirectory is the parent directory.For the operating system to track and find directories, each directory has an entry for the parent directory in which it was created, .. (dot dot), and an entry for the directory itself, . (dot). In most directory listings, these files are hidden.

Directory TreeStructures of parent directories, subdirectories, and files are called file systems. Directory structures are often compared to an inverted tree. The root directory, symbolized by a / (slash), is the base and pictured at the top of the directory tree. Subdirectories and files branch downward from the root directory. The file system structure of directories can easily become complex. Attempt to keep the file and directory structure as simple as possible. Also, create files and directories with easily recognizable names. This makes working with files easier.

Parent Directory Each directory, except for /(root), has one parent directory and may have one or more child directories. In the Example of Directory Structures illustration, C is parent to E, and C is child to /(root).

Home Directory When you log in, the system puts you in a directory called your home directory or login directory. This directory is set up by the system administrator for each user. Your home directory is where you keep your personal files. Normally, directories you create for your own use will be subdirectories of your home directory. To return to your home directory at any time, enter the cd command at the prompt.

Working Directory You are always working within a directory. Whichever directory you are currently working in is called your current or working directory. The pwd (present working directory) command reports the name of your working directory. The cd command allows you to change working directories.

Directory Naming Conventions The name of each directory must be unique within the directory where it is stored. This ensures that the directory also has a unique path name in the

Page 102: AIX Commands1

file system. Directories follow the same naming conventions as files as explained in File Naming Conventions .

Directory Path Names Each file and directory can be reached by a unique path, known as the path name, through the file system tree structure. The path name specifies the location of a directory or file within the file system.

Note: Path names cannot exceed 1023 characters.

The file system uses two kinds of path names:absolute path names Traces the path from the /(root) directory. Absolute path names always begin with

the / (slash) symbol.relative path name Traces the path from the current directory through its parent or its subdirectories

and files.An absolute path name represents the complete name of a directory or file from the /(root) directory downward. Regardless of where you are working in the file system, you can always find a directory or file by specifying its absolute path name. Absolute path names start with a / (slash), the symbol representing the root directory. The path name /A/D/9 is the absolute path name for 9. The first / (slash) represents the /(root) directory, which is the starting place for the search. The remainder of the path name directs the search to A, then to D, and finally to 9. There are two files named 9. This is possible because the absolute path names to the files give each file a unique name within the file system. The path names /A/D/9 and /C/E/G/9 specify two unique files named 9.Unlike full path names, relative path names specify a directory or file based on the current working directory. For relative path names, you can use the notation .. (dot dot) to move upward in the file system hierarchy. The .. (dot dot) represents the parent directory. Because relative path names specify a path starting in the current directory, they do not begin with a / (slash). Relative path names are used to specify the name of a file in the current directory or the path name of a file or directory above or below the level of the current directory in the file system. If D is the current directory, the relative path name for accessing 10 is F/10, but the absolute path name is always /A/D/F/10. Also, the relative path name for accessing 3 is ../../B/3.You can also represent the name of the current directory by using the notation . (dot). The . (dot) notation is commonly used when running programs that read the current directory name.

Directory Abbreviations Abbreviations provide a quick and convenient way for specifying certain directories. The following is a list of abbreviations.Abbreviation Meaning. The current working directory... The directory above the current working directory (the parent

directory).~ Your home directory (this is not true for the Bourne shell).$HOME Your home directory (this is true for all shells).

Page 103: AIX Commands1

Commands OverviewSome commands can be entered simply by typing one word. It is also possible to combine commands so that the output from one command becomes the input for another command. This is known as piping. Flags further define the actions of commands. A flag is a modifier used with the command name on the command line, usually preceded by a dash. Commands can also be grouped together and stored in a file. These are known as shell procedures or shell scripts. Instead of executing the commands individually, you execute the file that contains the commands.To enter a command, type in the command name at the prompt, and press Enter.$ CommandNameThis section discusses:

Command Syntax

Reading Syntax Diagrams

Reading Usage Statements

Using Web-based System Manager

Using the smit Command

Locating a Command or Program ( whereis Command)

Displaying the Function of a Command ( whatis Command)

Listing Previously Entered Commands ( history Command)

Repeating Commands Using the Command History

Substituting Strings Using the Command History

Editing the Command History

Creating a Command Alias ( alias Command)

Working with Text Formatting Commands

Command Syntax Although some commands can be entered by simply typing one word, other commands use flags and parameters. Each command has a syntax that designates the required and optional flags and parameters. The general format for a command is:CommandName flag(s) parameter(s)Some general rules about commands are:

Spaces between commands, flags, and parameters are important.

Two commands can be entered on the same line by separating the commands with a semicolon (;). For example:

$ CommandOne;CommandTwoThe shell runs the commands sequentially.

Commands are case sensitive. The shell distinguishes between uppercase and lowercase letters. To the shell, print is not the same as PRINT or Print.

Page 104: AIX Commands1

A very long command can be entered on more than one line by using the backslash (\) character. A backslash signifies line continuation to the shell. The following example is one command that spans two lines:

$ ls Mail info temp \ (press Enter) > diary

(the > prompt appears)The > character is your secondary prompt ($ is the non-root user's default primary prompt), indicating that the current line is the continuation of the previous line. Note that csh gives no secondary prompt, and the break must be at a word boundary, and its primary prompt is %.

To run a command, type the command name at the prompt, and press Enter.

Command Name The first word of every command is the command name. Some commands only have a command name.

Command Flags After the command name, there may be a number of flags. Flags are sometimes called options. A flag is set off by spaces or tabs and usually starts with a dash (-). Exceptions are ps, tar, and ar, which do not require a dash in front of some of the flags. Flags modify the operation of a command. For example, in the following command:ls -a -Fls is the command name and -a -F are the flags.When a command uses flags, they come directly after the command name. Single-character flags in a command can be combined with one dash. For example, the previous command can also be written as:ls -aFThere are some circumstances when a parameter actually begins with a dash (-). In this case, use the delimiter -- (dash dash) before the parameter. The -- tells the command that whatever follows is not a flag but a parameter.For example, if you wanted to create a directory named -tmp and you entered the following command:mkdir -tmpThe system would display an error message similar to the following:mkdir: Not a recognized flag: tUsage: mkdir [-p] [-m mode] Directory ...The correct way of entering the command is:mkdir -- -tmpYour new directory, -tmp, is now created.

Command Parameters After the command name, there may be a number of flags, followed by parameters. Parameters are sometimes called arguments or operands. Parameters specify information the command needs in order to run. If you don't specify a parameter, the command may assume a default value. For example, in the following command: ls -a temp

Page 105: AIX Commands1

ls is the command name, -a is the flag, and temp is the parameter. This command displays all (-a) the files in the directory temp. In the following example:ls -abecause no parameter is given, the default value is the current directory. In the following example:ls temp mailno flags are given, and temp and mail are parameters. In this case, temp and mail are two different directory names. The ls command will display all but the hidden files in each of these directories.Whenever a parameter or operand-argument is, or contains, a numeric value, the number is interpreted as a decimal integer, unless otherwise specified. Numerals in the range 0 to INT_MAX, as defined in /usr/include/sys/limits.h, are syntactically recognized as numeric values. If a command you want to use accepts negative numbers as parameters or option-arguments, you can use numerals in the range INT_MIN to INT_MAX, both as defined in /usr/include/sys/limits.h. This does not necessarily mean that all numbers within that range are semantically correct. Some commands have a built-in specification permitting a smaller range of numbers, for example, some of the print commands. If an error is generated, the error message lets you know the value is out of the supported range, not that the command is syntactically incorrect.

Reading Syntax Diagrams Syntax diagrams are designed to provide information about how to enter the command on the command line. A syntax diagram can tell you:

Which flags can be entered on the command line

Which flags must take a parameter (option-argument)

Which flags have optional parameters

What the default values of flags and parameters are, if any

Which flags can and cannot be entered together

Which flags and parameters are optional

When you can repeat flag and parameter sequences.

The commands use the following conventions in their syntax diagrams: Diagram items that must be entered literally on the command line are in bold. These items include the

command name, flags, and literal characters.

Diagram items representing variables that must be replaced by a name are in italics. These items include parameters that follow flags and parameters that the command reads, such as Files and Directories.

Default values that do not have to be entered are in the normal font on a thicker line.

0 Path Line The path line begins the syntax diagram.1 Command Name This item in the diagram is the name of the command you want to run. It is in

bold, which indicates that it must be entered exactly as it appears in the diagram.

In the example diagram, the path branches into two paths after the command name. You can follow either the lower path (discussed in item 2) or the upper path

Page 106: AIX Commands1

(discussed in item 3). 2 Single-Choice Box If you follow the lower path, you encounter a box with the words one of over it.

You can choose only one item from this box.3 Default Line If you follow the upper path, you bypass the single-choice box, and enter nothing.

The bold line around the box is a default line, which means that you do not have to enter anything from that part of the diagram. Exceptions are usually explained under "Description." One important exception, the blank default line around input and output files, is explained in item 10.

4 Repeat Arrow When you follow a path that takes you to a box with an arrow around it, you must choose at least one item from the box. Then you can either follow the arrow back around and continue to choose items from the box, or you can continue along the path. When following the arrow around just the box (rather than an arrow that includes several branches in the diagram), do not choose the same item more than once.

5 Required Item Following the branch with the repeat arrow is a branch with three choices and no default line around them. This means that you must choose one of A, B, or C.

6 Go To Next Line If a diagram is too long to fit on one line, this character tells you to go to the next line of the diagram to continue entering your command. Remember, the diagram does not end until you reach the vertical mark (discussed in Item 12).

7 Continue Diagram This character shows you where to continue with the diagram after it breaks on the previous line.

8 Optional Parameter If a flag can (but does not have to) take a parameter, the path branches after the flag. If you cannot enter a space between the flag and parameter, you are told in a footnote (discussed in Item 11).

9 Default Value Often, a command has default values or actions that it will follow if you do not enter a specific item. These default values are indicated in normal font in the default line if they are equivalent to something you could enter on the command line (for example, a flag with a value). If the default is not something you can enter on the command line, it is not indicated in the diagram.

Note: Default values are included in the diagram for your information. It is not necessary to enter them on the command line.

10 Input or Output A command that can read either input files or standard input has an empty default line above the file parameter. If the command can write its output to either an output file or to standard output, it is also shown with an empty default line above the output file parameter. If a command can read only from standard input, an input file is not shown in the diagram, and standard input is assumed. If a command writes only to standard output, an output file is not shown in the diagram, and standard output is assumed.When you must supply a file name for input or output, the file parameter is included in the diagram without an empty default line above it.

11 Footnote If a command has special requirements or restrictions, a footnote calls attention to these differences.

12 Vertical Mark This ends the syntax diagram.

Reading Usage Statements Usage statements are another way to represent command syntax. Like syntax diagrams, usage statements tell you how to enter commands from the command line. Although usage statements provide the same type of syntax information as diagrams, they are not in diagram format. Rather, they consist of symbols such as [ ] (brackets), { } (braces), and | (vertical bars). The following is a sample of a usage statement for the unget command:unget [ -rSID ] [ -s ] [ -n ]  File ...

Page 107: AIX Commands1

The conventions for bold and italics are the same as for syntax diagrams. The following additional conventions are used in the command usage statements:

Parameters enclosed in brackets are optional.

Parameters enclosed in braces are required.

Parameters not enclosed in either brackets or braces are required.

A vertical bar signifies that you choose only one parameter. For example, [ a | b ] indicates that you can choose a, b, or nothing. Similarly, { a | b } indicates that you must choose either a or b.

Ellipses ( ... ) signify the parameter can be repeated on the command line.

The dash ( - ) represents standard input.

Using Web-based System ManagerWeb-based System Manager is a graphical user interface for managing the system, either from a locally attached display or remotely from another AIX system or personal computer equipped with a web browser. You can start Web-based System Manager in a variety of ways:

from a command line terminal in the Common Desktop Environment (CDE) using a fast path command

from a command line terminal in the AIXwindows environment using a fast path command

from the Common Desktop Environment (CDE) Application Manager by clicking on its icon in the System_Admin folder

from a Version 3.2 HTML-compatible web browser on a personal computer

Using the smit Command The smit command is a tool you can use to run other commands. Command names entered as a parameter to the smit command may take you to a submenu or panel for that command. For example, smit lsuser takes you directly to List All Users, which lists the attributes of users on your system.See the smit command in the AIX Version 4.3 Commands Reference for the exact syntax.

Locating a Command or Program (whereis Command) The whereis command locates the source, binary, and manuals sections for specified files. The command attempts to find the desired program from a list of standard locations.To find files in the current directory that have no documentation, enter:whereis -m -u *To find all of the files that contain the name Mail, enter:whereis MailThe system displays information similar to the following:Mail: /usr/bin/Mail /usr/lib/Mail.rcSee the whereis command in the AIX Version 4.3 Commands Reference for the exact syntax.

Page 108: AIX Commands1

Displaying Information about a Command (man Command) The man command displays information on commands, subroutines, and files. The general format for the man command is:man CommandNameTo obtain information about the pg command, enter:man pgThe system displays information similar to the following: pg Command Purpose Formats files to the display. Syntax pg [ - Number ] [ -c ] [ -e ] [ -f ] [ -n ] [ -p String ] [ -s ] [ +LineNumber | +/Pattern/ ] [ File ... ] Description The pg command reads a file name from the File parameter and writes the file to standard output one screen at a time. If you specify a - (dash) as the File parameter, or run the pg command without options, the pg command reads standard input. Each screen is followed by a prompt. If you press the Enter key, another page is displayed. Subcommands used with the pg command let you review or search in the file.The information the man command provides can also be obtained using the InfoExplorer program.See the man command in the AIX Version 4.3 Commands Reference for the exact syntax.

Displaying the Function of a Command (whatis Command) The whatis command looks up a given command, system call, library function, or special file name, as specified by the Command parameter, from a database you create using the catman -w command. The whatis command displays the header line from the manual section. You can then issue the man command to obtain additional information.The whatis command is equivalent to using the man -f command.To find out what the ls command does, enter:whatis ls The system displays information similar to the following:ls(1)  -Displays the contents of a directory.See the whatis command in the AIX Version 4.3 Commands Reference for the exact syntax.

Listing Previously Entered Commands (history Shell Command) The history command is a Korn shell built-in that lists the last 16 commands entered. The Korn shell saves commands that you entered to a

Page 109: AIX Commands1

command history file, usually named $HOME/.sh_history. This saves time when you need to repeat a previous command.By default, the Korn shell saves the text of the last 128 commands. The history file size (specified by the HISTSIZE environment variable) is not limited, although a very large history file size can cause the Korn shell to start up slowly.

Note: The history shell command is not the same history command used with the INed editor. Also note that the Bourne shell does not support command history.

For detailed information about shells, see "Shells Overview"To list the previous commands you entered, at the prompt, enter:historyThe history command entered by itself lists the previous 16 commands entered. The system displays information similar to the following:928   ls929   mail930   printenv MAILMSG931   whereis Mail932   whatis ls933   cd /usr/include/sys934   ls935   man pg936   cd937   ls | pg938   lscons939   tty940   li *.txt941   printenv MAILMSG942   pwd943   historyThe listing first displays the position of the command in the $HOME/.sh_history file followed by the command.To list the previous five commands, at the prompt, enter:history -5A listing similar to the following appears:939   tty940   li *.txt941   printenv MAILMSG942   pwd943   history944   history -5The history command followed by a number lists all the previous commands entered starting at that number.To list the commands since 938, at the prompt, enter:history 938A listing similar to the following appears:938   lscons939   tty940   li *.txt941   printenv MAILMSG942   pwd943   history944   history -5945   history 938

Page 110: AIX Commands1

Repeating Commands Using the Shell history Command Use the r Korn shell alias to repeat previous commands. Enter r and you can specify the number or the first character or characters of the command.If you want to list the displays currently available on the system, you would enter lsdisp at the prompt. The system returns the information to you on the screen. If you want the same information returned to you again, at the prompt, enter:rThe system runs the most recently input command again. In this example, the lsdisp command would run.To repeat the li *.txt command, at the prompt, enter:r liThe r Korn shell alias locates the most recent command that begins with the character or characters specified.

Substituting Strings Using the Shell history Command You can also use the r Korn shell alias to modify a command before it is run. In this case, a substitution parameter of the form Old=New can be used to modify the command before it is run.For example, if command line 940 is li *.txt, and you want to run li *.exe, at the prompt, enter:r txt=exe 940This runs command 940, substituting exe for txt.For example, if the command on line 940 is the most recent command that starts with a lower-case letter l, you can also enter:r txt=exe l

Note: Only the first occurrence of the Old string is replaced by the New string. Entering the r Korn shell alias without a specific command number or character does the substitution to the previous command entered.

Editing the Command History Use the fc Korn shell built-in command to list or edit portions of the command history file. To select a portion of the file to edit or list, specify the number or the first character or characters of the command. You can specify a single command or range of commands. If you do not specify an editor program as an argument to the fc Korn shell built-in command, the editor specified by the FCEDIT variable is used. If the FCEDIT variable is not defined, then the /usr/bin/ed editor is used. The edited command or commands are printed and run when you exit the editor. Use the printenv command to display the value of the FCEDIT variable.For example, if you want to run the command:cd /usr/tmpwhich is very similar to command line 933, at the prompt enter:fc 933At this point, your default editor appears with the command line 933. You would change include/sys to tmp, and when you exit your editor, the edited command is run.You can also specify the editor you want to use in the fc command.

Page 111: AIX Commands1

For example, if you want to edit a command using the /usr/bin/vi editor, at the prompt, enter:fc -e vi 933At this point, the vi editor appears with the command line 933.You can also specify a range of commands to edit. For example, if you want to edit the commands 930 through 940, at the prompt, enter:fc 930 940At this point, your default editor appears with the command lines 930 through 940. When you exit the editor, all the commands that appear in your editor are run sequentially.

Creating a Command Alias (alias Shell Command) An alias lets you create a shortcut name for a command, a file name, or any shell text. By using aliases, you save a lot of time when doing tasks you do frequently. The alias Korn shell built-in command defines a word as an alias for some command. You can use aliases to redefine built-in commands but not to redefine reserved words.The first character of an alias name can be any nonspecial printable character. Any remaining characters must be the same as for a valid file name.The format for creating an alias is: alias Name=Stringin which the Name parameter specifies the name of the alias and the String parameter specifies a string of characters. If String contains blank spaces, enclose it in quotes.To create an alias for the command rm -i (prompts you before deleting files), at the prompt, enter:alias rm="/usr/bin/rm -i"In this example, whenever you enter the command rm, the actual command performed is /usr/bin/rm -i.To create an alias for the command ls -alF | pg (displays detailed information of all the files in the current directory, including the invisible files; marks executable files with an * and directories with a /; and scrolls per screen), at the prompt, enter:alias dir="/usr/bin/ls -alF | pg"In this example, whenever you enter the command dir, the actual command performed is /usr/bin/ls -alF | pg.To display all the aliases you have, at the prompt, enter:aliasThe system displays information similar to the following:rm="/usr/bin/rm -i"dir="/usr/bin/ls -alF | pg"

Working with Text-Formatting Commands You can use text-formatting commands to work with text composed of the AIX international extended character set used for European languages.

International Character Support in Text Formatting The AIX international extended character set provides the characters and symbols used in many European languages, as well as an ASCII subset composed of English-language characters, digits, and punctuation.

Page 112: AIX Commands1

All characters in the AIX European extended character set have ASCII forms. These forms can be used to represent the extended characters in input, or the characters can be input directly by a device such as a keyboard that supports the European extended characters.The following text-formatting commands support all international languages that use single-byte characters. These commands are located in /usr/bin. (The commands identified with an asterisk (*) support text processing for multibyte languages.)addbib* hyphen pic* pstextcheckmm ibm3812 ps4014 refer*checknr* ibm3816 ps630 roffbib*col* ibm5587G* psbanne soelim*colcrt ibm5585H-T* psdit sortbib*deroff* indxbib* psplot tbl*enscript lookbib* psrev troff*eqn* makedev* psroff vgrindgrap* neqn* psrv xpreview*hplj nroff*Text-formatting commands and macro packages not in the preceding list have not been enabled to process AIX international characters.

Inputting Extended Single-Byte Characters If your input device supports characters from the European-language extended character set, you can input them directly. Otherwise, use the following ASCII escape sequence form to represent these characters:The form \[N], where N is the 2- or 4-digit hexadecimal code for the character.

Note: The NCesc form \<xx> is no longer supported.

Text containing extended characters is output according to the formatting conventions of the language in use. Characters that are not defined for the interface to a specific output device produce no output or error indication.Although the names of the requests, macro packages, and commands are based on English, most of them can accept input (such as file names and parameters) containing characters in the European extended character set.For the nroff and troff commands and their preprocessors, the command input must be ASCII, or an irrecoverable syntax error will result. International characters, either single-byte or multibyte, can be input when enclosed within quotes and without other text to be formatted. For example, using macros from the pic command:define foobar % SomeText %After the define directive, the first name, foobar, must be ASCII. However, the replacement text, SomeText, can contain non-ASCII characters.

Multibyte Character Support in Text Formatting Certain text-formatting commands can be used to process text for multibyte languages. These commands are identified with an asterisk (*) in the list under "International Character Support in Text Formatting" . Text-formatting commands not in the list have not been enabled to process AIX international characters.

Page 113: AIX Commands1

Inputting Multibyte CharactersIf supported by your input device, multibyte characters can be input directly. Otherwise, you can input any multibyte character in the ASCII form \[N], where N is the 2-, 4-, 6-, 7-, or 8-digit hexadecimal encoding for the character.Although the names of the requests, macros, and commands are based on English, most of them can accept input (such as file names and parameters) containing any type of multibyte character.If you are already familiar with using text-formatting commands with single-byte text, the following list summarizes characteristics that are noteworthy or unique to the multibyte locales:

Text is not hyphenated.

Special format types are required for multibyte numerical output. Japanese format types are available.

Text is output in horizontal lines, filled from left to right.

Character spacing is constant, so characters automatically align in columns.

Characters that are not defined for the interface to a specific output device produce no output or error indication.

As for the nroff and troff commands and their preprocessors, the command input must be ASCII, or a syntax error will result. International characters, either single-byte or multibyte, can be input when enclosed within quotes and within other text to be formatted. For example, using macros from the pic command:define foobar % SomeText %After the define directive, the first name, foobar, must be ASCII. However, the replacement text, SomeText, can contain non-ASCII characters.

Processes OverviewA program or command that is actually running on the computer is referred to as a process. Processes exist in parent-child hierarchies. A process started by a program or command is a parent process; a child process is the product of the parent process. A parent process may have several child processes, but a child process can only have one parent. The system assigns a process identification number (PID number) to each process when it starts. If you start the same program several times, it will have a different PID number each time. When a process is started on a system, the process uses a part of the available system resources. When more than one process is running, a scheduler that is built into the operating system gives each process its share of the computer's time, based on established priorities. These priorities can be changed by using the nice or renice commands.

Note: Only someone with root user authority can change a process priority to a higher one. All users can lower priorities on a process they start by using the nice command, or on a process they have already started by using the renice command.

This section discusses: Foreground and Background Processes

Page 114: AIX Commands1

Daemons

Zombie Process

Starting a Process

Scheduling a Process for Later Operation ( at Command)

Listing All Scheduled Processes ( at or atq Command)

Checking Processes ( ps Command)

Setting the Initial Priority of a Process ( nice Command)

Changing the Priority of a Running Process ( renice Command)

Canceling a Foreground Process

Stopping a Foreground Process

Restarting a Stopped Process

Removing a Process from the Schedule ( at Command)

Removing a Background Process ( kill Command)

Foreground and Background Processes Processes that are started from and require a user's interaction are called foreground processes. Processes that are run independently of a user are referred to as background processes. Programs and commands run as foreground processes by default. To run a process in the background, place an ampersand (&) at the end of the command name that you use to start the process.

Daemons Daemons are processes that run unattended. They are constantly in the background and are available at all times. Daemons are usually started when the system starts and run until the system stops. A daemon process performs system services and is available at all times to more than one task or user. Daemon processes are started by the root user or root shell and can be stopped only by the root user. For example, the qdaemon process provides access to system resources such as printers. Another common daemon is the sendmail daemon.

Zombie Process A zombie process is a dead process that is no longer executing but is still recognized in the process table (in other words, it has a PID number). It has no other system space allocated to it. Zombie processes have been killed or have exited and continue to exist in the process table until the parent process dies or the system is shut down and restarted. Zombie processes show up as <defunct> when listed by the ps command.

Starting a Process You start a foreground process from a display station by either entering a program name or command name at the system prompt. Once a foreground process has started, the process interacts with you at your

Page 115: AIX Commands1

display station until it is complete. This means no other interaction (for example, entering another command) can take place at the display station until the process is finished or you halt it.A single user can run more than one process at a time up to a default maximum of 40 processes per user.

To Start a Process in the ForegroundTo run a process in the foreground, enter the name of the command with all the appropriate parameters and flags:$ CommandName

To Start a Process in the BackgroundTo run a process in the background, enter the name of the command with all the appropriate parameters and flags, followed by an ampersand (&):$ CommandName&When the process is running in the background, you can perform additional tasks by entering other commands at your display station.Generally, background processes are most useful for commands that take a long time to run. However, because they increase the total amount of work the processor is doing, background processes also slow down the rest of the system.Most processes direct their output to standard output, even when they run in the background. Unless redirected, standard output goes to the display station. Because the output from a background process can interfere with your other work on the system, it is usually good practice to redirect the output of a background process to a file or a printer. You can then look at the output whenever you are ready.

Note: Under certain circumstances, a process may generate its output in a different sequence when run in the background than when run in the foreground. Programmers may want to use the fflush subroutine to ensure that output occurs in the proper order regardless of whether the process runs in foreground or background.

As long as a background process is running, you can check its status with the ps command.

at CommandPurposeRuns commands at a later time.

SyntaxTo Schedule Jobs to Run at a Later Timeat [ -c | -k | -s | -q Queue ] [ -m ] [ -f File ] { -t Date |Time [ Day ] [ Increment ] }

To Report Scheduled Jobsat -l [ -o ] [ Job ... | -q Queue ]at -n [ User ]

To Remove Scheduled Jobsat -r [ -F ] [ -i ] Job ...at -r [ -F ] [ -i ] -u User

Page 116: AIX Commands1

DescriptionThe at command reads from standard input the names of commands to be run at a later time and allows you to specify when the commands should be run.The at command mails you all output from standard output and standard error for the scheduled commands, unless you redirect that output. It also writes the job number and the scheduled time to standard error.When the at command is executed, it retains the current process environment. It does not retain open file descriptors, traps, and priority.The /var/adm/cron/at.allow and /var/adm/cron/at.deny files control which users can use the at command. A person with root user authority can create, edit, or delete these files. Entries in these files are user login names with one name to a line. The following is an example of an at.allow file:rootnickdeesarahIf the at.allow file exists, only users whose login names appear in it can use the at command. A system administrator can explicitly stop a user from using the at command by listing the user's login name in the at.deny file. If only the at.deny file exists, any user whose name does not appear in the file can use the at command. A user cannot use the at command if one of the following is true:

The at.allow file and the at.deny file do not exist (allows root user only).

The at.allow file exists but the user's login name is not listed in it.

The at.deny file exists and the user's login name is listed in it.

If the at.allow file does not exist and the at.deny file does not exist or is empty, only someone with root user authority can submit a job with the at command. To schedule a job to run at a later time, you must specify a time to start the job. You may specify the time by using either the -t Date flag or the Time, Day, and Increment parameters.The Date variable to the -t flag is specified using the following format:[[CC]YY]MMDDhhmm[.SS]The digits in the Date variable are defined as follows:CC Specifies the first two digits of the year (the

century).YY Specifies the second two digits of the year.MM Specifies the month of the year (01 through 12).DD Specifies the day of the month (01 through 31).hh Specifies the hour of the day (00 through 23).mm Specifies the minute of the hour (00 through 59).SS Specifies the second of the minute (00 through 59).Both the CC and YY digits are optional. If neither is given, the current year is assumed. If the YY digits are specified but the CC digits are not, the CC digits are defined as follows:

If the value of the YY digits is between 70 and 99, the value of the CC digits is assumed to be 19.

If the value of the YY digits is between 00 and 37, the value of the CC digits is assumed to be 20.

Page 117: AIX Commands1

The default value of SS is 00.

The resulting time is affected by the value of the TZ environment variable.The Time parameter may be specified as a number followed by an optional suffix. The at command interprets one- and two-digit numbers as hours. It interprets four digits as hours and minutes. The T_FMT item in the LC_TIME locale category specifies the order of hours and minutes. The default order is the hour followed by the minute. You can also separate hours and minutes with a : (colon). The default order is Hour:Minute.In addition, you may specify one of the following suffixes:

am

pm

zulu

If you do not specify am or pm, the at command uses a 24-hour clock. These suffixes can follow the time as a separate argument or separated with spaces. The am and pm suffixes are defined values from the AM_STR and PM_STR items in the LC_TIME locale category. The suffix zulu indicates that the time is GMT (Greenwich Mean Time).The at command also recognizes the following keywords as special values for the Time parameter:

noon

midnight

now

A for AM

P for PM

N for noon

M for midnight

You may specify the optional Day parameter as either a month name and a day number (and possibly a year number preceded by a comma), or a day of the week. The D_FMT item in the LC_TIME locale category specifies the order of the month and day (by default, month followed by day). The DAY_1 through DAY_7 items in the LC_TIME locale category specify long day names. The ABDAY_1 through ABDAY_7 items in the LC_TIME locale category specify short day names. The MON_1 through MON_12 items in the LC_TIME locale category specify long month names. The ABMON_1 through ABMON_12 items in the LC_TIME locale category specify short month names. By default, the long name is fully spelled out; the short name is abbreviated to two or more characters for weekdays, and three characters for months.The at command recognizes today and tomorrow as special default values for the Day parameter. The today value is the default Day if the specified time is later than the current hour; the tomorrow value is the default if the time is earlier than the current hour. If the specified month is

Page 118: AIX Commands1

less than the current month (and a year is not given), next year is the default year.

Flags-c Requests that the csh command be used for executing this job.-f File Uses the specified file as input rather than using standard input.-F Suppresses delete verification. Use this flag with the -r flag.-i Specifies interactive delete. Use this flag with the -r flag.-k Requests that the ksh command be used for executing this job.-l Reports your scheduled jobs. If you have root user authority, you can get jobs issued by other

users.-m Mails a message to the user about the successful execution of the command.-n [ User ] Reports the number of files in your queue. If you have root user authority, you can get

information about another user's queue.-o Lists jobs in schedule order. This flag is useful only with the -l flag.-q Queue Specifies the queue in which to schedule a job for submission. When used with the -l flag, the

report is limited to the queue specified by the Queue variable. By default, at jobs are scheduled in the a queue. The b, c and d queues are reserved for batch jobs, cron jobs, and sync jobs respectively. -q a

Queues at jobs. -q b

Queues batch jobs. The batch command calls the at command with this flag.

Note: When using the b queue, commands are read from standard input. Also, the now keyword is used for the Time parameter, regardless of what you specify on the command line.

-q e Queues ksh jobs. Equivalent to the -k flag.

-q f Queues csh jobs. Equivalent to the -c flag.

-r Job... Removes Jobs previously scheduled by the at or batch commands, where Job is the number assigned by the at or batch commands. If you do not have root user authority (see the su command), you can remove only your own jobs. The atrm command is available to the root user to remove jobs issued by other users or all jobs issued by a specific user.

-s Requests that the bsh command (Bourne shell) be used for executing this job.-t Date Submits the job to be run at the time specified by the Date variable.-u User Deletes all jobs for the specified user. If used with the -r flag, do not specify a Job variable

(the correct syntax is at -r -u User).

ParametersDay Specifies the optional Day parameter as either a month name and a day number (and possibly a

year number preceded by a comma), or a day of the week. Increment The optional Increment parameter can be one of the following:

A + (plus sign) followed by a number and one of the following words:

o minute[s]

o hour[s]

o day[s]

o week[s]

o month[s]

o year[s]

The special word next followed by a one of the following words:

Page 119: AIX Commands1

o minute[s]

o hour[s]

o day[s]

o week[s]

o month[s]

o year[s]

SecurityAuditing Events: If the auditing subsystem has been properly configured and is enabled, the at command will generate the following audit record (event) every time the command is executed:

Event InformationAT_JobAdd Lists at jobs that were run, the time the task was completed, and the user who issued the

command.See "Setting Up an Auditing System" in AIX Version 4.3 System Management Guide: Operating System and Devices for more details about how to properly select and group audit events, and how to configure audit event data collection.

Exit StatusThis command returns the following exit values:0 The at command successfully submitted, removed, or listed a job or

jobs.>0 An error occurred.

Examples To schedule the command from the terminal, enter a command similar to one of the following:

If uuclean is in your current directory, enter:at 5 pm Fridayuuclean<Ctrl-D> at now next weekuuclean<Ctrl-D>If uuclean is in $HOME/bin/uuclean, enter:at now + 2 days$HOME/bin/uuclean<Ctrl-D>

Note: When entering a command name as the last item on the command line, a full path name must be given if the command is not in the current directory, and the at command will not accept any arguments.

To run the uuclean command at 3:00 in the afternoon on the 24th of January, enter any one of the following commands:

echo uuclean | at 3:00 pm January 24 echo uuclean | at 3pm Jan 24

Page 120: AIX Commands1

echo uuclean | at 1500 jan 24

To have a job reschedule itself, invoke the at command from within the shell procedure by including code similar to the following within the shell file:

echo "ksh shellfile" | at now tomorrow

To list the jobs you have sent to be run later, enter:

at -l

To cancel a job, enter:

at -r ctw.635677200.aThis cancels job ctw.635677200.a. Use the at -l command to list the job numbers assigned to your jobs.

Files/var/adm/cron/FIFO A named pipe that sends messages to the cron daemon when new jobs are

submitted with the crontab or at commands./usr/bin/at Contains the at command./var/adm/cron Contains the main cron directory./var/adm/cron/at.allow Specifies the list of allowed users./var/adm/cron/at.deny Specifies the list of denied users./var/spool/cron/atjobs Contains the spool area directory for at.

Related InformationThe atq command, atrm command, auditpr command, batch command, bsh command, kill command, ksh command, mail command, nice command, ps command, sh command, su command.The cron daemon.The environment file. Auditing Overview in AIX Version 4.3 System Management Guide: Operating System and Devices provides more information about audits and audit events.Input and Output Redirection Overview in AIX Version 4.3 System Management Guide: Operating System and Devices describes how the operating system processes input and output. National Language Support Overview for Programming in AIX Version 4.3 System Management Guide: Operating System and Devices explains collating sequences, equivalence classes, and locale.Shells Overview in AIX Version 4.3 System User's Guide: Operating System and Devices describes what shells are, the different types of shells, and how shells affect the way commands are interpreted.

Checking Processes (ps Command) Any time the system is running, several processes are also running. You can use the ps command or a Web-based System Manager fast path to find out which processes are running and to display information about those processes.

ps CommandThe ps command has several flags that enable you to specify which processes to list and what information to display about each process.To show all processes running on your system, at the prompt, enter:ps -efThe system displays information similar to the following: USER PID PPID C STIME TTY TIME CMD

Page 121: AIX Commands1

root 1 0 0 Jun 28 - 3:23 /etc/init root 1588 6963 0 Jun 28 - 0:02 /usr/etc/biod 6 root 2280 1 0 Jun 28 - 1:39 /etc/syncd 60 mary 2413 16998 2 07:57:30 - 0:05 aixterm mary 11632 16998 0 07:57:31 lft/1 0:01 xbiff mary 16260 2413 1 07:57:35 pts/1 0:00 /bin/ksh mary 16469 1 0 07:57:12 lft/1 0:00 ksh /usr/lpp/X11/bin/xinit mary 19402 16260 20 09:37:21 pts/1 0:00 ps -ef The column heading definitions are as follows:USER User login namePID Process IDPPID Parent process IDC CPU utilization of processSTIME Start time of processTTY Controlling workstation for the processTIME Total execution time for the processCMD CommandIn the previous example, the process ID for the ps -ef command is 19402. Its parent process ID is 16260, the /bin/ksh command.If the listing is very long, the top portion scrolls off the screen. To prevent this from happening, use the ps command piped to the pg command. At the prompt, enter:ps -ef | pgTo show status information of all processes running on your system, at the prompt, enter: ps gvThis form of the command lists a number of statistics for each active process. Output from this command looks something like this: PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND 0 - A 0:44 7 8 8 xx 0 0 0.0 0.0 swapper 1 - A 1:29 518 244 140 xx 21 24 0.1 1.0 /etc/init 771 - A 1:22 0 16 16 xx 0 0 0.0 0.0 kproc 1028 - A 0:00 10 16 8 xx 0 0 0.0 0.0 kproc 1503 - A 0:33 127 16 8 xx 0 0 0.0 0.0 kproc 1679 - A 1:03 282 192 12 32768 130 0 0.7 0.0 pcidossvr 2089 - A 0:22 918 72 28 xx 1 4 0.0 0.0 /etc/sync 2784 - A 0:00 9 16 8 xx 0 0 0.0 0.0 kproc 2816 - A 5:59 6436 2664 616 8 852 156 0.4 4.0 /usr/lpp/ 3115 - A 0:27 955 264 128 xx 39 36 0.0 1.0 /usr/lib/ 3451 - A 0:00 0 16 8 xx 0 0 0.0 0.0 kproc 3812 - A 0:00 21 128 12 32768 34 0 0.0 0.0 usr/lib/lpd/ 3970 - A 0:00 0 16 8 xx 0 0 0.0 0.0 kproc 4267 - A 0:01 169 132 72 32768 16 16 0.0 0.0 /etc/sysl 4514 lft/0 A 0:00 60 200 72 xx 39 60 0.0 0.0 /etc/gett 4776 pts/3 A 0:02 250 108 280 8 303 268 0.0 2.0 -ksh 5050 - A 0:09 1200 424 132 32768 243 56 0.0 1.0 /usr/sbin 5322 - A 0:27 1299 156 192 xx 24 24 0.0 1.0 /etc/cron 5590 - A 0:00 2 100 12 32768 11 0 0.0 0.0 /etc/writ 5749 - A 0:00 0 208 12 xx 13 0 0.0 0.0 /usr/lpp/ 6111 - T 0:00 66 108 12 32768 47 0 0.0 0.0 /usr/lpp/See the ps command in the AIX Version 4.3 Commands Reference for the exact syntax.

Page 122: AIX Commands1

Web-based System Manager Fast PathYou can use the Web-based System Manager fast path to find out which processes are running and to display information about those processes. At the prompt, type:wsm processesIn the Processes container, select a process, then use the menus to complete the task. Other commands you can use are smit process and smit monitors.

Setting the Initial Priority of a Process (nice Command) You can set the initial priority of a process to a value lower than the base scheduling priority by using the nice command to start the process.

Note: To run a process at a higher priority, you must have root user authority.

nice Command To set the initial priority of a process, type:nice -n Number CommandStringwhere Number is in the range of 0 to 39, with 39 being the lowest priority. The higher the number, the lower the priority. If you use zero, the process will run at its base scheduling priority. CommandString is the command and flags and parameters you want to run.See the nice command in the AIX Version 4.3 Commands Reference for more information and the exact syntax.You can also use the smit nice command to perform this task.

Changing the Priority of a Running Process (renice Command) You can change the scheduling priority of a running process to a value lower or higher than the base scheduling priority by using the renice command. This command changes the nice value of a process. There are two ways to run this command:

With the renice command from the command line

With the Web-based System Manager fast path

Note: To run a process at a higher priority or to change the priority for a process you did not start, you must have root user authority.

From the Command Line To change the initial priority of a running process, type:renice Priority -p ProcessIDwhere Priority is in the range of -20 to 20. The higher the number, the lower the priority. If you use zero, the process will run at its base scheduling priority. ProcessID is the PID you want to change the priority of.

Web-based System Manager Fast PathYou can use the Web-based System Manager fast path to change the priority of a running process. At the prompt, type:wsm processesIn the Processes container, select a process, then use the menus to complete the task. You can also use the smit renice command to perform this task.

Page 123: AIX Commands1

Canceling a Foreground Process If you start a foreground process and then decide you do not want to let it finish, you can cancel it by pressing INTERRUPT. This is usually Ctrl-C or Ctrl-Backspace. To find out what your INTERRUPT key is set to, see Listing Control Key Assignments for Your Terminal (stty Command) .

Listing Control Key Assignments for Your Terminal (stty Command)The stty command displays your terminal settings. Most of these settings you can ignore, but the important information is what keys your terminal uses for control keys.For example, at the prompt, enter:stty -aThe system displays information similar to the following:..intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ^@ start = ^Q; stop = ^S; susp = ^Z; dsusp = ^Y; reprint = ^R discard = ^O; werase = ^W; lnext = ^V...In this example, lines such as intr = ^C; quit = ^\; erase = ^H; are your control key settings. The ^H key is the Backspace key, and erase is the function it is set to perform. For detailed information about control keys, see "Control Keys" in AIX Version 4.3 Quick Beginnings.

System Hardware ComponentsYour system can have a display, keyboard, and mouse attached to it, in addition to a wide range of other available options. Examples of these options are tape drives, printers, terminals, and plotters. Such items are called devices. The operating system controls the devices attached to your system.This section discusses the following:

Terminals

Keyboards

Mouse

The Typical Computer System Arrangement illustration shows one possible office arrangement.

Note: Your system may not look exactly like any of the illustrations given in this guide.

The System Unit Features illustration shows some system features.If you are on a network, you may not have a system unit on your desk. In this case, you probably have a terminal that only has a power switch.

Terminals The terminal is the device you use to interact with your computer system. It is composed of a display (or monitor), a keyboard, and sometimes a mouse. There are several types of terminals: dumb terminals, smart terminals, and

Page 124: AIX Commands1

graphics terminals. The Terminal Setup illustration shows a typical terminal setup.Dumb Terminal A dumb terminal (or nonprogrammable terminal) cannot do any processing on its

own. This means the terminal itself cannot run programs but has another computer do its processing while it displays the results. This type of terminal is common in multiuser or networked systems.

Smart Terminal A smart terminal (or programmable terminal) does some processing on its own and sometimes has a device (a disk drive, for example) for reading and writing files. This type of terminal is also common in multiuser or networked systems.

Graphics Terminal A graphics terminal is a smart terminal with special hardware that allows it to display pictures. If you work in a windows interface, you need a special type of graphics terminal known as an X terminal.

KeyboardsThe various keys on the keyboard allow you to enter data and control the cursor location. Keyboards for different countries can have their keys engraved with their character set. Some keyboards also have more keys. There are several kinds of keyboard designs. This section explains how keyboards work in general, and discusses the various keys and their use. The Typical Keyboard illustration shows a possible keyboard layout.The keyboard has four sections: function keys The operating system controls these multipurpose keys. typewriter keys The software, usually a keyboard driver, controls these keys, which are similar to those

on a standard typewriter. cursor keys These keys move the cursor on the screen and do programmed control functions. The

application program that you use controls their movement and functions. numeric keypad Similar to a calculator, the keypad is used to enter numbers. The functions of each keyboard depend on the software you use.

Special Keys Certain keys or combinations of keys make working in a command line interface easier.

Key FunctionEnter key Use the Enter key to tell the system that you have finished entering text and that it can

start running the command. You can correct the command line any time before you press the Enter key.

Spacebar Use the Spacebar to add spaces to the command line when needed.Tab key Use the Tab key to insert up to eight spaces until the next tab stop.Backspace key Use the Backspace key to erase the character preceding the cursor on the command line.

Control Key Combinations The control (Ctrl) key is used in combination with other keys to make control characters. You press and hold the Ctrl key, and then quickly press another key. Some control keys appear on the display; others are invisible.The following is a list of useful key sequences and their functions:

Key FunctionCtrl-C Interrupts most programs. You will see ^C on the screen. Ctrl-Z Suspends most programs. You will see ^Z on the screen.Ctrl-D End-of-file character used for logging out and for terminating file input. You will see ^D on the

screen.Ctrl-\ Quits program and creates a file named core that is used for debugging. You will see ^\ on the

screen.Ctrl-W Erases the word preceding the cursor.Ctrl-U Erases the entire command line.Ctrl-S Stops the output of a program from running off the bottom of the screen.Ctrl-Q Resumes the output of a program stopped by Ctrl-S.

Page 125: AIX Commands1

Escape Key CombinationsThough rarely used, in some instances the escape (Esc) key is also used in combination with other keys to make control characters. You press and release the Esc key, and then press another key.

Key Nicknames Some characters on your keyboard are referred to by more than one name. The following is a list of some key names with their nicknames:Key Names! Exclamation mark, bang# Pound sign, crosshatch* Asterisk, star, splat- Hyphen, minus, minus sign. Period, dot/ Slash, forward slash\ Backslash< Less-than sign, left angled bracket> Greater-than sign, right angled bracket_ Underscore, underline| Vertical bar, vertical line, pipe? Question mark, hook' Single quote, tick` Backquote, back tick~ Tilde, accent

Mouse The mouse allows you to move the pointer quickly to all areas of your screen. You use the mouse to tell the AIX Common Desktop Environment or AIXwindows what you want to do. The mouse allows you to manipulate icons, menus, and windows. The Three Button and Two Button Mouse illustration shows a three-button and a two-button mouse.

Mouse Buttons The mouse most commonly used with AIX has three buttons. Each button provides a different function. If you have a two-button mouse, pressing both buttons at the same time is equivalent to pressing the middle button on a three-button mouse.Button Functionleft Use the left mouse button for selecting and activating default actions and copying and pasting

text.middle Use the middle mouse button for customized application programs.right Use the right mouse button for customized application programs.

Mouse-Button ActionsWhen you perform a command with the mouse, first point and then do one of the following: press and hold, click, double-click, drag, drag and drop, or rubber-band with the mouse buttons.

Note: The specific mouse button to use depends on the application in which it is used.

Point To point to an object, move the mouse until the tip of the mouse pointer is on the object (icon, menu, window, or window selection).

Press-and-Hold To press and hold, point to the object (icon, menu, or

Page 126: AIX Commands1

window), and then hold down the mouse button without moving the mouse.

Click To click, point to the object (icon, menu, window, or window selection), and then press and quickly release the mouse button without moving the mouse.

Double-Click To double-click, point to the object (icon), and then quickly press the mouse button twice without moving the mouse.

Drag A drag usually refers to moving windows and selcting menu options.

To drag a menu selection, point to the menu you want to display, and press and hold the mouse button. Slide (drag) the pointer to highlight the desired menu option, and release the button.

Drag-and-Drop Drag-and-drop usually refers to icons. This action only functions in some applications.

To drag and drop, point to the icon, hold down the mouse button, and move (drag) the pointer (while still holding down the mouse button) in the direction you want to move the object. When the object is where you want it, release (drop) the mouse button.

Rubber-Band Rubber-banding usually refers to toggling (also referred to as selecting and deselecting) an icon's selection state and is used for manipulating a group of icons. Toggling refers to selecting an icon if it is currently unselected or deselcting an icon if it is currently selected. This action only functions in some applications.

To rubber-band, point to a position near the icon or icons to toggle (not touching any part of the icon or its title). Press and hold the mouse button, and drag the pointer. A rubber-band box is displayed, which you "stretch" to enclose the icons you want. When you release the mouse button, all icons inside or touching the rubber-band are toggled.

The example of Rubber-Banding illustration shows rubber-banding.

Mouse Pointer ShapesWhen AIXwindows starts, an X-shaped pointer appears at the center of the screen. As you move the mouse on your desktop, the pointer on the screen moves correspondingly.The pointer shape changes according to its location. For example, when the pointer is directly over the root window (the backdrop behind all windows), the pointer has an X shape. When the mouse points inside a terminal window, the pointer changes to an I shape. A description and illustration of pointer shapes follows.Arrow PointerAn arrow pointing to the upper-left corner is the general-purpose pointer used in most window areas for single-object selection and activation.

Page 127: AIX Commands1

An arrow pointing to the upper-right corner indicates a pending menu action. This shape indicates that a menu is popped up or pulled down and waiting for a menu item to be activated or the menu to be removed.Caution PointerThe caution pointer indicates action is expected in another area before input can be given to the current area and that the pointer has no effect in the area where the caution pointer appears. While the caution pointer is active, all mouse button and keyboard events are ignored in the current area.Four-Directional Arrow PointerThe four-directional arrow pointer indicates a move operation is in progress. During a move operation, the object, or an outline of the object, should move to track the location of the pointer.Hourglass PointerThe hourglass pointer, a working pointer, indicates that an action is in progress in the area and that the pointer has no effect in that area. While the hourglass pointer is active, all mouse-button and keyboard events are ignored in the area. The hourglass pointer can be used interchangeably with the watch pointer.I-beam PointerThe I-beam pointer performs actions on the text and changes the location of the text-insertion cursor.Resize PointerThe resize pointer indicates a resizing position. The direction of the arrow in the pointer indicates the direction of increasing size. The horizontal and vertical pointers indicate that the window is changed in either the horizontal or vertical direction. The diagonal pointers indicate that the window is changed in both the horizontal and vertical directions simultaneously. The pointer that appears depends on the resize operation you do.Sighting PointerThe sighting pointer is used to make precise position selections. For example, in a drawing program, it may be used to indicate a pixel to fill or the connecting points of lines.Watch PointerThe watch pointer, also called a working pointer, indicates that an action is in progress in the area and that the pointer has no effect in that area. While the watch pointer is active, all mouse-button and keyboard events are ignored in the area. The watch pointer can be used interchangeably with the hourglass pointer.X pointerThe X pointer indicates when the pointer is outside any application area.

If the listing is very long, the top portion scrolls off the screen. To prevent this from happening, use the stty command piped to the pg command. At the prompt, enter:stty -a | pgSee the stty command in the AIX Version 4.3 Commands Reference for the exact syntax.

Page 128: AIX Commands1

Note: INTERRUPT (Ctrl-C) does not cancel background processes. To cancel a background process, you must use the kill command.

Most simple commands are not good examples for demonstrating how to cancel a process-they run so quickly that they finish before you have time to cancel them. The examples in this section, therefore, use a command that takes more than a few seconds to run: find / -type f. This command displays the path names for all files on your system. You do not need to study the find command in order to complete this section; it is used here simply to demonstrate how to work with processes.In the following example, the find command starts a process. After the process runs for a few seconds, you can cancel it by pressing the INTERRUPT key:$ find / -type f/usr/sbin/acct/lastlogin/usr/sbin/acct/prctmp/usr/sbin/acct/prdaily/usr/sbin/acct/runacct/usr/sbin/acct/sdisk/usr/sbin/acct/shutacct INTERRUPT (Ctrl-C)$ _The system returns the prompt to the screen. Now you can enter another command.

Stopping a Foreground Process It is possible for a process to be stopped but not have its process ID (PID) removed from the process table. You can stop a foreground process with a Ctrl-Z from the keyboard.

Note: Ctrl-Z works in the Korn shell (ksh) and C shell (csh), but not in the Bourne shell (bsh).

Restarting a Stopped Process This procedure describes how to restart a process that has been stopped with a Ctrl-Z.

Note: Ctrl-Z works in the Korn shell (ksh) and C shell (csh), but not in the Bourne shell (bsh). To restart a stopped process, you must either be the user who started the process or have root user authority.

To show all the processes running or stopped but not killed on your system, type:

ps -efYou may want to pipe this command through a grep command to restrict the list to those processes most likely to be the one you want to restart. For example, if you want to restart a vi session, you could enter: ps -ef | grep viThis command would display only those lines from the ps command output that contained the word vi. The output would look something like this: UID PID PPID C STIME TTY TIME COMMANDroot 1234 13682 0 00:59:53 - 0:01 vi testroot 14277 13682 1 01:00:34 - 0:00 grep vi

In the ps command output, find the process you want to restart and note its PID number. In the example, the PID is 1234.

To send the CONTINUE signal to the stopped process, type:

kill -19 1234

Page 129: AIX Commands1

Substitute the PID of your process for the 1234. The -19 indicates the CONTINUE signal. This command restarts the process in the background. If it is okay for the process to run in the background, you are finished with the procedure. If the process needs to run in the foreground (as a vi session would), you must proceed with the next step.

To bring the process in to the foreground, type:

fg 1234Once again, substitute the PID of your process for the 1234. Your process should now be running in the foreground. (You are now in your vi edit session).

Scheduling a Process for Later Operation (at Command) You can set up a process as a batch process to run in the background at a scheduled time. The at and smit commands let you enter the names of commands to be run at a later time and allow you to specify when the commands should be run.

Note: The /var/adm/cron/at.allow and /var/adm/cron/at.deny files control whether you can use the at command. A person with root user authority can create, edit, or delete these files. Entries in these files are user login names with one name to a line. The following is an example of an at.allow file:

rootnickdeesarah

If the at.allow file exists, only users whose login names appear in it can use the at command. A system administrator can explicitly stop a user from using the at command by listing the user's login name in the at.deny file. If only the at.deny file exists, any user whose name does not appear in the file can use the at command. You cannot use the at command if one of the following is true:

The at.allow file and the at.deny file do not exist (allows root user only).

The at.allow file exists but the user's login name is not listed in it.

The at.deny file exists and the user's login name is listed in it.

If the at.allow file does not exist and the at.deny file does not exist or is empty, only someone with root user authority can submit a job with the at command. The at command syntax allows you to specify a date string, a time and day string, or an increment string for when you want the process to run. It also allows you to specify which shell or queue to use. The following examples show some typical uses of the command.

at Command For example, if your login name is joyce and you have a script named WorkReport that you want to run at midnight, do the following:

Type in the time you want the program to start running.

at midnight

Type the names of the programs to run, pressing Enter after each name. After typing the last name, press the end-of-file character (Ctrl-D) to signal the end of the list.

WorkReport^DAfter pressing Ctrl-D, the system displays information similar to the following:

Page 130: AIX Commands1

job joyce.741502800.a at Fri Jul 6 00:00:00 CDT 1994.The program WorkReport is given the job number joyce.741502800.a and will run at midnight July 6.To list the programs you have sent to be run later, type:at -lThe system displays information similar to the following:joyce.741502800.a Fri Jul 6 00:00:00 CDT 1994To cancel a program you have set up to run later, first list the job numbers assigned to your programs with at -l. Once you know the job number of the program you want to cancel, type:at -r joyce.741502800.aThis cancels job joyce.741502800.a.See the at command in the AIX Version 4.3 Commands Reference for the exact syntax.You can also use the smit at and smit sjat commands to perform this task.

Listing All Scheduled Processes You can list all scheduled processes with the -l flag of the at command or with the atq command. Both commands give the same output, but the atq command can order the processes by the time the at command was issued and can display just the number of processes in the queue. You can list all scheduled processes in the following ways:

With the at command from the command line

With the atq command

For user restrictions on using the at command, see the Note .

at CommandTo list the scheduled processes, type:at -lThis command lists all the scheduled processes in your queue. If you are a root user, this command lists all the scheduled processes for all users. For complete details of the syntax, see the at command.

atq CommandTo list all scheduled processes in the queue, type:atqIf you are a root user, you can list the scheduled processes in a particular user's queue by typing:atq UserNameTo list the number of scheduled processes in the queue, type:atq -n

Removing a Process from the Schedule You can remove a scheduled process with the at command using the -r flag of that command or with the Web-based System Manager fast path. For user restrictions on using the at command, see Note. .

From the Command Line To remove a scheduled process, you must know the process number. You can obtain the process number

using the at -l command or the atq command. See "Listing All Scheduled Processes" for details.

Page 131: AIX Commands1

When you know the number of the process you want to remove, type:

at -r ProcessNumber

Web-based System Manager Fast PathYou can use the Web-based System Manager fast path to remove a process from the schedule. At the prompt, type:wsm processesIn the Processes container, select a process, then use the menus to complete the task. You can also use the smit rmat command to perform this task.

Removing a Background Process (kill Command) If INTERRUPT does not halt your foreground process or if you decide, after starting a background process, that you do not want the process to finish, you can cancel the process with the kill command. Before you can cancel a process using the kill command, you must know its PID number. The general format for the kill command is:kill ProcessID

Note: To remove a process, you must have root user authority or be the user who started the process. The default signal to a process from the kill command is -15 (SIGTERM).

kill Command Use the ps command to determine the process ID of the process you want to remove. You may want to

pipe this command through a grep command to list only the process you want. For example, if you want the process ID of a vi session, you could type:

ps -l | grep vi

In the next example, you issue the find command to run in the background. You then decide to cancel the process. Issue the ps command to list the PID numbers.

$ find / -type f > dir.paths & [1] 21593 $ ps PID TTY TIME COMMAND 1627 pts3 0:00 ps 5461 pts3 0:00 ksh 17565 pts3 0:00 -ksh 21593 pts3 0:00 find / -type f $ kill 21593 $ ps PID TTY TIME COMMAND 1627 pts3 0:00 ps 5461 pts3 0:00 ksh 17565 pts3 0:00 -ksh

[1] + Terminated 21593 find / -type f > dir.paths &The command kill 21593 stops the background find process, and the second ps command returns no status information about PID 21593. The system does not display the termination message until you enter your next command, unless that command is cd.The kill command lets you cancel background processes. You may want to do this if you realize that you have mistakenly put a process in the background or a process is taking too long to run.

Notes:

o Removing a parent process automatically removes all its child processes.

Page 132: AIX Commands1

o To remove a zombie process, you must remove its parent process.

See the kill command in the AIX Version 4.3 Commands Reference for the exact syntax.

Web-based System Manager Fast PathYou can use the Web-based System Manager fast path to cancel a running process. At the prompt, type:wsm processesIn the Processes container, select a process, then use the menus to complete the task. You can also use the smit kill command.

Chapter 4. Input and Output RedirectionThe operating system allows you to manipulate the input and output (I/O) of data to and from your system by using specific I/O commands and symbols. You can control input by specifying the location from which to gather data. For example, you can specify to read input as data is entered on the keyboard (standard input) or to read input from a file. You can control output by specifying where to display or store data. You can specify to write output data to the screen (standard output) or to write it to a file.The operating system, because it is multitasking, is designed to handle processes in combination with each other. This section discusses the advantages of redirecting input and output and tying processes together.This section discusses the following:

Standard Input, Standard Output, and Standard Error

Redirecting Standard Output

Redirecting Output to a File

Redirecting Output and Appending It to a File

Creating a Text File with Redirection from the Keyboard

Concatenating Text Files

Redirecting Standard Input

Discarding Output with the /dev/null File

Redirecting Standard Error and Other Output

Inline Input (Here) Documents

Pipes and Filters

Displaying Program Output and Copying It to a File ( tee command)

Clearing Your Screen ( clear Command)

Sending a Message to Standard Output ( echo Command)

Appending a Single Line of Text to a File ( echo Command)

Copying Your Screen to a File ( capture and script Commands)

Displaying Text in Large Letters on Your Screen ( banner Command)

Page 133: AIX Commands1

Command Summary for Input and Output Redirection

File SystemsA file system is a hierarchical structure (file tree) of files and directories. This type of structure resembles an inverted tree with the roots at the top and the branches at the bottom. This file tree uses directories to organize data and programs into groups, allowing the management of many directories and files at one time. Some tasks are performed more efficiently on a file system than on each directory within the file system. For example, you can back up, move, or secure an entire file system.The basic type of file system is called the Journaled File System (JFS). This file system uses database journaling techniques to maintain its structural consistency. This prevents damage to the file system when the system is halted abnormally.Some of the most important system management tasks have to do with file systems, specifically:

Allocating space for file systems on logical volumes.

Creating file systems.

Making file system space available to system users.

Monitoring file system space usage.

Backing up file systems to guard against data loss if the system fails.

Maintaining file systems in a consistent state.

These tasks should be performed by your system administrator.This section discusses:

File System Types

File System Structure

Showing Space Available on File System ( df Command)

File System TypesThe AIX operating system supports multiple file system types. These include:Journaled File System (JFS) The basic file system type. It supports the entire set of file system

commands. Network File System (NFS) A file system type that permits files residing on remote machines to be

accessed as though they reside on the local machine. CD-ROM File System (CDRFS) A file system type that allows the contents of a CD-ROM to be

accessed through the normal file system interfaces (open, read, and close).

File System Structure On standalone machines, the following file systems reside on the associated devices by default:/dev/hd1 /home

Page 134: AIX Commands1

/dev/hd2 /usr/dev/hd3 /tmp/dev/hd4 /(root)/dev/hd9var /varThe file tree has the following characteristics:

Files that can be shared by machines of the same hardware architecture are located in the /usr file system.

Variable per-client files, for example, spool and mail files, are located in the /var file system.

The /(root) file system contains files and directories critical for system operation. For example, it contains

o A device directory (/dev)

o Mount points where file systems can be mounted onto the root file system, for example, /mnt.

The /home file system is the mount point for users' home directories.

For servers, the /export directory contains paging-space files, per-client (unshared) root file systems, dump, home, and /usr/share directories for diskless clients, as well as exported /usr directories.

The following list provides information about the contents of some of the subdirectories of the /(root) file system./bin Symbolic link to the /usr/bin directory. In prior UNIX file systems, the /bin directory contained

user commands that now reside in /usr/bin in the new file structure./dev Contains device nodes for special files for local devices. The /dev directory contains special files

for tape drives, printers, disk partitions, and terminals./etc Contains configuration files that vary for each machine. Examples include:

/etc/hosts

/etc/passwd

The /etc directory contains the files generally used in system administration. Most of the commands that used to reside in the /etc directory now reside in the /usr/sbin directory. However, for compatibility, it contains symbolic links to the new locations of some executable files. Examples include:

/etc/chown is a symbolic link to the /usr/bin/chown.

/etc/exportvg is a symbolic link to the /usr/sbin/exportvg.

/export Contains the directories and files on a server that are for remote clients. /home Serves as a mount point for a file system containing user home directories. The /home file system

contains per-user files and directories. In a standalone machine, a separate local file system is mounted over the /home directory. In a network, a server might contain user files that should be accessible from several machines. In this case, the server's copy of the /home directory is remotely mounted onto a local /home file system.

/lib Symbolic link to the /usr/lib directory, which contains architecture-independent libraries with names in the form lib*.a.

/sbin Contains files needed to boot the machine and mount the /usr file system. Most of the commands used during booting come from the boot image's RAM disk file system; therefore, very few commands reside in the /sbin directory.

Page 135: AIX Commands1

/tmp Serves as a mount point for a file system that contains system-generated temporary files./u Symbolic link to the /home directory. /usr Serves as a mount point for a file system containing files that do not change and can be shared by

machines (such as executables and ASCII documentation). Standalone machines mount a separate local file system over the /usr directory. Diskless and disk-poor machines mount a directory from a remote server over the /usr file system.

/var Serves as a mount point for files that vary on each machine. The /var file system is configured as a file system since the files it contains tend to grow. For example, it is a symbolic link to the /usr/tmp directory, which contains temporary work files.

Showing Space Available on File System (df Command) The df command displays information about total space and available space on a file system. The FileSystem parameter specifies the name of the device on which the file system resides, the directory on which the file system is mounted, or the relative path name of a file system. If you do not specify the FileSystem parameter, the df command displays information for all currently mounted file systems. If a file or directory is specified, then the df command displays information for the file system on which it resides.Normally, the df command uses free counts contained in the superblock. Under certain exceptional conditions, these counts may be in error. For example, if a file system is being actively modified when the df command is running, the free count may not be accurate.See the df command in the AIX Version 4.3 Commands Reference for the exact syntax.

Note: On some remote file systems, such as Network File Systems (NFS), columns are blank if the server does not provide the information.

For example, to display information about all mounted file systems, enter:dfIf your system is configured so the /, /usr, /site, and /usr/venus directories reside in separate file systems, the output from the df command resembles the following:Filesystem 512-blocks  free   %used   iused %iused  Mounted on/dev/hd4    20480     13780    32%      805   13%     //dev/hd2   385024    15772    95%    27715   28%     /usr/dev/hd9var 40960     38988     4%     115    1%     /var/dev/hd3    20480    18972     7%       81    1%     /tmp/dev/hd1     4096     3724     9%      44    4%     /home For example, to display available space on the file system in which your current directory resides, enter:df .

Access Control ListsAccess control is composed of protected information resources that specify who can be granted access to such resources. The operating system allows for need-to-know or discretionary security. The owner of an information resource can grant other users read or write access rights for that resource. A user who is granted access rights to a resource can transfer those rights to other users. This security allows for user-controlled information flow in the system; the owner of an information resource defines the access permissions to the object.

Page 136: AIX Commands1

Users have user-based access only to the objects they own. Typically, users receive either the group permissions or the default permissions for a resource. The major task in administering access control is to define the group memberships of users, because these memberships determine the users' access rights to the files they do not own.Access control lists (ACLs) increase the quality of file access controls by adding extended permissions that modify the base permissions assigned to individuals and groups. With extended permissions, you can permit or deny file access to specific individuals or groups without changing the base permissions.

Note: The access control list for a file cannot exceed one memory page (approximately 4096 bytes) in size.

Access control lists are maintained by the aclget, acledit, and the aclput commands.Although the chmod command in numeric mode (with octal notations) can set base permissions and attributes, the chmod subroutine, which the command calls, disables extended permissions. If you use the numeric mode of the chmod command on a file that has an ACL, extended permissions are disabled. The symbolic mode of the chmod command does not disable extended permissions. For information on numeric and symbolic mode, refer to the chmod command.

Base Permissions Base permissions are the traditional file access modes assigned to the file owner, file group, and other users. The access modes are: read (r), write (w), and execute/search (x).In an access control list, base permissions are in the following format, with the Mode parameter expressed as rwx (with a dash replacing each unspecified permission): base permissions: owner(name): Mode group(group): Mode others: Mode

AttributesThree attributes can be added to an access control list: setuid (SUID), setgid (SGID), and savetext (SVTX). These attributes are in the following format: attributes: SUID, SGID, SVTX

Extended Permissions Extended permissions give the owner of a file the ability to define access to that file more precisely. Extended permissions modify the base file permissions (owner, group, others) by permitting, denying, or specifying access modes for specific individuals, groups, or user and group combinations. The permit, deny, and specify keywords are defined as follows:permit Grants the user or group the specified access to the file.deny Restricts the user or group from using the specified access to the

file.specify Precisely defines the file access for the user or group.

Page 137: AIX Commands1

If a user is denied a particular access by either a deny or a specify keyword, no other entry can override that access denial.The enabled keyword must be specified in the access control list (ACL) for the extended permissions to take effect. The default value is the disabled keyword. In an ACL, extended permissions are in the following format: extended permissions: enabled | disabled permit Mode UserInfo...: deny Mode UserInfo...: specify Mode UserInfo...:Use a separate line for each permit, deny, or specify entry. The Mode parameter is expressed as rwx (with a dash replacing each unspecified permission). The UserInfo parameter is expressed as u:UserName, or g:GroupName, or a comma-separated combination of u:UserName and g:GroupName.

Note: If more than one user name is specified in an entry, that entry cannot be used in an access control decision, because a process has only one user ID.

Access Control List Example The following is an example of an ACL:attributes: SUIDbase permissions: owner(frank): rw- group(system): r-x others: ---extended permissions: enabled permit rw- u:dhs deny r-- u:chas, g:system specify r-- u:john, g:gateway, g:mail permit rw- g:account, g:financeThe parts of the ACL and their meanings are the following:

The first line indicates that the setuid bit is turned on.

The next line, which introduces the base permissions, is optional.

The next three lines specify the base permissions. The owner and group names in parentheses are for information only. Changing these names does not alter the file owner or file group. Only the chown command and the chgrp command can change these file attributes.

The next line, which introduces the extended permissions, is optional.

The next line specifies that the extended permissions that follow are enabled.

The last four lines are the extended entries. The first extended entry grants user dhs read (r) and write (w) permission on the file.

The second extended entry denies read (r) access to user chas when he is a member of the system group.

The third extended entry specifies that as long as user john is a member of both the gateway group and the mail group, he can have read (r) access. If user john is not a member of both groups, this extended permission does not apply.

Page 138: AIX Commands1

The last extended entry grants any user in both the account group and the finance group read (r) and write (w) permission.

Note: More than one extended entry can be applied to a process, with restrictive modes taking precedence over permissive modes.

See the acledit command in the AIX Version 4.3 Commands Reference for the exact syntax.

Access AuthorizationManaging access rights is the responsibility of the owner of the information resource. Resources are protected by permission bits, which are included in the mode of the object. The permission bits define the access permissions granted to the owner of the object, the group of the object, and for the others default class. The operating system supports three different modes of access (read, write, and execute) that can be granted separately.When a user logs in to an account (using the login or su commands), the user IDs and group IDs assigned to that account are associated with the user's processes. These IDs determine the access rights of the process.For files, directories, named pipes, message queues, shared memory segments, semaphores, and devices (special files), access is authorized as follows:

For each access control entry (ACE) in the access control list (ACL), the identifier list is compared to the identifiers of the process. If there is a match, the process receives the permissions and restrictions defined for that entry. The logical unions for both permissions and restrictions are computed for each matching entry in the ACL. If the requesting process does not match any of the entries in the ACL, it receives the permissions and restrictions of the default entry.

If the requested access mode is permitted (included in the union of the permissions) and is not restricted (included in the union of the restrictions), access is granted; otherwise, it is denied.

A process with a user ID of 0 is known as a root user process. These processes are generally allowed all access permissions. But if a root user process requests execute permission for a program, access is granted only if execute permission is granted to at least one user.The identifier list of an ACL matches a process if all identifiers in the list match the corresponding type of effective identifier for the requesting process. A USER-type identifier matched is equal to the effective user ID of the process, and a GROUP-type identifier matches if it is equal to the effective group ID of the process or to one of the supplementary group IDs. For instance, an ACE with an identifier list such as:USER:fred, GROUP:philosophers, GROUP:yankee_fanswould match a process with an effective user ID of fred and a group set of:philosophers, philanthropists, yankee_fans, good_sportsbut would not match for a process with an effective user ID of fred and a group set of:philosophers, iconoclasts, redsox_fans, poor_sportsNote that an ACE with an identifier list of the following would match for both processes:USER:fred, GROUP:philosophersIn other words, the identifier list in the ACE functions is a set of conditions that must hold for the specified access to be granted.

Page 139: AIX Commands1

All access permission checks for these objects are made at the system call level when the object is first accessed. Since SVIPC objects are accessed statelessly, checks are made for every access. For objects with file system names, it is necessary to be able to resolve the name of the actual object. Names are resolved either relatively (to the process' working directory) or absolutely (to the process' root directory). All name resolution begins by searching one of these.The discretionary access control mechanism allows for effective control of access to information resources and provides for separate protection of the confidentiality and integrity of the information. Owner-controlled access control mechanisms are only as effective as users make them. All users must understand how access permissions are granted and denied and how these are set.

Displaying Access Control Information (aclget Command) You can display the access control information of a file with the aclget command. The information that you view includes attributes, base permissions, and extended permissions.For example, to display the access control information for the status file, enter:aclget statusThe access control information that displays includes a list of attributes, base permissions, and extended permissions. For an example, see Access Control List Example .For example, to save the access control information of the plans file in the acl1 file to edit and use later, enter:aclget -o acl1 plans See the aclget command in the AIX Version 4.3 Commands Reference for the exact syntax.

Setting Access Control Information (aclput Command) You can set the access control information of a file with the aclput command.

Note: The access control list for a file cannot exceed one memory page (approximately 4096 bytes) in size.

For example, to set the access control information for the status file with information stored in the acldefs file, enter:aclput -i acldefs statusFor example, to set the access control information for the status file with the same information used for the plans file, enter:aclget plans | aclput statusSee the aclput command in the AIX Version 4.3 Commands Reference for the exact syntax.

Editing Access Control Information (acledit Command) You can change the access control information of a file with the acledit command. The command displays the current access control information and lets the file owner change it. Before making any changes permanent, the command asks if you want to proceed.

Page 140: AIX Commands1

Note: The EDITOR environment variable must be specified with a complete path name; otherwise, the acledit command will fail.

The access control information that displays includes a list of attributes, base permissions, and extended permissions. For an example, see Access Control List Example .For example, to edit the access control information of the plans file, enter: acledit plansSee the acledit command in the AIX Version 4.3 Commands Reference for the exact syntax.

Locking Your Terminal (lock or xlock Command)You can lock your terminal with the lock command. The lock command requests a password from the user, reads it, and requests the password a second time to verify it. In the interim, the command locks the terminal and does not relinquish it until the password is received the second time. The timeout default value is 15 minutes, but this can be changed with the -Number flag.

Note: If your interface is AIXwindows use the xlock command in the same manner.

For example, to lock your terminal under password control, enter: lockYou are prompted for the password twice so the system can verify it. If the password is not repeated within 15 minutes, the command times out.For example, to reserve a terminal under password control, with a timeout interval of 10 minutes, enter:lock -10See the lock or the xlock command in the AIX Version 4.3 Commands Reference for the exact syntax.

Testing Files for Viruses (virscan Command)The virscan command is designed to detect many common computer viruses. It scans executable files, looking for signatures of viruses known when this version of the program was made available. A signature is a bit-pattern that is found in a particular virus. Virus signatures are obtained by performing "reverse engineering" on virus samples. To find virus signatures, the files that are scanned by the virscan program must be in their native executable form (not encrypted and not packed).

Note: The virscan command does not remove viruses, inhibit virus propagation, or recover any damage caused by viruses to programs or data. If you suspect that your computer system may be infected by a computer virus, contact the appropriate help desk, system administrator, or area information coordinator.

The virscan command scans files looking for bit-patterns matching the virus signatures. There may be viruses that currently exist, or that will exist in the future, that this program will not detect. There is no available, guaranteed solution to the computer virus problem. Therefore, it is recommended that data be backed up regularly and that caution is exercised in acquiring and using software.For example, to scan for viruses in the /usr file system, enter:virscan /usr

Page 141: AIX Commands1

For further information on virscan and to view the online help, enter virscan without any arguments. To display a complete list of the available command-line options, enter:virscan -hSee the virscan command in the AIX Version 4.3 Commands Reference for the exact syntax.

Signature Files Format The virscan command uses the virus signatures found in the virsig.lst and the addenda.lst files, if present, to scan for viruses.In both files, comment lines begin with an asterisk (*). The virscan command does not use these lines in its virus scan. Comment lines are used to give additional, human-readable comments about the information in the signature files.The body of the file consists of entries that tell the virscan command what to do for each virus. Each entry is made up of three lines:

The first entry should consist of a hexadecimal string that the virscan command looks for to determine if a particular virus is contained in the file. The following recommendations are made for signatures:

o Use at least 24 hexadecimal digits (that is, at least 12 bytes) in any signature that is added to the addenda.lst file, and more whenever possible. Shorter signatures have a larger chance of leading to false reports of viruses.

o Take the signature from a code area of the virus, rather than a data area, to minimize the possibility of false alarms.

o Test new signatures against a number of programs before using them widely to ensure that no common programs give false alarms for the signature.

To indicate that a specified byte position in the signature string can have any value, use two question mark characters (??) in place of a pair of hexadecimal characters representing a signature byte. This indicates that the specified byte position in the signature string may have any value. Do not count the ?? bytes when following the signature length guidelines. If a signature string has any ?? substrings in it, no scan for variations on the signature is performed, even if the -m flag is used. If a signature string has any ?? strings in it, any FF values in the signature string will be treated as ?? bytes.

The second entry should contain a message that is displayed if the string is found in the specified files. This message indicates that the virus was found. The text of this message can be in either uppercase or lowercase characters.

The third entry should contain one or more strings that indicate what the virscan command should do if the signature is found. These strings are as follows:

EXE Tells the virscan command that it should display the indicated message if the signature is found in an executable file.

Offset The next string after Offset (delimited by blanks) must be a numeric string and is used as an integer offset into the object file at which the virus signature is expected to be found. If the signature is found elsewhere, the indicated message will not be displayed.

No mutants Tells the virscan command to not search for variations on this virus even when the -m flag is used. If a signature is found to be prone to false alarms when the -m flag is

Page 142: AIX Commands1

used, this string will eliminate the false alarms.For example, suppose that a new virus, called Purple Virus, is discovered. This virus is found to infect executables, and you determined that the following string appears in every copy of the virus:EA6061626364786566676869716A6B6C6D6E516FC0C1C8C958D6F1The following lines could be added to the addenda.lst file to scan for this virus:** Entry for the nonexistent Purple Virus (just an example)*EA6061626364786566676869716A6B6C6D6E516FC0C1C8C958D6F1A file on this disk may have the Purple Virus.(EXE)

Adding Additional Virus Signatures To scan for signatures other than those in the virsig.lst file, perform the following:

Create a file named addenda.lst containing the new signatures.

Place the addenda.lst file in the /usr/lib/security/scan directory so the virscan command can find it. If the virscan command can find the addenda.lst file, it loads it with the virsig.lst file.

Use the -v flag option to verify that virscan is loading the addenda.lst file correctly.

The addenda.lst file follows the same format as the virsig.lst file.

Command Summary for File and System Securityacledit                           Edits the access control information of a file.aclget                           Displays the access control information of a file. aclput                           Sets the access control information of a file. chmod                           Changes permission modes.chown                           Changes the user associated with a file. lock                           Reserves a terminal.lsgroup                           Displays the attributes of groups.virscan                           Scans files for viruses.xlock                           Locks the local X display until a password is

entered.

Security ThreatsThreats to information security arise from three different types of behavior:Carelessness Information security is often violated due to the carelessness of the authorized users of the

system. If you are careless with your password, for instance, no other security mechanisms can prevent unauthorized access to your account and data.

Browsing Many security problems are caused by browsers-authorized users of the system exploring the system looking for carelessly protected data.

Penetration Penetration represents deliberate attacks upon the system. An individual trying to penetrate the system will study it for security vulnerabilities and deliberately plan attacks designed to exploit those weaknesses.

Page 143: AIX Commands1

The last form of behavior usually represents the greatest threat to information security, but problems caused by carelessness or browsing should not be underestimated.

Basic SecurityEvery system should maintain the level of security represented by these basic security policies.

BackupsPhysically secure, reliable, and up-to-date system backups are the single most important security task. With a good system backup, you can recover from any system problems with minimal loss. Your backup policy should be documented and include information regarding:

How often backups will be made.

What types of backups (system, data, or incremental) will be made.

How backup tapes will be verified.

How backup tapes will be stored.

For more information, see "Backup Files and Storage Media" .

Identification and AuthenticationIdentification and authentication establish your identity. You are required to log in to the system. You supply your user name and a password, if the account has one (in a secure system, all accounts should either have passwords or be invalidated). If the password is correct, you are logged in to that account; you acquire the access rights and privilege of the account.Because the password is the only protection for your account, it is important that you select and guard your password carefully. Many attempts to break into a system start with attempts to guess passwords. The operating system provides significant password protection by storing user passwords separately from other user information. The encrypted passwords and other security-relevant data for users are stored in the /etc/security/passwd file. This file should be accessible only by the root user. With this restricted access to the encrypted passwords, an attacker cannot decipher the password with a program that simply cycles through all possible or likely passwords.It is still possible to guess passwords by repeatedly attempting to log in to an account. If the password is trivial or is infrequently changed, such attacks may easily succeed.

Login User IDsThe operating system also identifies users by their login user ID. The login user ID allows the system to trace all user actions to their source. After a user logs in to the system but before running the initial user program, the system sets the login ID of the process to the user ID found in the user database. All subsequent processes during the login session are tagged with this ID. These tags provide a trail of all activities performed by the login user ID.

Page 144: AIX Commands1

The user can reset the effective user ID, real user ID, effective group ID, real group ID, and supplementary group ID during the session, but cannot change the login user ID.

Unattended TerminalsAll systems are vulnerable if terminals are left logged in and unattended. The most serious problem occurs when a system manager leaves a terminal unattended that has been enabled with root authority. In general, users should log off any time they leave their terminals.You can force a terminal to log off after a period of inactivity by setting the TMOUT and TIMEOUT parameters in the /etc/profile file. The TMOUT parameter works in the ksh (Korn) shell, and the TIMEOUT parameter works in the bsh (Bourne) shell. For more information about the TMOUT parameter, see Parameter Substitution in the Korn Shell or POSIX Shell For more information about the TIMEOUT parameter, see Variable and File Name Substitution in the Bourne ShellThe following example, taken from a .profile file, forces the terminal to log off after an hour of inactivity:TO=3600echo "Setting Autologout to $TO"TIMEOUT=$TOTMOUT=$TOexport TIMEOUT TMOUT

Note: Users can override the TMOUT and TIMEOUT values in the /etc/profile file by specifying different values in the .profile file in your home directory.

Chapter 8. Backup Files and Storage MediaOnce your system is in use, your next consideration should be to back up the file systems, directories, and files. Files and directories represent a significant investment of time and effort. At the same time, all computer files are potentially easy to change or erase, either intentionally or by accident. If you take a careful and methodical approach to backing up your file systems, you should always be able to restore recent versions of files or file systems with little difficulty.

Note: When a hard disk crashes, the information contained on that disk is destroyed. The only way to recover the destroyed data is to retrieve the information from your backup copy.

There are several different methods of backing up. The most frequently used method is a regular backup, which is a copy of a file system, directory, or file that is kept for file transfer or in case the original data is unintentionally changed or destroyed. Another form of backing up is the archive backup; this method is used for a copy of one or more files, or an entire database that is saved for future reference, historical purposes, or for recovery if the original data is damaged or lost. Usually an archive is used when that specific data is removed from the system.This section discusses:

Backup Policy

o Backup Media

Formatting Diskettes ( format or fdformat Command)

Page 145: AIX Commands1

Checking the Integrity of the File System ( fsck Command)

Copying to or from Diskettes ( flcopy Command)

Copying Files to Tape or Disk ( cpio -o Command)

Copying Files from Tape or Disk ( cpio -i Command)

Copying to or from Tapes ( tcopy Command)

Checking the Integrity of a Tape ( tapechk Command)

Compressing Files ( compress and pack Commands)

Expanding Compressed Files ( uncompress and unpack Commands)

Backing Up Files ( backup Command)

Restoring Backed-Up Files ( restore Command)

Archiving Files ( tar Command)

Command Summary for Backup Files and Storage Media

Backup PolicyNo single backup policy can meet the needs of all users. A policy that works well for a system with one user, for example, could be inadequate for a system that serves 5 or 10 different users. Likewise, a policy developed for a system on which many files are changed daily would be inefficient for a system on which data changes infrequently. Only you can determine the best backup policy for your system, but the following general guidelines should help:Make sure you can recover from major losses.Can your system continue to run after any single fixed disk fails? Can you recover your system if all the fixed disks should fail? Could you recover your system if you lost your backup diskettes or tape to fire or theft? Although these things are not likely, any of them are possible. Think through each of these possible losses and design a backup policy that would enable you to recover your system after any of them.Check your backups periodically.Backup media and its hardware can be unreliable. A large library of backup tapes or diskettes is useless if their data cannot be read back onto a fixed disk. To make certain that your backups are usable, try to display the table of contents from the backup tape periodically (using restore -T, or tar -t for archive tapes). If you use diskettes for your backups and have more than one diskette drive, try to read diskettes from a different drive than the one on which they were created. You also may want the security of repeating each level 0 backup with a second set of diskettes. If you use a streaming tape device for backups, you can use the tapechk command to perform rudimentary consistency checks on the tape. Keep old backups.Develop a regular cycle for reusing your backup media; however, you should not reuse all of your backup media. Sometimes it may be months before you or some other user of your system notices that an important file

Page 146: AIX Commands1

is damaged or missing. You should save old backups for such possibilities. For example, you could have the following three cycles of backup tapes or diskettes:

Once per week, recycle all daily diskettes except the one for Friday.

Once per month, recycle all Friday diskettes except for the one from the last Friday of the month. This makes the last four Friday backups always available.

Once per quarter, recycle all monthly diskettes except for the last one. Keep the last monthly diskette from each quarter indefinitely, perhaps in a different building.

Check file systems before backing them up.A backup that was made from a damaged file system may be useless. Before making your backups, it is good policy to check the integrity of the file system with the fsck command.Ensure files are not in use during a backup.Your system should not be in use when you make your backups. If the system is in use, files can change while they are being backed up, and the backup copy will not be accurate.Back up your system before major changes are made to the system.It is always good policy to back up your entire system before any hardware testing or repair work is performed or before you install any new devices, programs, or other system features.Other FactorsOther items to consider when planning and implementing a backup strategy are:

How often does the data change? As pointed out earlier, the operating system data does not change very often so you do not need to back it up frequently. User data, on the other hand, usually changes frequently and you should back it up frequently.

How many users are on the system? The number of users would affect the amount of storage media and frequency required for backups.

How difficult would it be to recreate the data? It is important to consider that some data cannot be recreated if there is not a backup.

Whatever the appropriate backup strategy for your site, it is very important that one exists. Backups should be done frequently and regularly. Recovering from data loss is very difficult if a good backup strategy has not been implemented.

Backup MediaSeveral different types of backup media are available for backups. The different types of backup media available to your specific system configuration depend upon both your software and hardware. The types most frequently used are the 5.25-inch diskette, 8-mm tape, 9-track tape, and the 3.5-inch diskette.

Attention: Running the backup command results in the loss of all material previously stored on the selected output medium.

The following shows different types of backup media.

Page 147: AIX Commands1

DiskettesDiskettes are the standard backup medium. Unless you specify a different device using the backup -f command, the backup command automatically writes its output to the /dev/rfd0 device, which is the diskette drive. To back up to the default tape device, enter /dev/rmt0. Be careful with your diskettes. Because each piece of information occupies such a small area on the diskette, small scratches, dust, food, or tobacco particles can make the information unusable. Be sure to remember the following:

Do not touch the recording surfaces.

Keep diskettes away from magnets and magnetic field sources such as telephones, dictation equipment, and electronic calculators.

Keep diskettes away from extreme heat and cold. The recommended temperature range is 10 degrees Celsius to 60 degrees Celsius (50 degrees Fahrenheit to 140 degrees Fahrenheit).

Proper care helps prevent loss of information.

Make back-up copies of your diskettes regularly.

Attention: Diskette drives and diskettes must be the correct type to store data successfully. If you use the wrong diskette in your 3.5-inch diskette drive, the data on the diskette could be destroyed.

The diskette drive uses the following 3.5-inch diskettes: 1MB capacity (stores approximately 720KB of data)

2MB capacity (stores approximately 1.44MB of data).

Tapes Tape is well-suited to certain tasks because of its high capacity and durability. It is often chosen for storing large files or many files, such as archive copies of file systems. It is also used for transferring many files from one system to another. Tape is not widely used for storing frequently accessed files because other media provide much faster access times.Tape files are created using commands such as backup, cpio, and tar, which open a tape drive, write to it, and close it.

Formatting Diskettes (format or fdformat Command)Attention: Formatting a diskette destroys any existing data on that diskette.

You can format diskettes in the diskette drive specified by the Device parameter (the /dev/rfd0 device by default) with the format and fdformat commands. The format command determines the device type, which is one of the following:

5.25-inch low-density diskette (360KB) containing 40x2 tracks, each with 9 sectors

5.25-inch high-capacity diskette (1.2MB) containing 80x2 tracks, each with 15 sectors

3.5-inch low-density diskette (720KB) containing 80x2 tracks, each with 9 sectors

3.5-inch high-capacity diskette (2.88MB) containing 80x2 tracks, each with 36 sectors.

Page 148: AIX Commands1

The sector size is 512 bytes for all diskette types.The format command formats a diskette for high density unless the Device parameter specifies a different density. The fdformat command formats a diskette for low density unless the -h flag is specified. The Device parameter specifies the device containing the diskette to be formatted (such as the /dev/rfd0 device for drive 0). Before formatting a diskette, the format and fdformat commands prompt for verification. This allows you to end the operation cleanly if necessary.For example, to format a diskette in the /dev/rfd0 device, enter:format -d /dev/rfd0For example, to format a diskette without checking for bad tracks, enter:format -fFor example, to format a 360KB diskette in a 5.25-inch, 1.2MB diskette drive in the /dev/rfd1 device, enter:format -l -d /dev/rfd1For example, to force high-density formatting of a diskette when using the fdformat command, enter:fdformat -hSee the format command in the AIX Version 4.3 Commands Reference for the exact syntax.

Checking the Integrity of the File System (fsck Command)You can check and interactively repair inconsistent file systems with the fsck command. It should be run on every file system as part of system initialization. You must be able to read the device file on which the file system resides (for example, the /dev/hd0 device). Normally, the file system is consistent, and the fsck command merely reports on the number of files, used blocks, and free blocks in the file system. If the file system is inconsistent, the fsck command displays information about the inconsistencies found and prompts you for permission to repair them. The fsck command is conservative in its repair efforts and tries to avoid actions that might result in the loss of valid data. In certain cases, however, the fsck command recommends the destruction of a damaged file.

Attention: Always run the fsck command on file systems after a system malfunction. Corrective actions may result in some loss of data. The default action for each consistency correction is to wait for the operator to enter yes or no. If you do not have write permission for an affected file, the fsck command defaults to a no response in spite of your actual response.

For example, to check all the default file systems, enter:fsckThis form of the fsck command asks you for permission before making any changes to a file system.For example, to fix minor problems with the default file systems automatically, enter:fsck -pFor example, to check the file system /dev/hd1, enter:fsck /dev/hd1This checks the unmounted file system located on the /dev/hd1 device.

Page 149: AIX Commands1

Note: The fsck command will not make corrections to a mounted file system.

See the fsck command in the AIX Version 4.3 Commands Reference for the exact syntax.

Copying to or from Diskettes (flcopy Command)You can copy a diskette (opened as /dev/rfd0) to a file named floppy created in the current directory with the flcopy command. The message: Change floppy, hit return when done appears as needed. The flcopy command then copies the floppy file to the diskette. For example, to copy /dev/rfd1 to the floppy file in the current directory, enter:flcopy -f /dev/rfd1 -rFor example, to copy the first 100 tracks of the diskette, enter:flcopy -f /dev/rfd1 -t 100See the flcopy command in the AIX Version 4.3 Commands Reference for the exact syntax.

Copying Files to Tape or Disk (cpio -o Command)You can read file path names from standard input and copy these files to standard output, along with path names and status information with the cpio -o command. Path names cannot exceed 128 characters. Avoid giving the cpio command path names made up of many uniquely linked files, as it may not have enough memory to keep track of them and would lose linking information.For example, to copy files in the current directory whose names end with .c onto diskette, enter:ls *.c | cpio -ov >/dev/rfd0The -v flag displays the names of each file.For example, to copy the current directory and all subdirectories onto diskette, enter:find . -print | cpio -ov >/dev/rfd0This saves the directory tree that starts with the current directory (.) and includes all of its subdirectories and files. Do this faster by entering:find . -cpio /dev/rfd0 -printThe -print entry displays the name of each file as it is copied.See the cpio command in the AIX Version 4.3 Commands Reference for the exact syntax.

Copying Files from Tape or Disk (cpio -i Command)The cpio -i command reads from standard input an archive file created by the cpio -o command and copies from it the files with names that match the Pattern parameter. These files are copied into the current directory tree. You can list more than one Pattern parameter, using the file name notation described in the ksh command. The default for the Pattern parameter is an * (asterisk), selecting all files in the current directory. In an expression such as [a-z], the minus sign means through according to the current collating sequence.

Note: The patterns "*.c" and "*.o" must be enclosed in quotation marks to prevent the shell from treating the * (asterisk) as a pattern-matching character. This is a special case in which the cpio command itself decodes the pattern-matching characters.

Page 150: AIX Commands1

For example, to list the files that have been saved onto a diskette with the cpio command, enter:cpio -itv </dev/rfd0This displays the table of contents of the data previously saved onto the /dev/rfd0 file in the cpio command format. The listing is similar to the long directory listing produced by the li -l command. To list only the file path names, use only the -it flags.For example, to copy the files previously saved with the cpio command from a diskette, enter:cpio -idmv </dev/rfd0This copies the files previously saved onto the /dev/rfd0 file by the cpio command back into the file system (specify the -i flag). The -d flag allows the cpio command to create the appropriate directories if a directory tree is saved. The -m flag maintains the last modification time in effect when the files are saved. The -v flag causes the cpio command to display the name of each file as it is copied.For example, to copy selected files from diskette, enter:cpio -i "*.c" "*.o" </dev/rfd0This copies the files that end with .c or .o from diskette. See the cpio command in the AIX Version 4.3 Commands Reference for more information and the exact syntax.

Copying to or from Tapes (tcopy Command)You can copy magnetic tapes with the tcopy command.For example, to copy from one streaming tape to a 9-track tape, enter:tcopy /dev/rmt0 /dev/rmt8See the tcopy command in the AIX Version 4.3 Commands Reference for the exact syntax.

Checking the Integrity of a Tape (tapechk Command) You can perform rudimentary consistency checking on an attached streaming tape device with the tapechk command. Some hardware malfunctions of a streaming tape drive can be detected by simply reading a tape. The tapechk command provides a way to perform tape reads at the file level.For example, to check the first three files on a streaming tape device, enter:tapechk 3See the tapechk command in the AIX Version 4.3 Commands Reference for the exact syntax.

Compressing Files (compress and pack Commands)You can compress files for storage with the compress and pack commands, and use the uncompress and unpack commands to expand the restored files. The process of compressing and expanding files takes time but, once packed, the data uses less space on the backup medium.There are several methods of compressing a file system:

Use the -p option with the backup command.

Use the compress or pack commands.

Page 151: AIX Commands1

There are many reasons for compressing files, but generally they fall into two categories:

Saving storage and archiving system resources:

o Compress file systems before doing backups to preserve tape space.

o Compress log files created by shell scripts that run at night; it is easy to have the script compress the file before it exits.

o Compress files that are not currently being accessed. For example, the files belonging to a user who is away for extended leave can be compressed and placed into a tar archive on disk or to a tape and later be restored.

Saving money and time by compressing files before sending them over a network.

Notes:

o The command might run out of working space in the file system while compressing. The compress command creates the compressed files before it deletes any of the uncompressed files so it needs a space about 50% larger than the total size of the files.

o A file might fail to compress because it is already compressed. If the compress command cannot reduce file sizes, it fails.

compress CommandThe compress command reduces the size of files using adaptive Lempel-Zev coding. Each original file specified by the File parameter is replaced by a compressed file with a .Z appended to its name. The compressed file retains the same ownership, modes, and access and modification times of the original file. If no files are specified, the standard input is compressed to the standard output. If compression does not reduce the size of a file, a message is written to standard error and the original file is not replaced. Compressed files can be restored to their original form using the uncompress command.The amount of compression depends on the size of the input, the number of bits per code specified by the Bits variable, and the distribution of common substrings. Typically, source code or English text is reduced by 50 to 60 percent. The compression of the compress command is generally more compact and takes less time to compute than the compression achieved by the pack command which uses adaptive Huffman coding.For example, to compress the foo file and write the percentage compression to standard error, enter:compress -v fooSee the compress command in theAIX Version 4.3 Commands Reference for the exact syntax.

pack CommandThe pack command stores the file or files specified by the File parameter in a compressed form using Huffman coding. The input file is replaced by a packed file with a name derived from the original file name (File.z), with the same access modes, access and modification dates, and owner as the original file. The input file name can contain no more than 253 bytes to

Page 152: AIX Commands1

allow space for the added .z suffix. If the pack command is successful, the original file is removed. Packed files can be restored to their original form using the unpack command.If the pack command cannot create a smaller file, it stops processing and reports that it is unable to save space. (A failure to save space generally happens with small files or files with uniform character distribution.) The amount of space saved depends on the size of the input file and the character frequency distribution. Because a decoding tree forms the first part of each .z file, you do not save space with files smaller than three blocks. Typically, text files are reduced 25 to 40 percent.The exit value of the pack command is the number of files that it could not pack. Packing is not done under any of the following conditions:

The file is already packed.

The input file name has more than 253 bytes.

The file has links.

The file is a directory.

The file cannot be opened.

No storage blocks are saved by packing.

A file called File.z already exists.

The .z file cannot be created.

An I/O error occurred during processing.

For example, to compress the files chap1 and chap2, enter:pack chap1 chap2This compresses chap1 and chap2, replacing them with files named chap1.z and chap2.z. The pack command displays the percent decrease in size for each file.See the pack command in theAIX Version 4.3 Commands Reference for more information and the exact syntax.

Expanding Compressed Files (uncompress and unpack Commands)You can expand compressed files with the uncompress and unpack commands.

uncompress CommandThe uncompress command restores original files that were compressed by the compress command. Each compressed file specified by the File variable is removed and replaced by an expanded copy. The expanded file has the same name as the compressed version, but without the .Z extension. The expanded file retains the same ownership, modes, and access and modification times as the original file. If no files are specified, standard input is expanded to standard output.Although similar to the uncompress command, the zcat command always writes the expanded output to standard output.

Page 153: AIX Commands1

For example, to uncompress the foo file, enter:uncompress fooSee the uncompress command in theAIX Version 4.3 Commands Reference for the exact syntax.

unpack CommandThe unpack command expands files created by the pack command. For each file specified, the unpack command searches for a file called File.z. If this file is a packed file, the unpack command replaces it by its expanded version. The unpack command renames the new file by removing the .z suffix from File. The new file has the same access modes, access and modification dates, and owner as the original packed file.The unpack command operates only on files ending in .z. As a result, when you specify a file name that does not end in .z, the unpack command adds the suffix and searches the directory for a file name with that suffix.The exit value is the number of files the unpack command was unable to unpack. A file cannot be unpacked if any of the following occurs:

The file name (exclusive of .z) has more than 253 bytes.

The file cannot be opened.

The file is not a packed file.

A file with the unpacked file name already exists.

The unpacked file cannot be created.

Note: The unpack command writes a warning to standard error if the file it is unpacking has links. The new unpacked file has a different i-node than the packed file from which it was created. However, any other files linked to the original i-node of the packed file still exist and are still packed.

For example, to unpack the packed files chap1.z and chap2, enter:unpack chap1.z chap2This expands the packed files chap1.z and chap2.z, and replaces them with files named chap1 and chap2. Note that you can give the unpack command file names either with or without the .z suffix.See the unpack command in the AIX Version 4.3 Commands Reference for the exact syntax.

unpack CommandPurposeExpands files.

Syntaxunpack File ...

DescriptionThe unpack command expands files created by the pack command. For each file specified, the unpack command searches for a file called File.z. If this file is a packed file, the unpack command replaces it by its expanded version. The unpack command names the new file name by removing

Page 154: AIX Commands1

the .z suffix from File. If the user has root authority, the new file has the same access modes, access and modification times, owner, and group as the original file. If the user does not have root authority, the file retains the same access modes, access time, and modification time, but acquires a new owner and group.The unpack command operates only on files ending in .z. As a result, when you specify a file name that does not end in .z, the unpack command adds the suffix and searches the directory for a file name with that suffix.The exit value is the number of files the unpack command was unable to unpack. A file cannot be unpacked if any of the following occurs:

The file name (exclusive of .z) has more than 253 bytes.

The file cannot be opened.

The file is not a packed file.

A file with the unpacked file name already exists.

The unpacked file cannot be created.

Note: The unpack command writes a warning to standard error if the file it is unpacking has links. The new unpacked file has a different i-node than the packed file from which it was created. However, any other files linked to the original i-node of the packed file still exist and are still packed.

Exit StatusThis command returns the following exit values:0 The command ran successfully.>0 An error occurred.

ExampleTo unpack packed files:unpack chap1.z chap2This expands the packed files chap1.z and chap2.z, and replaces them with files named chap1 and chap2. Note that you can give the unpack command file names either with or without the .z suffix.

Files/usr/bin/unpack Contains the unpack command.

Related InformationThe cat command, compress command, pack command.Files Overview in AIX Version 4.3 System User's Guide: Operating System and Devices.

Backing Up Files (backup Command)Attention: If you attempt to back up a mounted file system a message is displayed. The backup command continues, but inconsistencies in the file system may occur. This situation does not apply to the root (/) file system.

You can create copies of your files on a backup medium, such as a magnetic tape or diskette, with the backup or smit commands. The copies are in one of the two following backup formats:

Specific files backed up by name, using the -i flag.

Page 155: AIX Commands1

Entire file system backed up by i-node number, using the -Level and Filesystem parameters.

Notes:

o There is always the possibility of data corruption when a file is modified during system backup. Therefore, system activity should be at a minimum during the system backup procedure.

o If a backup is made to 8-mm tape with the device block size set to 0 (zero), it is not possible to directly restore from the tape. If you have done backups with the 0 setting, you can restore from them by using special procedures described under the restore command.

Attention: Be sure the flags you specify match the backup medium. Also, if you attempt to back up a mounted file system, inconsistencies may occur.

backup CommandFor example, to back up selected files in your $HOME directory by name, enter:find $HOME -print | backup -i -vThe -i flag prompts the system to read from standard input the names of files to be backed up. The find command generates a list of files in the user's $HOME directory. This list is piped to the backup command as standard input. The -v flag displays a progress report as each file is copied. The files are backed up on the default backup device for the local system.For example, to back up the root file system, enter:backup -0 -u /The 0 level and the / tell the system to back up the / (root) file system. The file system is backed up to the /dev/rfd0 file. The -u flag tells the system to update the current backup level record in the /etc/dumpdates file.For example, to back up all files in the / (root) file system modified since the last 0 level backup, enter:backup -1 -u /See the backup command in the AIX Version 4.3 Commands Reference for the exact syntax.

smit Command The backup command can also be done using smit.

At the prompt, enter:

smit backup

Enter the path name of the directory on which the file system is normally mounted in the DIRECTORY full pathname field:

/home/bill

In the BACKUP device or FILE fields, enter the output device name as in the following example for a raw magnetic tape device:

/dev/rmt0

Use the Tab key to toggle the optional REPORT each phase of the backup field if you want error messages printed to the screen.

In a system management environment, use the default for the MAX number of blocks to write on backup medium field because this field does not apply to tape backups.

Press Enter to back up the named directory or file system.

Page 156: AIX Commands1

Run the restore -t command. If this command generates an error message, you must repeat the entire backup.

Restoring Backed-Up Files (restore Command)You can read files written by the backup command from a backup medium and restore them on your local system with the restore or smit commands.

Notes:

Files must be restored using the same method by which they were backed up. For example, if a file system was backed up by name, it must be restored by name.

When more than one diskette is required, the restore command reads the one mounted, prompts you for a new one, and waits for your response. After inserting the new diskette, press the Enter key to continue restoring files.

restore CommandFor example, to list the names of files previously backed up, enter:restore -TInformation is read from the /dev/rfd0 default backup device. If individual files are backed up, only the file names are displayed. If an entire file system is backed up, the i-node number is also shown.For example, to restore files to the main file system, enter:restore -x -vThe -x flag extracts all the files from the backup medium and restores them to their proper places in the file system. The -v flag displays a progress report as each file is restored. If a file system backup is being restored, the files are named with their i-node numbers. Otherwise, just the names are displayed.For example, to copy the file /home/mike/manual/chap1 , enter:restore -xv /home/mike/manual/chap1This command extracts the /home/mike/manual/chap1 file from the backup medium and restores it. The /home/mike/manual/chap1 file must be a name that can be displayed by the restore -T command.For example, to copy all the files in a directory named manual, enter:restore -xdv manualThis command restores the manual directory and the files in it. If it does not exist, a directory named manual is created in the current directory to hold the files being restored.See the restore command in the AIX Version 4.3 Commands Reference for the exact syntax.

smit Command The restore command can also be done using smit.

At the prompt, enter:

smit restore

Make your entry in the Target DIRECTORY field. This is the directory where you want the restored files to reside.

Proceed to the BACKUP device or FILE field and enter the output device name as in the following example for a raw magnetic tape device:

/dev/rmt0

Page 157: AIX Commands1

If the device is not available, a message similar to the following is displayed: Cannot open /dev/rmtX, no such file or directory.This message indicates that the system cannot reach the device driver because there is no file for rmtX in the /dev directory. Only items in the available state are in /dev.

For the NUMBER of blocks to read in a single input field, the default is recommended.

Press Enter to restore the specified file system or directory.

Archiving Files (tar Command)You can write files to or retrieve files from an archive storage with the tar command. The tar command looks for archives on the default device (usually tape), unless you specify another device.When writing to an archive, the tar command uses a temporary file (the /tmp/tar* file) and maintains in memory a table of files with several links. You receive an error message if the tar command cannot create the temporary file or if there is not enough memory available to hold the link tables.For example, to write the file1 and file2 files to a new archive on the default tape drive, enter:tar -c file1 file2For example, to extract all files in the /tmp directory from the archive file on the /dev/rmt2 tape device and use the time of extraction as the modification time, enter:tar -xm -f/dev/rmt2 /tmpFor example, to display the names of the files in the out.tar disk archive file from the current directory, enter:tar -vtf out.tarSee the tar command in the AIX Version 4.3 Commands Reference for more information and the exact syntax.

Command Summary for Backup Files and Storage Mediabackup                           Backs up files and file systems. compress                           Compresses and expands data. cpio                           Copies files into and out of archive storage and directories. fdformat                           Formats diskettes.flcopy                           Copies to and from diskettes. format                           Formats diskettes.fsck                           Checks file system consistency and interactively repairs the file system. pack                           Compresses files.restore                           Copies previously backed-up file systems or files, created by the backup command, from

a local device.tapechk                           Performs consistency checking of the streaming tape device.tar

Page 158: AIX Commands1

                          Manipulates archives. tcopy                           Copies a magnetic tape. uncompress                           Compresses and expands data. unpack                           Expands files.

Thanks for the lparstat command- I was not aware of that.

Here's what I've created so far to pull LPAR and other HMC informationfrom HMCs using ssh:

-------------------------------------------------------------------#!/bin/ksh################################################# Gather Data from ALL HMCs# Account for P4 vs P5# Jan 2, 2007 - pablo clifton## ALL CS HMCs:  P4: 10.1.2.11 10.1.32.11 10.1.207.11 10.1.231.100#               P5: 10.1.231.99 10.1.31.99################################################

DATE=`date +%m-%d-%Y`HMCDIR=/usr/local/HMC/DATAOFILE=$HMCDIR/lparlist.$DATERFILEXT=lpar_resources.$DATEHMCFILE=$HMCDIR/HMCconfig.$DATEwfile=/tmp/lpars.$$

> $OFILE> $HMCFILE

################## P4 HMCs#################for i in  10.1.2.11 10.1.32.11 10.1.207.11 10.1.231.100doecho "========== $i =========="       ##########################       # Gather Managed Systems and LPAR info for each HMC       ##########################       # SYSTEM ##       ssh -l hscroot $i "lssyscfg -r sys --all -Fname:model:serial_number" > $wfile       awk -F: '{print $1 "  " $2}' < $wfile       for SYS in `cat $wfile | awk -F: '{print $1}'`       do       echo "\nSYSTEM: $SYS:"               MODEL=`grep -w $SYS $wfile | awk -F: '{print $2}'`               SN=`grep -w $SYS $wfile | awk -F: '{print $3}'`               ##########               ## LPAR ##               ##########               for LPAR in `ssh -l hscroot $i "lssyscfg -r lpar -m $SYS--all -F name"`               do                       echo    "$i:$SYS:$MODEL:$SN:$LPAR"               done

       ##########################

Page 159: AIX Commands1

       # Gather RESOURCE INFO       ##########################       RESFILE=$HMCDIR/$SN.$RFILEXT       > $RESFILE

       echo "SYSTEM: $SYS   $MODEL  $SN  $i" >> $RESFILE

       echo "\n$SYS: LPAR Status" >> $RESFILE       ssh -l hscroot $i "lssyscfg -r lpar -m $SYS --all" >> $RESFILE

       echo "\n$SYS: CPU Assignment Summary" >> $RESFILE       ssh -l hscroot $i "lshwres -r cpu -m $SYS --all -Fpartition_name:allocated" >> $RESFILE

       echo "\n$SYS: CPU Detailed Assignment" >> $RESFILE       ssh -l hscroot $i "lshwres -r cpu -m $SYS" >> $RESFILE

       echo "\n$SYS: MEM Assignment Summary" >> $RESFILE       ssh -l hscroot $i "lshwres -r mem -m $SYS --all -Fpartition_name:lmb_size:allocated" |grep -v null|perl -F: -ane'$mem=$F[1]*$F[2]; print "Partition $F[0] has $mem MB allocated.\n"'  >>$RESFILE

       echo "\n$SYS: IO Slot Assignment" >> $RESFILE       ssh -l hscroot $i "lshwres -r slot -m $SYS -Fphys_loc:slot_type:assigned_to" >> $RESFILE

       echo "\n$SYS: Detailed LPAR Profiles" >> $RESFILE       ssh -l hscroot $i "lssyscfg -r lpar -m $SYS --all -z" >>$RESFILE

       echo"===================================================================\n\n" >> $RESFILE

       done

########################### Gather General HMC Info##########################echo $i >> $HMCFILEssh -l hscroot $i "lshmc -v" >> $HMCFILEssh -l hscroot $i "lshmc -n" >> $HMCFILEssh -l hscroot $i "lshmc -r" >> $HMCFILEssh -l hscroot $i "lshmcusr -u ALL" >> $HMCFILE

echo "\n\n" >> $HMCFILE

echo "\n\n"done | tee -a $OFILE

#===================================================================================#

Added by Nigel Griffiths, last edited by Peter Kuchar on Feb 22, 2006  

Page 160: AIX Commands1

LVM TheoryPhysical Volume = PV is IBM speak for a disk (it could be worse some IBMers still refer to DASD! (Dyanical Access Storage Device which is a main frame term). They are:

Named by AIX as hdisk0, hdisk1, hdisk2, ...

Regardless of the underlying technology (SCSI, SSA sort of IBM's early SAN, SAN, RAID5 using the adapter)

Disk and AIX automatic bad block reallocation

Volume Group = VG is IBM speak for a group of disksVolume Group operations:

Disk space always allocated within single VG

All disks available in AIX or none - work as a group

Can be exported to be attached to other AIX - allows High Availability HACMP

First VG called rootvg

Root Volume Group (rootvg) is created automatically while installing AIX is placed within this VG

AIX files

Initial paging

Usually only the first disk

Or two too allow mirroring of rootvg

Often internal disks

Recommend: Keep to a small number of disks

Other Volume Groups Other VG created by the System Admin.

Name typically related to their use

Optionally ending in "vg"

Volume Groups One or more disks

Can later add a disk to a VG

Can remove disk from VG - if empty

Disks within VG cut into chunks called

Physical Partitions (PP)

Minimum allocation unit

Typically, 8, 16 or 32 MB (older 2GB disks = 4 MB)

Nothing smaller can be allocated

Page 161: AIX Commands1

Each VG fixed PP size.

Volume group has total, free and used PPs*Disks do not need to be the same size or even the same technology

Logical Volumes It is a large piece of disk

Can be used for lots of tasks like

raw device or file system or paging space

Created within single VG

LV has many attributes like:

o can be one disk or more disks or all disks of VG

o mirrored or striped

o particular part of disk

o Sizes is in Physical Partitions - example: id PP = 16 MB and LV size of 64 PPs = 1 GBPPs allocated by policies

min or max spread across disks

min=fill disk then move on, max=evenly spread

disk placement centre, middle, edge

mirrors via extra copies

stripes via stripe width

MWC (Mirrored write consistancy) and others

Logical Volumes Admin Can be grown in size

Can be removed

Can be moved to different disks within VG

Can later have a filesystem created in it

Attributes can be changed like: mirror added or removed or policy changed

How AIX/LVM sees the underlying disks

LVM in practiceThe disks can be apprached from three different directions and from there you can see the relationship to the others.As a reminder

Page 162: AIX Commands1

pv = physical volumes - real disk or LUN

lv = logical volume

vg volume group

To the this use the ls<thing> commands: lspv

lslv

lsvg

In more detail Lists volume group names: lsvg

o List VG details: lsvg <vgname>

o List LVs within VG: lsvg -l <vgname>

o List PV within VG: lsvg -p <vgname>

Lists physical group names: lspv

o List PV details: lspv hdiskN

o List LVs within PV: lspv -l hdiskN

o List PP within PV: lspv -p hdiskN

Lists LV names: lsvg -l <vgname>

o List LV details: lslv <lvname>

o List LVs within PV: lslv -l <lvname>

o List PP within PV: lslv -p <pvname>

o Show mirrored LV: lslv -m <lvname>

When you create a Logical Volume with smitty you will see a panel like this:smitty create logical partitionAdd a Logical VolumeLogical volume NAME [scratch] VOLUME GROUP name testvg Number of LOGICAL PARTITIONS [64] # PHYSICAL VOLUME names [hdisk1 hdisk2 hdisk3] + Logical volume TYPE [jfs] POSITION on physical volume middle + RANGE of physical volumes minimum + MAXIMUM NUMBER of PHYSICAL VOLUMES [] # to use for allocation Number of COPIES of each logical 2 + partition Mirror Write Consistency? yes + Allocate each logical partition copy yes + on a SEPARATE physical volume? RELOCATE the logical volume during yes +

Page 163: AIX Commands1

reorganization? Logical volume LABEL [] MAXIMUM NUMBER of LOGICAL PARTITIONS [512] # Enable BAD BLOCK relocation? yes + SCHEDULING POLICY for reading/writing parallel + logical partition copies Enable WRITE VERIFY? no +

Some of the terms used are described below:

Mirrors

On the disk placement

Mirror Scheduling Policy

Mirror Write Consistency If you are terribly and extremely unlucky ... a crash could happen leaving the two mirrored copies of a block different.Reading the block could give you the old or new block.With a RDBMS, it does not mind disk is newer but must be consist when read.MWC reminds LVM to "resilver" these recently written blocks in recovery - to make them the same.

Physical Partition (PP) Allocation

Logical Volumes striping From AIX 4.3.3 (not backward compatible) LVM support striping

Often called fine striping (i.e. not PP level striping)

Recommend 32K, 64K or 128K stripe width = 4 to 16 times I/O size most databases do 4K or 8K I/O

Excellent for balancing serial and random I/O across disks

Excellent read ahead serial I/O boost

Using LVM commands (with smit) Find unused disks: lspv

Add them to a VG or create a VG: smitty lvm + VG + Add VG

Check unused space in VG: lsvg <vgname>

Create a LV: smitty lvm + LV + Add LV

Create a Filesystem (JFS)smitty jfs + Add jfs + standard + which VG (see below)

If the command changes the VG, PV or LV then the VG is locked i.e. one command at a time.

Page 164: AIX Commands1

This is needed to allow recovery of the change - if the system fails during the update.

Creating Stripes Tips: Stripes LV must contain a whole number of items, that is the number of PPs must divide evenly into the

number of disks

Or put another way: each disk have the same number of PPs

Hint: use multiples of No. of disks to make this easier

LVM Create MirrorsThere are three ways to create a mirror:

One Step = create LV with mirror

o These can be slow as you can have to wait until mirror complete before creating next lv

Create LV and later add mirror synchronise=yes

o again slow as you can have to wait for silvering#Create LV and later add mirror synchronise=no and then sychronise all mirrors together

o Use this when creating lots of lv because all mirrors can be created at the same time

So (with smit) create lv's

add mirrors sync=no

syncvg -l <lvname>to remove "stale" partitions = resilverWarning:

resilvering hurts performance

often forgotten when recommending mirror breaking for backup purposes

LVM Higher Level Management CommandsDisown disks ready to connect them to another system

varyoffvg <vgname>

exportvg <vgname>or smitty lvm

Activate newly attached disks cfgmgr – finds disks

importvg hdiskN – any one of the disks

varyonvg <vgname> – mounts file systems

Moving LVsmigratelv (not striped)

Use smit lvm

Can migrate LV on a disk to another disk

Page 165: AIX Commands1

Can empty whole disk to remove it later or replac a fault diskDisks can be added and removed from a VG

extendvg and reducevg

Use smit lvm recommended

LVM rootvg good practiceSmall rootvg - 1 or 2 disks (for mksysb backup)Mirror rootvg for AIX disk protection

Add disk hdisk1

chvg -Qn rootvg

For hd1 to hd8 and hd9var copy the LV

mklvcopy hd{1,2,3,4,5,6,7,8,9var} 2 hdisk1

syncvg -v rootvg

bosboot -a

bootlist -m normal hdisk0 hdisk1Or

mirrorvg -s rootvg

this second option is recommended

TIP: This command will show you formatted list of active Volume groupsfor i in $(lsvg);do lsvg $i;done \| awk ' BEGIN { printf("%10s\t%10s\t%10s\t%10s\t%10s\n","VG","Total(MB)","Free","USED","Disks") };/VOLUME GROUP:/ \{ printf("%10s\t", $3) };/TOTAL PP/ { B=index($0,"(") + 1;E=index($0," megaby");D=E-B;printf("%10s\t", substr($0,B,D) );};/FREE PP/ \{ B=index($0,"(") + 1;E=index($0," megaby");D=E-B;printf("%10s\t", substr($0,B,D) );};/USED PP/ \{ B=index($0,"(") + 1;E=index($0," megaby");D=E-B;printf("%10s\t", substr($0,B,D) );};/ACTIVE PV/ { printf("%10s\t\n", $3) } ' Put other disks into other volume groups

use min PP size ( 8MB or 16 MB)

use 16 to 32 disks per volume group

use different vg for data that might be moved elsewhereAvoid hot disks

Spread data across disk with LVs or RAID5

Mirrors add protection and performance

Use striping whenever possible

Think spindles not disk sizereorgvg

this will move physical partitions (PP) around in an attempt to get PPs in the right placemigratepv

Page 166: AIX Commands1

this can be used to spread PPs across move disks

also to remove all PPs from a suspect disk before replacement (due to errors being reported)

AVOIDING Disk Crashes Rule One: don't let this stop your system

RAID5 or mirror everything

Rule Two: monitor error logs

Make sure you know when a disk failed

Rule Three: call hardware support

That is what they are for

Rule Four: Don't meddle

Only try, if you know what you are doing

Rule Five: Read and practise

Get the Redbooks and try it safely Comments

?

o Top  

o Overview  

o Basic Concepts & Terms   ?  

Extents  

Booting Considerations  

Linear & Stripe Mapping  

Snapshots  

o LVM Administration         ?  

Plan Disk Layout  

Format Physical Volumes  

Create Volume Groups  

Create Logical Volumes  

Create and Use Snapshots  

Examining LVM Information  

Grow VGs and LVs  

Shrink VGs and LVs  

Delete LVs and VGs  

o Summary and Examples

Page 167: AIX Commands1

Unix/Linux Administration Logical Volume Management Guide  ©2005 Wayne Pollock, Tampa Florida USA. All Rights Reserved.

Adapted from the LVM How-to pagefrom The Linux Documentation Project website.

LVM (Logical Volume Management) Overview: In the olden days computer disks were small compared to the data set sizes that were needed.  A solution is to make several physical disks appear virtually (or logically) as a single much larger disk.  A large filesystem could then be created on that virtual disk.  Later hard disk sizes grew large enough that it made sense to do the opposite: make one physical disk appear as several virtual disks.  Each virtual disk holds a filesystem independently of the others.  Today such virtual disks are called disk "partitions". Now we have come full circle.  Large data warehouse applications require very large filesystems to hold the database data files.  To support this sort of application the old idea of combining several disks into one has been resurrected.  Novell Netware supported this feature since the 1990s.  The physical disk (or selected disk partitions) are formatted to be "physical volume segments".  The administrator can then create a logical "volume", that is, a Novell filesystem.  This can contain one or more physical volume segments.  The exciting part is that if some volume is low on space, you can extend it by adding another physical volume segment to the (logical) volume  This operation is fast and doesn't disturb the existing data or other partitions (or volumes)! The modern Unix (and Linux) version of this idea is called "Logical Volume Management" (or "LVM").  LVM allows the administrator to

use and allocate disk space more efficiently and flexibly

move logical volumes between different physical devices

have very large logical volumes span a number of physical devices

take snapshots of whole filesystems easily, allowing on-line backup of those filesystems

replace on-line drives without interrupting services

Linux also supports software RAID, which, like LVM, can be used to provide disk striping.  The two systems are independent of each other.  So you can use RAID to provide striping and use that RAID volume as a physical volume for LVM.  Although there is no reason to use both software RAID and LVM, it can be done.  However it does make good sense to use hardware RAID and LVM together. As a quick example of what can be done, suppose you need to grow some filesystem by 500 MB.  Without LVM, you must either have a spare 500 MB

Page 168: AIX Commands1

on the same physical disk or the entire filesystem must be moved to another (larger) disk.  Even if you have the space, all the other partitions (and their filesystems) must be moved, so the 500 MB is at the end of the partition you wish to grow.  Then all the data must be backed up, the partition changed, and the old data restored.  While today there are tools such as parted that can manage this for regular partitions (not LVs), using LVM you can quickly and safely grow a filesystem in this simple way: root# umount /dev/vg1/lv1 root# e2fsadm /dev/vg1/lv1 -L+500M root# mount /dev/vg1/lv1The free space can be anywhere, even on another disk! LVM for Linux has had two major versions (so far).  Both have many more features and controls than the older Novell scheme.  Unfortunately, the additional controls and features aren't always needed, but you must understand them in order to setup and manage LVM.  LVM is also available in recent Solaris and other Unix systems.

Basic Concepts and Terminology:

Figure 1

With LVM, physical volume segments are simply called "physical volumes" (or "PVs").  These PVs are usually entire disks but may be disk partitions.  The PVs in turn are combined to create one or more large virtual disks called "volume groups" (or "VGs").  While you can create many VGs, one may be sufficient.  A VG can grow or shrink by adding or removing PVs from it.  VGs appear to be block devices, similar to other disks such as /dev/hda.  In fact each VG can be referred to by the name "/dev/VG_name". Once you have one or more volume groups you can create one or more virtual partitions called "logical volumes" (or "LVs").  Note each LV must fit entirely within a single VG.  LVs appear to be block devices similar to disk partitions such as /dev/hda1, with entries named "/dev/VG_name/LV_name".  LVs have a number of parameters that can be set (and later most can be changed) that can affect disk I/O performance, including extent size, chunk size, stripe size and stripe set size, and read-ahead.  These are discussed below.

Logical volume management common acronyms

Term Meaning

PE Physical Extent

LE Logical Extent

PV Physical Volume

Page 169: AIX Commands1

Logical volume management common acronyms

Term Meaning

VG Volume Group

LV Logical Volume

Table 1: LVM AcronymsFinally, you can create any type of filesystem you wish on the logical volume, including as swap space.  Note that some filesystems are more useful with LVM than others.  For example not all filesystems support growing and shrinking.  ext2, ext3, xfs, and reiserfs do support such operations and would be good choices.  The relationship between PVs, VGs, and LVs is illustrated in figure 1.  Table 1 summarizes these acronyms.

Extents: When creating a volume group from one or more physical volumes, you must specify the size of the "extents" of each of the physical volumes that make up the VG.  Each extent is a single contiguous chunk of disk space, typically 4M in size, but can range from 8K to 16G in powers of 2 only.  (Extents are analogous to disk blocks or clusters.)  The significance of this is that the size of logical volumes are specified as a number of extents.  Logical volumes can thus grow and shrink in increments of the extent size.  A volume group's extent size can not be changed after it is set. The system internally numbers the extents for both logical and physical volumes.  These are called logical extents (or LEs) and physical extents (or PEs), respectively.  When a logical volume is created a mapping is defined between logical extents (which are logically numbered sequentially starting at zero) and physical extents (which are also numbered sequentially). To provide acceptable performance the extent size must be a multiple of the actual disk cluster size (i.e., the size of the smallest chunk of data that can be accessed in a single disk I/O operation).  In addition some applications (such as Oracle database) have performance that is very sensitive to the extent size.  So setting this correctly also depends on what the storage will be used for, and is considered part of the system administrator's job of tuning the system.

Booting Consideration with LVM: LVM can be use with RAID.  LVM can be used to hold all filesystems.  However special considerations apply when using LVs for the boot and root filesystems.  This is because the BIOS code in the ROM of the motherboard of your computer must be able to locate and load the kernel.  So if the boot partition was a LV, the BIOS would need to know about PVs, VGs, and LVs,

Page 170: AIX Commands1

and it probably doesn't.  Unless you are using some custom BIOS you must not make the bootable partition an LV. The root partition (if it isn't also the boot partition) may be a logical volume.  However this means the kernel must access the root partition before it can load any (e.g., LVM) kernel modules.  Thus the modules for LVM must be compiled into the kernel.  This is rarely the case with standard distributions!  (There is a similar issue with SCSI drivers, as most kernels only compile in the IDE drivers.)  For this reason, as well as allowing a filesystem to be accessed by another operating system (yes there are ext2 drivers available for Windows), some system administrators prefer to make the root filesystem on a regular partition rather than on a logical volume.  Note in this case you can make a single root+boot partition. The solution to using a logical volume for your root filesystem (as it is with SCSI) is either to build a custom kernel with the correct drivers compiled in, or to make sure the system loads a RAM disk initially, known as initrd, which contains all the correct modules.  This RAM disk then loads the system as normal, and goes away.  Creating a ramdisk on Linux is simple using the mkinitrd script.  Just run this command (as root). You need to know the kernel version, and then you must update grub.conf to use the ramdisk: /root# KERNEL_VERSION=`uname -r`/root# mkinitrd -v initrd.$KERNEL_VERSION $KERNEL_VERSION/root# mv initrd.$KERNEL_VERSION /boot/root# vi /boot/grub/grub.conf # or /boot/grub/menu.lstBefore logical volumes can be mounted, the LVM driver must be loaded (or compiled in) to the kernel.  Next all physical volumes on all available drives must be found and examined, in order to determine all the volume groups.  Finally the volume groups must be activated, which causes the kernel to recognize the various block devices.  Only then can the filesystems within logical volumes be mounted. So most systems add code similar to the following to the boot up scripts (typically the rc.sysinit script): # LVM2 initializationif [ -x /sbin/lvm.static ] # Check for LVM v2then # make sure device mapper (LVM2) kernel module is loaded: if ! grep -q "device-mapper" /proc/devices 2>/dev/null then modprobe dm-mod >/dev/null 2>&1 fi # Cleanup and then recreate device mapper control file: /bin/rm -f /dev/mapper/control echo "mkdmnod" | /sbin/nash --quiet >/dev/null 2>&1 if [ -c /dev/mapper/control ] # if LVM2 is loaded: then # Check for any physical volumes: if /sbin/lvm.static vgscan > /dev/null 2>&1 then echo "Setting up Logical Volume Management:" # Activate volume groups and re-create all /dev entries: /sbin/lvm.static vgchange -a y && /sbin/lvm vgmknodes fi fifi

Page 171: AIX Commands1

You may want to edit the file /etc/init.d/halt to deactivate the volume groups at shutdown.  However this shouldn't be necessary when using LVM version 2.  To deactivate volume groups, insert the following near the end of this file (just after the filesystems are mounted read-only and before the comment that says "Now halt or reboot"): # Deactivate LVM:if [ -x /sbin/lvm.static ] # Check for LVM v2then echo "Deactivating LVM volume groups:" /sbin/lvm.static vgchange -a nfiLike all storage devices data may become corrupted over time.  LVM provides a command "vgck" you can use to periodically check the consistency of your volume groups.  It may pay to add this command to the bootup scripts.

Linear and Striped Mapping: Let's suppose we have a volume group called VG1, and this volume group has a physical extent size of 4M.  Suppose too this volume group is composed of one disk partition /dev/hda1 and one whole disk /dev/hdb.  These will become physical volumes PV1 and PV2 (more meaningful names for a particular scenario can be given if desired). The PVs are different sizes and we get 99 (4M) extents in PV1 and 248 extents in PV2, for a total of 347 extents in VG1.  Now any number of LVs of any size can be created from the VG, as long as the total number of extents of all LVs sums to no more than 347.  To make the LVs appear the same as regular disk partitions to the filesystem software, the logical extents are numbered sequentially within the LV.  However some of these LEs may be stored in the PEs on PV1 and others on PV2.  For instance LE[1] of some LV in VG1 could map onto PE[51] of PV1, and thus data written to the first 4M of the LV is in fact written to the 51st extent of PV1. When creating LVs an administrator can choose between two general strategies for mapping logical extents onto physical extents:

Linear mapping will assign a range of PE's to an area of an LV in order (e.g., LE 1–99 map to PV1's PEs, and LE 100–347 map onto PV2's PEs).

Striped mapping will interleave the disk blocks of the logical extents across a number of physical volumes.  You can decide the number of PVs to stripe across (the stripe set size), as well as the size of each stripe.

When using striped mapping, all PVs in the same stripe set need to be the same size.  So in our example the LV can be no more than 198 (99 + 99) extents in size.  The remaining extents in PV2 can be used for some other LVs, using linear mapping. The size of the stripes is independent of the extent size, but must be a power of 2 between 4K and 512K.  (This value n is specified as a power of 2 in this formula: (2^n) × 1024 bytes, where 2 = n = 9.)  The stripe size should also be a multiple of the disk sector size, and finally the extent size should be a multiple of this stripe size.  If you don't do this, you will end up with fragmented extents (as the last bit of space in the extent will be unusable).

Page 172: AIX Commands1

Tables 2 and 3 below illustrate the differences between linear and striped mapping.  Suppose you use a stripe size of 4K, an extent size of 12K, and a stripe set of 3 PVs (PVa, PVb, and PVc), each of which is 100 extents.  Then the mapping for an LV ( whose extents we'll call LV1, LV2, ...) to PVs (whose extents we'll call PVa1, PVa2, ..., PVb1, PVb2, ..., PVc1, PVc2, ...) might look something like the following.  (In this table the notation means volume_name extent_number . stripe_number):

linear and striped mappingsExample of Linear Mapping

Logical Extents 

Physical Extents

LV1?PVa1

LV2?PVa2

LV3?PVa3

LV4?PVa4

...?...

LV99?PVa99

LV100?PVb1

LV101?PVb2

...?...

LV199?PVb99

LV200?PVc1

Example of Striped Mapping

Logical Extents 

Physical Extents

LV1.1?PVa1.1

LV1.2?PVb1.1

LV1.3?PVc1.1

LV2.1?PVa1.2

LV2.2?PVb1.2

LV2.3?PVc1.2

LV3.1?PVa1.3

LV3.2?PVa1.3

LV3.3?PVa1.3

LV4.1?PVa2.1

LV4.2?PVb2.1

Page 173: AIX Commands1

LV201?PVc2

...?...

LV4.3?PVc2.1

...?...

Tables 2 and 3: Linear versus Striped Mapping In certain situations striping can improve the performance of the logical volume but it can be complex to manage.  However note that striped mapping is useless and will in fact hurt performance, unless the PVs used in the stripe set are from different disks, preferably using different controllers. (In version 1 of LVM LVs created using striping cannot be extended past the PVs on which they were originally created.  In the current version (LVM 2) striped LVs can be extended by concatenating another set of devices onto the end of the first set.  However this could lead to a situation where (for example) a single LV ends up as a 2 stripe set, concatenated with a linear (non-striped) set, and further concatenated with a 4 stripe set!

Snapshots: A wonderful facility provided by LVM is a snapshot.  This allows an administrator to create a new logical volume which is an exact copy of an existing logical volume (called the original), frozen at some point in time.  This copy is read-only.  Typically this would be used when (for instance) a backup needs to be performed on the logical volume but you don't want to halt a live system that is changing the data.  When done with the snapshot the system administrator can just unmount it and then remove it.  This facility does require that the snapshot be made at a time when the data on the logical volume is in a consistent state, but the time the original LV must be off-line is much less than a normal backup would take to complete. In addition the copy typically only needs about 20% or less of the disk space of the original.  Essentially, when the snapshot is made nothing is copied.  However as the original changes, the updated disk blocks are first copied to the snapshot disk area before being written with the changes.  The more changes are made to the original, the more disk space the snapshot will need. When creating logical volumes to be used for snapshots, you must specify the chunk size.  This is the size of the data block copied from the original to the snapshot volume.  For good performance this should be set to the size of the data blocks written by the applications using the original volume.  While this chunk size is independent of both the extent size and the stripe size (if striping is used), it is likely that the disk block (or cluster or page) size, the stripe size, and the chunk size should all be the same.  Note the chunk size must be a power of 2 (like the stripe size), between 4K and 1M.  (The extent size should be a multiple of this size.) You should remove snapshot volumes as soon as you are finished with them, because they take a copy of all data written to the original volume

Page 174: AIX Commands1

and this can hurt performance.  In addition, if the snapshot volume fills up errors will occur.

LVM Administration — Commands and Procedures: The lvm command permits the administrator to perform all LVM operations using this one interactive command, which includes built-in help and will remember command line arguments used from previous commands for the current command.  However each LVM command is also available as a stand-alone command (that can be scripted).  These are discussed briefly below, organized by task.  See the man page for the commands (or use the built-in help of lvm) for complete details.

Plan the Disk Layout: Disk I/O is often the determining factor in overall system performance.  If your system has multiple disks and controllers, the correct strategy is to have them all used in parallel (that is, simultaneously) as much of the time as possible.  In addition you should aim to place files in such a way as to minimize disk head movement (and thus minimize seek time). While the performance improvements are real they often aren't significant.  Whether or not to worry about these issues depends upon the current performance, file size, type, and access patterns, and which applications are running.  Some ways to maximize performance are:

To support a large number of users, say on a development system, you can use linear mapping of your logical volumes to a large number of physical volumes on different disks, hopefully using different controllers as well.

On a production system running several different services, the files for each service should be placed on different physical disks (so for example the web server I/O won't interfere with the FTP server I/O).

On a database server the files for the following should be placed on different disks: tables, their indexes, log files, and frequently used tables (that don't get cached in RAM).

If possible it pays to keep the operating system files (i.e., boot, root, /var/log, swap) on one disk and the rest of the system on another, so the system's disk I/O doesn't interfere with the service's I/O.

Large files are often accessed sequentially.  Such access is most efficient when the data blocks of the file are contiguous, at the outer edge of the disk (cylinder zero).  In addition striping across different disks is very helpful in minimizing disk head movement and allowing parallel read/write operations.

Large sequentially accessed files, such as those on a web or FTP server can also benefit from a LVM feature called read ahead.  This allows the next block to be read from disk to RAM at the same time as the current block, useful when the data is contiguous.  (Non-LVM disk read-ahead is also settable in Linux, by changing some parameters in /proc/sys/vm.)

On the other hand, randomly accessed files benefit from a more central placement on a disk, as this will tend to minimize disk seek time.

Using striped mapping can speed up access to large, sequentially accessed files, as more disks (and controllers) are used simultaneously.  Smaller, randomly accessed files don't benefit much from striping.

To avoid striping performance problems you should format one PV per whole disk.  LVM can't tell if two PVs are on the same physical disk or not, so if you create a multiple PVs per disk and then create striped LVs, the stripes could be on different partitions on the same disk.  This would result in a decrease in performance rather than an increase.  If you do format a disk with multiple PVs, make sure no two of them are added to the same volume group if striped mapping will be used!

Page 175: AIX Commands1

For a production system it is recommended that you create one PV per whole disk, for Administrative convenience.  It's easier to keep track of the hardware in a system if each real disk only appears once.   This becomes particularly true if a disk fails.

Other factors affect the disk I/O performance.  Often these other factors overshadow any performance gains from careful disk layout.  One example is the disk scheduler in the kernel.  The 2.6 version of the Linux kernel comes with two different schedulers you can select between.  In addition the kernel supports features such as read-ahead independently of any LVM settings. Another issue is the disk controller settings.  Sometimes the disk schedules disk I/O regardless of the kernel.  Disks also have configurable settings, including DMA, buffering, etc.  These can be changed with "hdparam" and other utilities. Other factors that effect performance include bus type and speed, and what other devices are attached to that bus.

Format Physical Volumes (PVs) To initialize a disk or disk partition as a physical volume you just run the "pvcreate" command on the whole disk.  For example: pvcreate /dev/hdbThis creates a volume group descriptor at the start of the second IDE disk.  You can initialize several disks and/or partitions at once.  Just list all the disks and partitions on the command line you wish to format as PVs. Sometimes this procedure may not work correctly, depending on how the disk (or partition) was previously formatted.  If you get an error that LVM can't initialize a disk with a partition table on it, first make sure that the disk you are operating on is the correct one!  Once you have confirmed that /dev/hdb is the disk you really want to reformat, run the following dd command to erase the old partition table: # Warning DANGEROUS!# The following commands will destroy the partition table on the# disk being operated on. Be very sure it is the correct disk!dd if=/dev/zero of=/dev/hdb bs=1k count=1 blockdev \ --rereadpt /dev/hdbFor partitions run "pvcreate" on the partition: pvcreate /dev/hdb1This creates a volume group descriptor at the start of the /dev/hdb1 partition.  (Note that if using LVM version 1 on PCs with DOS partitions, you must first set the partition type to "0x8e" using fdisk or some other similar program.)

Create Volume Groups (VGs) Use the "vgcreate" program to group selected PVs into VGs, and to optionally set the extent size (the default is 4MB).  The following command creates a volume group named "VG1" from two disk partitions from different disks: vgcreate VG1 /dev/hda1 /dev/hdb1Modern systems may use "devfs" or some similar system, which creates symlinks in /dev for detected disks.  With such systems names like "/dev/hda1" are actually the symlinks to the real names.  You can use either the symlink or the real name in the LVM commands, however the older

Page 176: AIX Commands1

version of LVM demanded you use the real device names, such as /dev/ide/host0/bus0/target0/lun0/part1 and /dev/ide/host0/bus0/target1/lun0/part1. You can also specify the extent size with this command using the "-s size" option, if the 4Mb default not what you want.  The size is a value followed by one of k (for kilobytes), m (megabytes), g (gigabytes), or t (tetrabytes).  In addition you can put some limits on the number of physical or logical volumes the volume can have.  You may want to change the extent size for performance, administrative convenience, or to support very large logical volumes.  (Note there may be kernel limits and/or application limits on the size of LVs and files on your system.  For example Linux 2.4 kernel has a max size of 2TB.) The "vgcreate" command adds some information to the headers of the included PVs.  However the kernel modules needed to use the VGs as disks aren't loaded yet, and thus the kernel doesn't "see" the VGs you created.  To make the VGs visible you must activate them.  Only active volume groups are subject to changes and allow access to their logical volumes. To activate a single volume group VG1, use the command: vgchange -a y /dev/VG1("-a" is the same as "--available".)  To active all volume groups on the system use: vgchange -a y

Create Logical Volumes (LVs) Creating a logical volume in some VG is the most complex part of LVM setup, due to the many options available.  The basic command syntax is: lvcreate options size VG_nameWhere size is either "-l num_extents" or "-L num_bytes", where num_bytes is a number followed by one of k, m, g, or t.  If this second form is used you may not get an LV of that exact size, as LVs are always a whole number of extents.  You can also use "--extents" for "-l" or "--size" for "-L". One of the most common options is "-n name" (you can use "--name" for "-n") to specify a name for the logical volume.  If you don't use this option than the LVs are named automatically "lvol1", "lvol2", "lvol3", etc. Other options include "-C y" (or "--contiguous y") to create an LV with contiguous allocation, "-i num_stripes -I stripe_size" to create an LV with striped mapping (stripe_size is a number between 2 and 9, as described above), and "-r num_sectors" (or "--readahead num_sectors") to set the amount of read ahead to a value between 2 and 120. Another form of this command is used to create snapshot volumes.  This will be discussed below. Some examples of creating logical volumes LV1 and LV2 from the volume group VG1: # To create a 20GB linear LV named "LV1" for some VG named# "VG1" and its block device special file "/dev/VG1/LV1":lvcreate -L 20g -n LV1 VG1

# To create a LV of 100 extents with 2 stripes and stripe size 4 KB:lvcreate -i 2 -I 4 -l 100 -n LV2 VG1If you want to create an LV that uses the entire VG, use the "vgdisplay" command to find the "Total PE" size, then use that when running lvcreate.

Page 177: AIX Commands1

Once the LVs have been created you can format them with filesystems (or as swap space) using standard tools such as "mkfs".  If the new filesystem can be successfully mounted, a final step is to edit the /etc/fstab file and possibly the rc.sysinit file, so that the volumes are mounted automatically at boot time.  It may also be necessary to setup an initial ramdisk for booting (if the "root" filesystem is built on a logical volume).

Create and Use a Snapshot To create a snapshot of some existing LV, a form of the lvcreate command is used: root# lvcreate size option -s -n name existing_LVwhere size is as discussed previously, "-s" (or "--snapshot") indicates a snapshot LV, "-n name" (or "--name name") says to call the snapshot LV name.  The only option allowed is "-c chunk_size" (or "--chunksize chunk_size"), where chunk_size is specified as a power of 2 in this formula: (2^chunk_size) × 1024 bytes, where 2 = chunk_size = 10.)  Suppose you have a volume group VG1 with a logical volume LV1 you wish to backup using a snapshot.  you can estimate the time the backup will take, and the amount of disk writes that will take place during that time (plus a generous fudge factor), say 300MB.  Then you would run the command: root# lvcreate -l 300m -s -n backup LV1to create a snapshot logical volume named /dev/VG1/backup which has read-only access to the contents of the original logical volume named /dev/VG1/LV1 at point in time the snapshot was created.  Assuming the original logical volume contains a file system you now mount the snapshot logical volume on some (empty) directory, then backup the mounted snapshot while the original filesystem continues to get updated.  When finished, unmount the snapshot and delete it (or it will continue to grow as LV1 changes, and eventually run out of space). Note: If the snapshot is of an XFS filesystem, the xfs_freeze command should be used to quiesce the filesystem before creating the snapshot (if the filesystem is mounted): /root# xfs_freeze -f /mnt/point;/root# lvcreate -L 300M -s -n backup /dev/VG1/LV1/root# xfs_freeze -u /mnt/pointWarning Full snapshot are automatically disabledNow create a mount-point (an empty directory) and mount the volume: /root# mkdir /mnt/dbbackup/root# mount /dev/VG1/backup /mnt/dbbackupmount: block device /dev/ops/dbbackup is write-protected, mounting read-onlyIf you are using XFS as the filesystem you will need to add the "nouuid" option to the mount command as follows: /root# mount /dev/VG1/backup /mnt/dbbackup -o nouuid,roDo the backup, say by using tar to some "DDS4" or "DAT" tape backup device: /root# tar -cf /dev/rmt0 /mnt/dbbackuptar: Removing leading `/' from member namesWhen the backup has finished you unmount the volume and remove it from the system: root# umount /mnt/dbbackup

Page 178: AIX Commands1

root# lvremove /dev/VG1/backuplvremove -- do you really want to remove "/dev/VG1/backup"? [y/n]: ylvremove -- doing automatic backup of volume group "VG1"lvremove -- logical volume "/dev/VG1/backup" successfully removed

Examining LVM Information To see information about some VG use: vgdisplay some_volume_groupvgs some_volume_groupTo see information about some PV use the command: pvdisplay some_disk_or_partition # e.g., /dev/hda1pvs some_disk_or_partitionTo see information about some LV use: lvdisplay some-logical-volumelvs some-logical-volumeThe man pages for these commands provides further details.

Grow VGs, LVs, and Filesystems To grow a filesystem, you must install a new hard disk (unless you have free space available), format it as a PV, add that PV to your VG, then add the space to your LV, and finally use the filesystem tools to grow it.  (Not all filesystem allow or come with tools to grow and shrink them!) VGs are resizable (spelled in Linux as "resizeable") by adding or removing PVs from them.  However by default they are created as fixed in size.  To mark a VG as resizable use the command: root# vgchange -x y #or --resizeable yOnce this is done add a PV (say "hdb2") to some VG (say "VG1") with the command: root# vgextend VG1 /dev/hdb2Next, extend an LV with the "lvextend" command.  This command works almost the same as the "lvcreate" command, but with a few different options.  When specifying how much to increase the size of the LV, you can either specify how much to grow the LV with "+size" or you can specify the new (absolute) size (by omitting the plus sign).  So to extend the LV "LV1" on VG "VG1" by 2GB, use: root# lvextend -L +2G /dev/VG1/LV1You could also use: root# lvresize -L +2G /dev/VG1/LV1It would be a good idea to use the same mapping as the original LV, or you will have strange performance issues!  Also note this command can be used to extend a snapshot volume if necessary. After you have extended the logical volume the last step is to increase the file system size.  How you do this depends on the file system you are using.  Most filesystem types come with their own utilities to grow/shrink filesystems, if they allow that.  These utilities usually grow to fill the entire partition or LV, so there is no need to specify the filesystem size. Some common filesystem utilities are (assume we are expanding the /home filesystem in LV1 on VG1):

EXT2 and EXT3: EXT2/3 filesystems must be unmounted before they can be resized.  The commands to use are: root# umount /home # /home is the mount point for /dev/VG1/LV1 root# fsck -f /home # required! root# resize2fs /dev/VG1/LV1 # grow FS to fill LV1. root# mount /home

Page 179: AIX Commands1

Reiserfs: The Reiserfs file system can be safely resized while mounted.  If unmounted resizing is preferred, first umount and afterward mount the filesystem.  For online resizing just use: root# resize_reiserfs -f /dev/VG1/LV1

XFS: The XFS file systems must be mounted to be resized, and the mount-point is specified rather than the device name: root# xfs_growfs /home

JFS: Like XFS, the JFS file system must be mounted to be resized and the mount-point is specified rather than the device name.  JFS doesn't have a special utility for resizing, but the mount command has an option that can be used: root# mount -o remount,resize /home In some cases the exact number of blocks must be specified.  (A kernel bug in some older Linux versions prevents the LV size from being determined automatically.)   For example to resize a JFS file system that has a 4KB block size (the default) to 4GB, you must use 1M 4KB-blocks.  Now "1M" is 2 raised to the power of 20 (=1048576), so use: root# mount -o remount,resize=1048576 /home

Shrink VGs, LVs, and Filesystems To shrink a filesystem, you perform the same steps for growing one but in reverse order.  You first shrink the filesystem, then remove the space from the LV (and put it back into the VG).  Other LVs in the same VG can now use that space.  To use it in another VG, you must remove the corresponding PV from the one VG and add it to the other VG. To shrink a LV you must first shrink the filesystem in that LV.  This can be done with the resize2fs for EXT2/3, or resize_reiserfs for ReiserFS (doing this off-line is safer but not required).  There are similar tools for other filesystem types.  Here's an example of shrinking /home by 1 GB: # dfFilesystem Size Used Avail Use% Mounted on/dev/sda1 145M 16M 122M 12% /boot/dev/mapper/vg01-lv01 49G 3.7G 42G 9% /home...# umount /home# fsck -f /home # required!fsck 1.38 (30-Jun-2005)e2fsck 1.38 (30-Jun-2005)Pass 1: Checking inodes, blocks, and sizesPass 2: Checking directory structurePass 3: Checking directory connectivityPass 4: Checking reference countsPass 5: Checking group summary information/home: 32503/6406144 files (0.3% non-contiguous), 1160448/12845056 blocks# resize2fs -p /dev/vg01/lv01 48Gresize2fs 1.38 (30-Jun-2005)Resizing the filesystem on /dev/vg01/lv01 to 12799788 (4k) blocks.Begin pass 3 (max = 9)Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXThe filesystem on /dev/vg01/lv01 is now 12799788 blocks long.Currently XFS and JFS filesystem types do not support shrinking.  If a newer version of these filesystems will support this, mount may have been updated to support these filesystem types.  (And if not a new tool may be released.)  For such filesystems you can resize them the hard way: Backup the data

Page 180: AIX Commands1

using some archive tool (e.g., cpio, tar, star, or you can copy the data to some other disk).  Then delete the filesystem in the LV, then shrink the LV, then recreate the new (smaller) filesystem, and finally restore the data. Once the filesystem has been shrunk it is time to shrink the logical volume.  You can use either the lvreduce command or the lvresize command.  Continuing from the example above: # lvresize -L -1G /dev/vg01/lv01 Rounding up size to full physical extent 96.00 MB WARNING: Reducing active logical volume to 48 GB THIS MAY DESTROY YOUR DATA (filesystem etc.)Do you really want to reduce lv01? [y/n]: y Reducing logical volume lv01 to 48 GB Logical volume lv01 successfully resized# mount /homeTo shrink a VG (say "VG1"), a PV (say "hdc") can be removed from it if none of that PV's extents (the PEs) are in use by any LV.  Run the command: root# vgreduce VG1 /dev/hdcYou might want to do this to upgrade or replace a worn-out disk.  If the PV is in use by some LV, you must first migrate the data to another available PV within the same VG.  To move all the data from a PV (say "hdb2") to any unused, large enough PV within that VG, use the command: root# pvmove /dev/hdb2

Delete LVs and VGs A logical volume (say "LV3" on the volume group "VG2") must be unmounted before it can be removed.  The steps for this are simple: root# umount /dev/VG2/LV3root# lvremove /dev/VG2/LV3Before a volume group (say "VG2") is removed you must first deactivate it.  This is done with the command: root# vgchange -a n VG2Now the VG can be removed.  This of course will destroy all LVs within it.  The various PVs that made up that VG can then be re-assigned to some other VGs.  Remove (a non-active) volume group with: root# vgremove VG2

Summary and Examples In the following examples assume that LVM2 is installed and up to dade, and the boot scripts have been modified already if needed.  The first example includes some commentary and some command output; the second is much shorter but uses the long option names just for fun.

Home directory Example In this example we will create a logical volume to hold the "/home" partition for a multi-media development system.  The system will use a standard EXT3 filesystem of 60 GB, built using 3 25GB SCSI disks (and no hardware RAID).  Since multi-media uses large files it makes sense to use stripe mapping and read-ahead.  We will call the volume group "vg1" and the logical volume "home":

Initialize the disks as PVs: /root# pvcreate /dev/sda /dev/sdb /dev/sdc

Page 181: AIX Commands1

Create a Volume Group, then check it's size: /root# vgcreate vg1 /dev/sda /dev/sdb /dev/sdc /root# vgdisplay vgdisplay --- Volume Group --- VG Name vg1 VG Access read/write VG Status available/resizable VG # 1 MAX LV 256 Cur LV 0 Open LV 0 MAX LV Size 255.99 GB Max PV 256 Cur PV 3 Act PV 3 VG Size 73.45 GB PE Size 4 MB Total PE 18803 Alloc PE / Size 0 / 0 Free PE / Size 18803/ 73.45 GB VG UUID nP2PY5-5TOS-hLx0-FDu0-2a6N-f37x-0BME0Y

Create a 60 GB logical volume, with stripe set of 3 PVs and stripe size of 4 (which shows 2^4 KB = 16KB): /root# lvcreate -i 3 -I 4 -L 60G -n home vg1 lvcreate -- rounding 62614560 KB to stripe boundary size 62614560 KB / 18803 PE lvcreate -- doing automatic backup of "vg1" lvcreate -- logical volume "/dev/vg1/home" successfully created

Create an EXT3 filesystem in the new LV: /root# mkfs -t ext3 /dev/vg1/home

Test the new FS: /root# mount /dev/vg1/home /mnt /root# df | grep /mnt /root# umount /dev/vg1/home

Update /etc/fstab with the revised entry for /home.

Finally, don't forget to update the system journal.

Oracle Database Example In this example we will create 2 LVs for an Oracle database.  Oracle manages its own striping and read-head/caching, so we won't use these LVM features.  However using hardware RAID is useful, so we will use two RAID 10 disks, hdb and hdc.  The tables will use one logical volume called "tables" on one disk and the indexes and control files will be on a second LV called "indexes" on the other disk.  Both LVs will exist in the VG called "db".  Both filesystems will be XFS, for good performance for large database files: /root# pvcreate /dev/hdb /dev/hdc/root# vgcreate db /dev/hdb /dev/hdc/root# lvcreate --size 200G --name tables db/root# lvcreate --size 200G --name indexes db/root# mkfs -t xfs /dev/db/tables/root# mkfs -t xfs /dev/db/indexes/root# vi /etc/fstab/root# vi ~/system-journal

 

This page was last updated by Wayne Pollock.

Table of contents Hide TOC 1. Introduction2. Steps

2.1. On the production system2.2. Configuration changes Made to environment2.3. Example2.4. Important3. Conclusion

Page 182: AIX Commands1

IntroductionEdit section

Once I ensured the system was configured correctly. Before I started testing the cluster failover, I performed a manual failover to test all the scripts that have been written work according to the configured system needs.

StepsEdit section

The following are the steps that you should take to do a manual failover test of your application.

On the production systemEdit section

Configure the service address on the primary adapter.

Varyon all shared volume groups.

Mount all shared filesystems.

Execute your application start script.

Test the application.

Execute your application stop script.

Unmount all shared file systems.

Varyoff all the shared volume groups.

Configure the production boot address on the primary adapter.

If the test is successful on the production server, you should now move to the backup server and proceed with the following steps:

Configure the production service address on the standby adapter.

Varyon all shared volume groups.

Mount all shared file systems.

Execute your application start script.

Test the application.

Execute your application stop script.

Unmount all shared file systems.

Varyoff all the shared volume groups.

Reset the standby address on the standby adapter.

I completed the manual failover of your cluster. Doing a manual failover test ensured I had more control over the failover steps. Once I noticed errors in the configuration, I then corrected the failures, by bring down cluster nodes and performing a synchronized verification test. Before proceeding to the next steps: Therefore, the manual failover test helps you to trouble shoot any application. Problems before performing the automatic HACMP failover test.

Page 183: AIX Commands1

Configuration changes Made to environmentEdit section

Tune the system using I/O pacing.

o I/O pacing is required for an HACMP cluster to behave correctly during large disk writes, and it is strongly recommended if you anticipate large blocks of disk writes on your HACMP cluster. These marks are, by default, set to zero (disabling I/O pacing) when AIX is installed. While the most efficient high- and low-water marks vary from system to system, an initial high-water mark of 33 and a low-water mark of 24 provide a good starting point.

These settings only slightly reduce write times and consistently generate correct failover behavior from HACMP for AIX. If a process tries to write to a file at the high-water mark, it must wait until enough I/O operations have finished to make the low-water mark.

o The way to correctly configure Highwater Mark and Low w water mark is as formula below. The default values for the disk-I/O pacing high-water and low-water marks (maxpout and minpout parameters) may cause severe performance problems on Caché production systems. These default values may significantly hinder Caché Write daemon performance by inappropriately putting the Write daemon to sleep causing prolonged Write daemon cycles.

If you are using HACMP clusters, I/O pacing is automatically enabled. If your system is not part of an HACMP cluster, set both the high- (maxpout) and low- (minpout) water marks to 0 (zero) to disable I/O pacing. View and change the current settings for the I/O pacing high-water and low-water marks by issuing the smitty chgsys command. Inter Systems currently recommends the following IBM calculation for determining the appropriate high-water mark:

high-water mark = (4 * n) + 1

Where n = the maximum number of spindles any one file (database, journal, or WIJ) spans across. Set the low-water mark to 50%-75% of the high-water mark.

ExampleEdit section

For example, a CACHE.DAT database file is stored on a storage array, and the LUN (or file system) where it resides consists of 16 spindles/drives. Calculate:

High-water mark = (4 * 16) + 1 = 65

Low-water mark = between (.50 * 65) and (.75 * 65) = between 33 and 49 Increase the syncd frequency.

o Edited the /sbin/rc.boot file to increase the syncd frequency from its default

value of 60 seconds to either 30, 20, or 10 seconds. Increasing the frequency forces more frequent I/O flushes and reduces the likelihood of triggering the dead man switch due to heavy I/O traffic.

Corrected Inittab entry on b node.

Increases Swapspace on both nodes to 2.5 gb.

o Calculation used: Current before change = 512.

vmstat > avg /256 = a node:278212 /256 = 1086.75

Page 184: AIX Commands1

= b node 331696 /256 = 1295.63

o Reason for increase due to (DMS) Dead Man Switch Errors:

o If you see an increase in the following parameters, increase the values for better Caché performance: This will have to be monitored since TNG are collection stats on these boxes. I would appreciate a report as of 1 week before and 1 week after to observer system performance. Then a course of action can be assisted as to the below if needed. I recommend when increasing these parameters from the default values:

ImportantEdit section

Change both the current and the reboot values, and check the vmstat output regularly because I/O patterns may change over time (hours, days, or weeks).

Increase the current value by 50%.

Check the vmstat output.

Run vmstat twice, two minutes apart.

If the field is still increasing, increase again by the same amount; continue this step until the field stops increasing between vmstat reports.

pending disk I/Os blocked with no pbuf

paging space I/Os blocked with no psbuf

filesystem I/Os blocked with no fsbuf

client filesystem I/Os blocked with no fsbuf

external pager filesystem I/Os blocked with no fsbuf

HOWTO:Install OpenSSH in AIX Edit this entry - Discuss - Rename - Watch - History Major contributors: matiaslinux, grace12 | All Contributors

Go behind the scenes to discuss ways to use and improve wiki. Visit the hub.

White Papers

Understanding Instant Capacity codewords

Cooling Strategies for Ultra High Density Racks and Blade Servers

Cooling Audit for Identifying Potential Cooling Problems in Data Centers

Community Content

Page 185: AIX Commands1

Free upcoming one day DB2 seminar "Preparing and Optimizing for Today and the Future" (Blogs)

Re: 43P Harddisk (Groups)

Table of contents Hide TOC 1. Introduction2. Installing OpenSSH on AIX 4.3.33. Examples4. Installing openSSH on 5.1, 5.2, and 5.35. Conclusion

IntroductionEdit section

[[Installing OpenSSH on AIX 4.3.3, 5.1, 5.2, and 5.3]]

Installing OpenSSH on AIX 4.3.3Edit section

At 4.3.3, the openSSH is installed using the RPM format packages, not by using installp format which is available at 5.1, 5.2, and 5.3. In this procedure, you need to follow these three steps: 1.Installing the prerequisite filesets. 2.Downloading the rpm packages. 3.Installing the prerequisite rpm packages.

ExamplesEdit section

1.Installing the prerequiste filesets. The filesets rpm.rte and perl.rte are required to be installed prior to installing the rpm packages. The rpm.rte fileset can be found at the following: Linux Toolbox CD or Linux Toolbox Website http://www.ibm.com/servers/aix/products/aixos/linux/download.html The filesets can be installed using smitty installp. 2.Downloading the rpm packages. The rpm packages can be downloaded from the following website: http://www.ibm.com/servers/aix/products/aixos/linux/download.html Once on that page, the prngd (Psuedo Random Number Generator Daemon) daemon and the zlib compression and decompression library can be downloaded. These are the prerequistes for installing the openssl rpm package: prngd-0.9.23-3.aix4.3.ppc.rpm zlib-1.1.4-3.aix4.3.ppc.rpm Next click AIX TOOLbox Cryptographic Content on the sorted content download in the upper right area and then register yourself, if you are not already a registered user. Then click on Accept License button at the bottom of the panel that appears and then you are ready to download the openssl and openssh rpm packages: openssl-0.9.6m-1.aix4.3.ppc.rpm openssl-devel-0.9.6m-1.aix4.3.ppc.rpm openssl-doc-0.9.6m-1.aix4.3.ppc.rpm openssh-3.6.1p2-1.aix4.3.ppc.rpm openssh-clients-3.6.1p2-1.aix4.3.ppc.rpm openssh-server-3.6.1p2-1.aix4.3.ppc.rpm 3.Installing the prerequisite rpm packages. Once you have all the rpm files in the current directory, run the following commands to install them.

rpm -i zlib-1.1.4-3.aix4.3.ppc.rpm

rpm -i prngd-0.9.23-3.aix4.3.ppc.rpm

rpm -i openssl-0.9.6m-1.aix4.3.ppc.rpm

Page 186: AIX Commands1

rpm -i openssl-devel-0.9.6m-1.aix4.3.ppc.rpm

rpm -i openssl-doc-0.9.6m-1.aix4.3.ppc.rpm

rpm -i openssh-3.6.1p2-1.aix4.3.ppc.rpm

rpm -i openssh-server-3.6.1p2-1.aix4.3.ppc.rpm

rpm -i openssh-clients-3.6.1p2-1.aix4.3.ppc.rpm

Sometimes you may get the error: failed dependencies error while trying to install the openssl packages. In that case, run the following command: # rpm -i --nodeps openssl-0.9.6m-1.aix4.3.ppc.rpmThe following command can be run to update the AIX-rpm: # /usr/sbin/updtvpkgThe prngd needs to be installed before openssl and openssh, and openssl is the prerequiste for installing the openssh rpm packages. The openssl-devel-0.9.6m-1.aix4.3.ppc.rpm and openssl-doc-0.9.6m-1.aix4.3.ppc.rpm are not the required packages for installing the openSSH. To verify that these packages are installed, run the following command:

rpm -qa | egrep '(openssl|openssh|prng)'

--> prngd-0.9.23-3 openssl-0.9.6m-1 openssl-devel-0.9.6m-1 openssl-doc-0.9.6m-1 openssh-3.6.1p2-1 openssh-server-3.6.1p2-1 openssh-clients-3.6.1p2-1 These packages are installed under the /opt/freeware directory, and several symbolic links are created in /usr/bin or /usr/sbin, as shown in the following example:

ls -l /usr/bin/ssh

lrwxrwxrwx 1 root system 26 Dec 29 16:13 /usr/bin/ssh -> ../../opt freeware/bin/ssh

ls -l /usr/sbin/sshd

lrwxrwxrwx 1 root system 28 Dec 29 16:12 /usr/sbin/sshd -> ../../ opt/freeware/sbin/sshd

Installing openSSH on 5.1, 5.2, and 5.3Edit section

At 5.1, 5.2, and 5.3, the installation of openssh itself is in installp format, but all the prerequisites (including openssl) can be installed using the same rpm -i commands (using the same 4.3.3. rpm packages). The installp format package can be downloaded from the following site: http://sourceforge.net/projects/openssh-aix After installing the prerequisites using the following commands,

rpm -i zlib-1.1.4-3.aix4.3.ppc.rpm

rpm -i prngd-0.9.23-3.aix4.3.ppc.rpm

rpm -i openssl-0.9.7d-1.aix5.1.ppc.rpm

rpm -i openssl-devel-0.9.7d-1.aix5.1.ppc.rpm

use smitty installp to install the openssh filesets extracted from the tar file openssh-3.8.1p1_51.tar (for 5.1), openssh-3.8.1p1_52.tar (for 5.2), and

Page 187: AIX Commands1

openssh-3.8.1p1_53.tar (for 5.3). The following steps need to be followed to install openssh.

In the directory where the images are, run the command inutoc.

Run smitty install.

Select "Install and Update Software".

While in smitty do the following:

o Select "Install Software".

o Enter a dot (".") in the field for "INPUT device / directory for software" and press ENTER.

o Enter openssh in the "SOFTWARE to install" field.

o Scroll down to "Preview new LICENSE agreements?" and press tab key to change the field to yes. Read the license agreement.

o Scroll down to "ACCEPT new license agreements?" and press tab to change the field to yes. Press ENTER to begin the software installation.

Run the following command to see the openssh filesets installed:

lslpp -l | grep ssh In this case, you notice that the ssh commands are in the /usr/bin directory. For example: ls -al /usr/bin/ssh -r-xr-xr-x 1 root system 309127 Jun 12 2003 /usr/bin/ssh ls -al /usr/bin/scp -r-xr-xr-x 1 root system 38582 Jun 12 2003 /usr/bin/scp Initial configuration at 4.3, 5.1, 5.2, and 5.3: The following entry in /etc/inittab invokes all the scripts starting from S under the etc/rc.d/rc2.d directory upon system startup: l2:2:wait:/etc/rc.d/rc 2 In the /etc/rc.d/rc2.d directory, the following example shows the required symbolic-link to start sshd: At 4.3.3: ls -l /etc/rc.d/rc2.d | grep ssh lrwxrwxrwx 1 root system 14 Dec 29 16:12 K55sshd -> ../init.d/sshd lrwxrwxrwx 1 root system 14 Dec 29 16:12 S55sshd -> ../init.d/sshd At 5.1, 5.2, and 5.3: ls -l /etc/rc.d/rc2.d | grep ssh -r-xr-xr-x 1 root system 307 Dec 29 16:39 Ksshd -r-xr-xr-x 1 root system 308 Dec 29 16:39 Ssshd The prngd daemon is started from the following entry in /etc/inittab: prng:2:wait:/usr/bin/startsrc -s prngd In order to specify the SSH2 protocol to be used for OpenSSH, add the following line to the /etc/ssh/sshd_config file: Protocol 2 To verify the SSH protocol version, you can use the telnet command:

telnet localhost 22

Trying... Connected to localhost.austin.ibm.com. Escape character is '^]'. SSH-2.0-OpenSSH_3.6.1p2 --> the above shows that you are using the ssh2 If you see the following:

telnet localhost 22

Trying... telnet: connect: A remote host refused an attempted connect operation. then the sshd daemon is not running. To terminate, type Ctrl-c and q. To start the daemon, run:

startsrc -s sshd

whenever the /etc/ssh/sshd_config file is modified, the ssh needs to be stopped and restarted as follows:

Page 188: AIX Commands1

stopsrc -s sshd

startsrc -s sshd

The prngd daemon could also be stopped and started in the above method. Once the installation and configuration is complete: The first time you are going to connect to a server, you should receive a host key fingerprint from the adminstrator of that server. On the first attempt to connect to that remote server using OpenSSH, you will see the fingerprint of the remote server. You should verify if this matches with the one sent to you by the adminstrator. Only then, you can type yes.

ConclusionEdit section

Code:Micro-info Edit this entry - Discuss - Rename - Watch - History Major contributors: vasco4it, derrickd | All Contributors

Go behind the scenes to discuss ways to use and improve wiki. Visit the hub.

White Papers

KVM over IP Tech Brief - How KVM over IP Saves Time, Money and Space in Your Data Center

Essential Cooling System Requirements for Next Generation Data Centers

Business continuity solutions for concentration risk mitigation

Community Content

Taking the technical interview: YIKES!!! (Blogs)

Re: running aix 5.x on RS/6000 platform (Groups)

Table of contents Hide TOC 1. Introduction2. Language and Platform3. Compiler4. Version5. Code

IntroductionEdit section

The AIX LVM is very powerful and very complex. Most of the time, one has to type two or more commands to get the information one is looking for.

Page 189: AIX Commands1

This shell script tries to produce what lslv, without options, should have done (list info about all the LVs) with a touch of lsvg and df. As this was written to be a system documentation tool it gives other info like Machine Type, number of CPUs, quantity of RAM and type of disks. It is not very well tested as the type of machines I can use is very limited, so it whould be nice if other admins could contribute to the development. As it is, the width of the terminal window must be at least 94 chars or lines will wrap. Sorry, but all comments are in Portuguese

Language and PlatformEdit section

Korn shell, AIX 4.3.3 and 5.2

CompilerEdit section

None

VersionEdit section

0.1

CodeEdit section

#!/usr/bin/ksh

# micro-info# v0.1 - 2006.02.22 - [email protected]## Fornece informação básica sobre um sistema AIX## 1) Hostname# 2) Modelo do sistema# 3) Quantidade de RAM# 4) Numero e tipo de Discos (SCSI, FC e SSA)# 5) LVM - Basicamente uma combinação entre o# lsvg e lslv com um output bonito# e utilizavel para importação mais# o menos directa para o excel ou# para tabelas word## A Largura minima do ecran para evitar wrap# são 94 colunas## TODO: Signal trapping para eliminar os# files temporários# TODO: Informação de networking

TMPFILE1="/tmp/micro-info-1.$$"TMPFILE2="/tmp/micro-info-2.$$"TMPFILE3="/tmp/micro-info-3.$$"

HOST=`hostname`echo "hostname: $HOST"

### SYS MODEL ###

# O Codigo para determinar o model foi# copiado do cfg2html

Page 190: AIX Commands1

CODE=$(uname -m | cut -c9,10 )case $CODE in 02) MODEL="7015-930";; 10) MODEL="7016-730, 7013-530, 7016-730";; 14) MODEL="7013-540";; 18) MODEL="7013-53H";; 1C) MODEL="7013-550";; 20) MODEL="7015-930";; 2E) MODEL="7015-950";; 30) MODEL="7013-520, 7018-740/741";; 31) MODEL="7012-320";; 34) MODEL="7013-52H";; 35) MODEL="7012-32H";; 37) MODEL="7012-340";; 38) MODEL="7012-350";; 41) MODEL="7011-220";; 42) MODEL="7006-41T/41W";; 43) MODEL="7008-M20";; 46) MODEL="7011-250";; 47) MODEL="7011-230";; 48) MODEL="7009-C10";; 4C) MODEL="7248-43P";; 57) MODEL="7012-390, 7030-3BT";; 58) MODEL="7012-380, 7030-3AT";; 59) MODEL="7012-39H, 7030-3CT";; 5C) MODEL="7013-560";; 63) MODEL="7015-970/97B";; 64) MODEL="7015-980/98B";; 66) MODEL="7013-580/58F";; 67) MODEL="7013-570/770/771/R10";; 70) MODEL="7013-590";; 71) MODEL="7013-58H";; 72) MODEL="7013-59H/R12";; 75) MODEL="7012-370/375/37T";; 76) MODEL="7012-360/365/36T";; 77) MODEL="7012-355/55H/55L";; 79) MODEL="7013-590";; 80) MODEL="7015-990";; 82) MODEL="7015-R24";; 89) MODEL="7013-595";; 90) MODEL="7009-C20";; 91) MODEL="7006-42x";; 94) MODEL="7012-397";; A0) MODEL="7013-J30";; A1) MODEL="7013-J40";; A3) MODEL="7015-R30";; A4) MODEL="7015-R40";; A6) MODEL="7012-G30";; A7) MODEL="7012-G40";; C0) MODEL="7024-E20";; C4) MODEL="7025-F40";; *) MODEL="Unknown";;esacTYPE=$MODELecho "System Model: $TYPE"

### Nº CPUs ###

Page 191: AIX Commands1

c=`lscfg | grep "^+ proc" | wc -l 2>/dev/null`total_cpus=`echo $c`echo "Total CPUs: $total_cpus"

### MEMORIA RAM ###

m=`bootinfo -r`mem_K=`echo $m`mem_G=`expr $mem_K / 1024 / 1024`echo "Memory Size: $mem_G Gb"

### DISKS ###

### - Atenção: Não destingue os hdisk dummy (LUN 0x0) dados pelo DMX800### dos hdisk reais

lscfg | grep hdisk 2>/dev/null >$TMPFILE1t=`wc -l $TMPFILE1`total_disks=`echo $t | awk '{ print $1 }'`echo "Total Disks: $total_disks"

dummy=`grep "SSA Logical" $TMPFILE1 2>/dev/null | wc -l`ssa_disks=`echo $dummy`echo "SSA disks : $ssa_disks"

dummy=`grep "Other FC SCSI" $TMPFILE1 2>/dev/null | wc -l`fc_disks=`echo $dummy`echo "FC volumes : $fc_disks"

dummy=`grep "SCSI Disk" $TMPFILE1 2>/dev/null | grep -v " FC " 2>/dev/null | wc -l`scsi_disks=`echo $dummy`echo "SCSI disks : $scsi_disks"

### LVM ###

### Volume Groups ###

lsvg >$TMPFILE2v=`wc -l $TMPFILE2 | awk '{ print $1 }'`n_vgs=`echo $v`vgs=`cat $TMPFILE2`hdisks=`cat $TMPFILE1 | awk '{ print $2 }'`

for xx in $vgsdo

# Obter o VGid de modo a poder usar o lqueryvg. É muito mais# simples fazer o parsing do output do lqueryvg que o do lsvg

vgid=`lsvg $xx | head -1 | awk '{ print $6 }'`lqueryvg -tA -g $vgid >$TMPFILE3

pp_size=`grep -i "pp Size:" $TMPFILE3 | awk '{ print $3 }'`pp_free=`grep -i "free pps:" $TMPFILE3 | awk '{ print $3 }'`pp_total=`grep -i "total pps:" $TMPFILE3 | awk '{ print $3 }'`

# Ainda estou para encontrar uma boa razão para o partition size# ser indicado como uma potencia. Ainda por cima o formato não é# muito consistente.

Page 192: AIX Commands1

# 27=2^7, 28=2^8, 29=2^9 mas 2^10 é representado como 30 - daahhhh# O codigo que fiz para tratar disto não é certamente muito# robusto, uma vez que não encontrei informação completa e credivel# sobre este formato

base=`echo $pp_size | cut -b 1`exp=`echo $pp_size | cut -b 2`if [ $base -eq 2 ]then

:else

if [ $base -eq 3 ]then

base=2(( exp = 10 + $exp ))

fifi

# Não me consigo habituar à aritemética da Korn Shell

pp_size_val=`echo "$base^$exp" | bc`pp_free_val=`echo "$pp_size_val*$pp_free" | bc`pp_total_val=`echo "$pp_total*$pp_size_val" | bc`

# Aqui tem mesmo que ser, a korn shell do aix só dá# inteiros. NOTA: Estes IFs deviam ser uma função

if [ $pp_free_val -ge 1024 ]then

pp_free_val=`echo "scale=1;$pp_free_val/1024" |bc`pp_free_units="GBytes"

elsepp_free_units="MBytes"

fi

if [ $pp_total_val -ge 1024 ]then

pp_total_val=`echo "scale=1;$pp_total_val/1024" | bc`pp_total_units="GBytes"

elsepp_total_units="MBytes"

fi

echo "\n* $xx"echo " - VG ID: $vgid"

# Escrever os hdisks que fazem parte de um VG.

echo " - Hdisks: \c"

hdisk_str=""hdisks_vg=`lsvg -p $xx | sed -e '1,2d' | awk '{ print $1 }' | sed -e 's/[\t ]//g' `for yy in $hdisks_vgdo

hdisk_str="${hdisk_str} $yy"doneecho $hdisk_str

Page 193: AIX Commands1

echo " - PP Size: $pp_size_val MBytes"echo " - Size: $pp_total_val $pp_total_units ($pp_total PPs)"echo " - Free: $pp_free_val $pp_free_units ($pp_free PPs)"

### Logical Volumes / File systems ###

lsvg -l $xx | sed -e '1,2d' -e 's/ */~/g' >$TMPFILE1echoprintf "%-16s|%-7s|%1s|%-12s|%-32s|%-10s|%-10s\n" "Logical Volume" "Type"

"M" "State" "Mount Point" "Size" "Free" printf "%-16s+%-7s+%1s+%-12s+%-32s+%-10s+%-10s\n" "----------------" "-------"

"-" "------------" "--------------------------------" "----------" "----------" for zz in `cat $TMPFILE1`do

zz=`echo $zz | sed -e 's/~/ /g'`lvname=`echo $zz | awk '{ print $1 }'`type=`echo $zz | awk '{ print $2 }'`lps=`echo $zz | awk '{ print $3 }'`pps=`echo $zz | awk '{ print $4 }'`pvs=`echo $zz | awk '{ print $5 }'`lvstate=`echo $zz | awk '{ print $6 }'`mountpoint=`echo $zz | awk '{ print $7 }'`if [ "$mountpoint" = "N/A" ]then

mountpoint="-"fi

### FS SIZE INFO ###

# Apesar de saber que é possivel ter um filesystem# que não ocupa todo o LV, não encontrei maneira# directa de encontrar isto, penso que apenas# será detectavel comparando os tamanhos entre o# lslv e o lsfs

if [ "$type" = "jfs" -o "$type" = "jfs2" ]then

fsinfo=`df -kt $mountpoint | sed -e '1d'`fs_size=`echo $fsinfo | awk '{ print $2 }'`fs_free=`echo $fsinfo | awk '{ print $4 }'`

# isto tem mesmo que passar para uma função

if [ $fs_size -ge 1024 ]then

fs_size=`echo "scale=1;$fs_size/1024" |bc`if [ $fs_size -ge 1024 ]then

fs_size=`echo "scale=1;$fs_size/1024" |bc`fs_size="${fs_size} GB"

elsefs_size="${fs_size} MB"

fielse

fs_size="${fs_size} KB"fi

if [ $fs_free -ge 1024 ]

Page 194: AIX Commands1

thenfs_free=`echo "scale=1;$fs_free/1024" |bc`if [ $fs_free -ge 1024 ]then

fs_free=`echo "scale=1;$fs_free/1024" |bc`fs_free="${fs_free} GB"

elsefs_free="${fs_free} MB"

fielse

fs_free="${fs_free} KB"fi

else### LV SIZE INFO ###

# Deve ser por sadismo que os lquery's obrigam ao# uso dos vários identifiers em vez do nome.

lvid=`lslv -L $lvname | grep "LV IDENTIFIER" | awk '{ print $3 }'`

lvpps=`lquerylv -cL $lvid`

# O pp_size_val é único dentro do mesmo VG# portanto não tem que ser calculado para cada# LV

(( lv_size = $lvpps * $pp_size_val ))if [ lv_size -ge 1024 ]then

lv_size=`echo "scale=1;$lv_size/1024" |bc`" GB"else

lv_size="${lv_size} MB"fi

fs_size=$lv_sizefs_free="-"

fi(( dummy = $lps * 2 ))if [ $pps -eq $dummy ]then

mirror="2"else

(( dummy = $lps * 3 ))if [ $pps -eq $dummy ]then

mirror="3"else

if [ $pps -ne $lps ]then

mirror="?"else

mirror="1"fi

fifiprintf "%-16s|%-7s|%1s|%-12s|%-32s|%10s|%10s\n" "$lvname" "$type"

"$mirror" "$lvstate" "$mountpoint" "$fs_size" "$fs_free"done

Page 195: AIX Commands1

printf "%-16s+%-7s+%1s+%-12s+%-32s+%-10s+%-10s\n" "----------------" "-------" "-" "------------" "--------------------------------" "----------" "----------" done

rm -f $TMPFILE1rm -f $TMPFILE2rm -f $TMPFILE3

exit 0

HOWTO:AIX 5L 5.2 hangs on CDE Edit this entry - Discuss - Rename - Watch - History Major contributors: grace12 | All Contributors

Go behind the scenes to discuss ways to use and improve wiki. Visit the hub.

White Papers

Backup Planning and Performance Tuning Guide

Essential Cooling System Requirements for Next Generation Data Centers

Increase ROI through scalability & intelligent manageability

Community Content

New Podcast is Up There....Show 13 (Blogs)

RE: Adding a JetDirect network printer through SMIT - what's wrong? (Groups)

Table of contents Hide TOC 1. Introduction2. Steps3. Examples4. Conclusion

IntroductionEdit section

AIX 5L 5.2 hangs on CDE (Common Desktop Environment) when it's change the hostname and reboot the system. We figured out that the problem is with the network card.

StepsEdit section

So to solve this situation you have to: Use smit and enable/disable the card. smit -> Communication Applications and Services -> TCP/IP -> Further Configuration -> Network Interfaces -> Network Interface Selection -> Change/Show Characteristics of a Network Interface -> "Select Network Interface" and Change the Current State to Down.

Page 196: AIX Commands1

And again follow the same route and Change the Current State to Up. And try again the CDE.

ExamplesEdit section

Just follow the above instructions.

ConclusionEdit section

This is just a solution but we do not know exactly why this problem occurs we are stil under investigation. If you have more about please add your comments to this note.

Hello Folks

Has anyone install 5.3 from the nim to a client on a different network ...When I kick off the server prints this out on the command line " BOOTP server" and just hangs there. What am I doing wrong .. Any help will be appreicated ....

Thanks

Find A Job or Post a Job Opening Click Here.plamb (MIS)31 Oct 06 17:42

make sure firewall are open for for bpptp and tftp etc

wsw3 (IS/IT--Management)31 Oct 06 22:46

NIM allows you to define another NIM network object in case the client and server reside on different networks.  You can then associate the client with that network.  You may need to do this.

If new to NIM, check out the man page for the nimdef command which will allow you to preview and then define a client given an input file which contains information about the client and its network settings.

HTH..

plamb (MIS)1 Nov 06 7:57

Our NIM server has access to 30 different networks form a single "admin" network

june54 (TechnicalUser)1 Nov 06 8:09

Hello Plamb and WSW3

Page 197: AIX Commands1

Thanks for the info .. I have found out from our network folks that the network is configured not to use the MAC address from outside network it uses the IPaddress . I have made the entry for the Network Address  on the master for the client to '0' According to tne man pages it will use the ipaddress . When I execute it still hangs at EIAD. I have setup to networks which are  ent-network  and network

Thanks

wsw3 (IS/IT--Management)2 Nov 06 0:51

What type of client host is it?  Is it a LPAR? Standalone machine? P4, P5?

Is the client connected to an HMC?  If connected to a HMC  (or it has a console display), have you booted the host into SMS and then changed both the boot device order and the remote ipl options to tell it how to connect to the NIM server?

If so, do a ping test within SMS to see if the client can communicate with the NIM server and let us know the results.

Hi

I need to check a volum group. Is there a command for this ?

RegardsDen

Tek-Tips Forums is Member Supported. Click Here to donate.Gloups (IS/IT--Management)30 Oct 06 11:02

lsvg your_vg_name

KenCunningham (TechnicalUser)30 Oct 06 11:02

What do you mean by 'check'?

Quote (Alan Bennett):I don't mind people who aren't what they seem. I just wish they'd make their mind up.

mrn (MIS)30 Oct 06 11:04

man lsvg

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."

Page 198: AIX Commands1

yoda37 (TechnicalUser)30 Oct 06 11:26

The command fsck work on the file system level only. I'd like to verify the good health of my volum groups.

Thanks in advanceregardsDen

KenCunningham (TechnicalUser)31 Oct 06 3:08

As Mike says, man lsvg. For example lsvg -l rootvg will give you the following (from the man page):

Quote:-l Lists the following information for each logical volume within the group specified by the VolumeGroup parameter:

LV  A logical volume within the volume group.Type  Logical volume type.LPs  Number of logical partitions in the logical volume.PPs  Number of physical partitions used by the logical volume.PVs  Number of physical volumes used by the logical volume.Logical volume state  State of the logical volume. Opened/stale indicates the logical volume is open but contains partitions that are not current. Opened/syncd indicates the  logical volume is open and synchronized. Closed indicates the logical volume has not been opened.Mount point

Quote (Alan Bennett):I don't mind people who aren't what they seem. I just wish they'd make their mind up.

khalidaaa (TechnicalUser)1 Nov 06 4:26

good health of a volume group?!? i think you mean checking the ODM against the VGDA or something right?look for lqueryvg and odmget commands

DukeSSD (TechnicalUser)1 Nov 06 19:08

if you want to check if your rootvg filesystem is still viable try:lppchk -vm3this will tell you if AIX is still intact.

Page 199: AIX Commands1

Hi...GuysPlease help me. I have problem with some remote printer installed(LPT1) in IBM AIX 5L. I am using LPD Demon to take print from AIX. But oftenly the print queue is showing down & I have to enable the printer again & again. I am using 64KBP leased line which almost giving 99% uptime. Is there anybody to help me out...how to solve the trouble. Please let me know. 

Start your own Tek-Tips Group! Click Here!mrn (MIS)26 Oct 06 4:16

Create a script that checks the queue and re-enables it if it's down something like (Not tested) and run from crontab.

enq -qs -A |while read printer dev statusdoif [ "$status" = "DWN" ]thenenable $printerfidone

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."

KenCunningham (TechnicalUser)26 Oct 06 4:37

Seems to work for some printers Mike, but I don't know whether the enable would work if the printer name is longer than the 'Queue' field allows in the output of enq -qs -A.

Quote (Alan Bennett):I don't mind people who aren't what they seem. I just wish they'd make their mind up.

KenCunningham (TechnicalUser)26 Oct 06 4:46

If it's only the one printer, adapt Mike's script like:

lpstat -pprintername |while read printer dev statusdoif [ "$status" = "DOWN" ]thenenable printernamefidone

Quote (Alan Bennett):

Page 200: AIX Commands1

I don't mind people who aren't what they seem. I just wish they'd make their mind up.

cspilman (MIS)27 Oct 06 8:13

If you wanted to check all printers and want to avoid the name length issue, you could do something like:

CODElsallq | while read printerdo  lpstat -p${printer} | while read pname dev status  do      if [ "${status}" = "DOWN" ] ; then         enable ${pname}      fi  donedone Regards,Chuck

sraj142 (TechnicalUser)28 Oct 06 2:00

Hi Guys...thank you all for the reply, But what about the jobs in the queue which are already printed but, not cleared from queue. After enabling printer thease jobs will also be printed out, which I need to overcome.

Pls help.

Regards,sraj142

 

mrn (MIS)30 Oct 06 11:03

See thread52-1182246 for a few different ways to do this.

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."

Anyone here practice, unmirroring rootvg before applying ML/TL?

I have a NFS share with my ML8, I usually do a mount and an smit update_all

Is this a good practice or overkill?

Page 201: AIX Commands1

Tek-Tips Forums is Member Supported. Click Here to donate.DukeSSD (TechnicalUser)23 Oct 06 19:46

Good question Mag0007.

I unmirror for a mksysb because there can be problems restoring if you don't but I've never had a problem doing a ML, TL or SP upgrade on a mirrored rootvg.

Anyone else care to comment?

zaxxon (MIS)24 Oct 06 5:27

We never unmirror for applying a ML nor for an mksysb. We never did this in the last years and never had any problems because of this.We only unmirror cause of removing a disk cause for example if it has a defect or if we distribute our disks anew for some layout reason.

laterszaxxon

DukeSSD (TechnicalUser)24 Oct 06 15:40

zaxxon,have you tried restoring those mksysb's?mksysb's seem to work fine if the rootvg is mirrored but the restore causes the problem....

Mag0007 (MIS)24 Oct 06 20:44

Okay guys, here is what I tried, and works perfectly!

Unmirror my rootvg Reduce my rootvg (remove hdisk1 from rootvg)alt_diskinstall -C hdisk1 (this takes a mksysb of hdisk0, and restores it to hdisk1, and change the bootlist to hdisk1, and sets bootimage on hdisk1)Reboot (will automatically boot to hdisk1)Apply TL

Just tried, it works awesome!

Mag0007 (MIS)24 Oct 06 20:48

Sorry, forgot to put restore directions.

In case your TL gives you issues, here is how you revertchange bootlist to hdisk0 (bootlist -m normal hdisk0)

Page 202: AIX Commands1

rebootalt_diskinstall -X (this will clean up the hdisk1 image, and clean up ODM entries)

HTH

blasvinas (IS/IT--Management)24 Oct 06 22:27

Why don't you just apply the updates and then if you have any problems just reject the changes?

Mag0007 (MIS)25 Oct 06 11:42

Yes, I can do that too, but never did, or really know how functional that is...

columb (IS/IT--Management)25 Oct 06 12:52

Just my two-penny worth.

I administer a number of AIX boxes, mostly at AIX 5.1 but we still have a few AIX 4.3.3 systems. I never break the mirror for ML upgrades or backups. I have never restored any of the mksysb backups on our live servers, I hope I never have to(!) but I regularly restore a 'vanilla' mksysb onto my dev system without any problems.

For procedural reasons I'm forced to install all software, including ML upgrades, as 'APPLIED' rather than 'COMMITTED' to allow for easy rollback. We tent to commit one set of software just before we install the next.

What I'm experimenting with is alt_disk_install for migrating AIX 5.1 to AIX 5.2 (or hopefully AIX 5.3). This is the only time I'd break the mirror.

Ceci n'est pas une signatureColumb Healy

bi (TechnicalUser)25 Oct 06 15:20

And here is what we do where I work:

Usually, we just apply the ML/TL without unmirroring. But if it is a production system and they can't take a long outage for installing the update, we do an alt_clone for the update. (Yes, I know you can install software while the system is in use, but I don't like to do it on production.)

Unfortunately, we didn't do an alt_clone on a system that has a DB2 database and didn't discover until it was too late that 5.3 TL5 breaks DB2.

DukeSSD (TechnicalUser)25 Oct 06 20:41

You should also take care these days with installing updates as applied - with the TL updates some new filesets are included and they will only install as commited - so you can't back out....

Page 203: AIX Commands1

Mag0007 (MIS)26 Oct 06 12:05

Quote:You should also take care these days with installing updates as applied - with the TL updates some new filesets are included and they will only install as commited - so you can't back out....

Thats a good reason to unmirror and apply the ML, incase you can't revert back, just boot of old disk

DukeSSD (TechnicalUser)26 Oct 06 19:31

Mag0007, I totally agree, and three way mirroring will save you if the alt install has a problem and you have a hardware problem on one of the remaining disks.

Don’t forget you are exposed from the point the mirror is broken and the upgrade starts if you only had a two way mirror.

zaxxon (MIS)27 Oct 06 3:02

@DukeSSD

The last restore of a mksysb is was some years ago but I remember I had no problem at all. I was cloning a box from a mksysb and a savevg via tapes.It was AIX 4.3.3 for sure.

laterszaxxon

zaxxon (MIS)27 Oct 06 3:17

Forgot to add, the rootvg was mirrored on hdisk0 and 1 of course. Also our service representatives never unmirrored a VG when applying a ML or when getting a mksysb. I never heared of that in the last 6 years - it's the 1st time I heared that in this post here; totally new for me.

laterszaxxon

Hi all,

I need to write on a tape drive with AIX5.3.How to know the name of this tape and what is the procedure to write on this tape?

Regards,Tovo

Page 204: AIX Commands1

Start your own Tek-Tips Group! Click Here!Gloups (IS/IT--Management)30 Oct 06 2:55

lsdev -Cc tape to find your tape drives

dd if=your_file_name of=/dev/rmtx ....

rondebbs (MIS)17 Oct 06 17:27

As I look at rootvg on several systems, I see that it is made up of two 36gb internal disks hdisk0 and hdisk1. All other VGs are on emc storage. I had always thought that hdisk0 and hdisk1 were 100% mirrored. As it turns out two logical volumes (paging00 and paging01) are on hdisk1 but not hdisk0.  LG_dumplv is on hdisk0 but not on hdisk1. All other LVs including hd5 (paging) seem to be mirrored on both disks.

It appears that if I lose hdisk1 I will no longer have paging00 and paging01. If I lose hdisk0 I will lose LG_dumplv. I would like to run mklvcopy to create a mirror of those LVs but there are not enough free partitions on the disks. I'm guessing that is why they were not mirrored in the first place.

Is it common or risky to not have these LVs mirrored?

Maybe I need to add two more disks for hdisk2 and hdisk3 and add them to rootvg. In this case I would unmirror hdisk0 and hdisk1. Then leave half the LVs on hdisk0 and move the other half to hdisk1. I would then mirror hdisk0 to the new hdisk2 and mirror hdisk1 to the new hdisk3. Is this getting too messy?

Can I add 73GB drives and extend rootvg with them even though hdisk0 and hdisk1 are 36GB?

Thanks - Brad

Start your own Tek-Tips Group! Click Here!p5wizard (IS/IT--Management)18 Oct 06 2:55

For a rootvg, you need to mirror everything except the dump LVs, but there is a possibility to set up two dump devices (primary and secondary) so that a failed disk would still allow the system to create dumps on another disks should this be necessary.

To make things easier for you (less migration/unmirror/mirror activity), you can add two disks and make a separate VG for the paging spaces other than hd6. Then add/activate more paging spaces and deactivate the paging00 and paging01 in rootvg and remove these LVs from rootvg. On AIX53 it is possible to deactivate a running paging space while the system is running. On 52 and lower, this would involve a reboot.

After paging00 and paging01 are removed, you would get free space in rootvg to create an additional dump LV. See smitty dump on how to set up the primary and secondary dump LVs. I generally call them hd7x, with x being the disk number. so hd70 on hdisk0 and hd71 on hdisk1. But it can be any two names you prefer.

oh, and depending on the rootvg PP size you can add 73G disks, but then you may need to convert rootvg first to allow more than 1016 PPs per PV: e.g.

chvg -t2 rootvg

Page 205: AIX Commands1

converts rootvg from max 32PVs of max 1016PPs to max 16PVs of max 2032PPs.

HTH,

p5wizard

rondebbs (MIS)18 Oct 06 12:14

I like the idea of moving paging00 and paging01 to the new disks. Unfortunately I'm at 5.2 so I'll have to squeeze in a reboot at some time for my 24/7 system.

Regarding lg_dumplv that is currently using 48 PPs on rootvg/hdisk0 - can I also move this out of rootvg and onto the new disks? I'm just not sure whether some of these LVs need to stay on rootvg for some reason.

Thanks - Brad

p5wizard (IS/IT--Management)18 Oct 06 16:18

Apparently swapoff command is also available on AIX52. But see if you can do it on a test system first. I've only ever deactivated a swapspace on AIX53.

The primary dump device must be in rootvg and must be unmirrored, so for 2 mirrored disks in rootvg, I generally create a 'mirror image' of the lg_dumpdev on the other rootvg disk.

HTH,

p5wizard

Hi!

In the writing of a statistics script rose the need to determine the exact size of a hdisk. I would need a general way to to this, which works even on SAN disks (SDD and SDDPCM) and simple SCSI disks as well. Can you tell me such method?

--Trifo

Find A Job or Post a Job Opening Click Here.mrn (MIS)17 Oct 06 6:09

As long as it's in a volume group you could use

lspv hdisk0

see Total PP's

for i in `lspv | awk '{print $1}'`

Page 206: AIX Commands1

dolspv $idone

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."

trifo (MIS)17 Oct 06 6:39

Hi Mike!

Well, it was one of my first thoughts as well. However it is not suitable for me, as there are a bunch of disks in GPFS use which do not have PVID and VG assignement, thus lspv throws an error.

I would need some general method. Some ODM query or SCSI magic or whatever.

--Trifo

khalidaaa (TechnicalUser)17 Oct 06 6:57

how about prtconf?

I'm not sure if it will suit your requirement as it has alot of info with it.

Regards,Khalid

mrn (MIS)17 Oct 06 7:34

Try

getconf DISK_SIZE /dev/hdisk30

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."

p5wizard (IS/IT--Management)17 Oct 06 7:34

bootinfo -s [diskname]

e.g.

bootinfo -s hdisk0

Page 207: AIX Commands1

size is in megabyte

HTH,

p5wizard

xyz786 (IS/IT--Management)17 Oct 06 16:17

lscfg | grep hdisk, this will show you disk size in brackets.

p5wizard (IS/IT--Management)17 Oct 06 16:53

lscfg only shows size of locally connected supported drives, not for "other scsi disk" of SAN LUNs

bootinfo -s works on all disks that can be opened...

HTH,

p5wizard

trifo (MIS)18 Oct 06 3:49

Hi!

Thanks for the tips, especially p5wizard for the bootinfo -s. Even though I will need to use the output of "pcmpath/datapath query essmap" and some string manipulation magic, as I will need to collect LUN id-s along with disk sizes.

Even though there are some oddnesses around disk sizes: when I allocate a 50GB LUN for an AiX 5.2 host with SDDPCM, pcmpath reports its size as 47.7GB. The same 50GB LUN appears on an AiX 4.3 host with SDD as 50.0GB.There are also differences in the output of getconf/bootinfo and also in the lsvg -p reports. The differences reach 5-6%.

--Trifo

p5wizard (IS/IT--Management)18 Oct 06 5:18

ESS LUNs are created in 10^9 GB sizes (0.1 increment)DS6k/DS8k LUNs are created in 2^30 GB sizes (and best is to use 1GB increments, otherwise you're wasting space inside the DS6k/DS8k, because allocation is on 1GB boundaries)

SDDPCM assumes DS6k/DS8k LUNs and takes the disk size in MB, divides by 1024 to get GB value. So you get a wrong value if you use SDDPCM for ESS LUNs

SDD assumes ESS LUNs and takes disk size in MB, divides by 1000 to get GB value - again wrong values if SDD is used for DS6k/DS8k LUNs.

Page 208: AIX Commands1

If your script uses bootinfo and divides by 1024 you should get a correct value which corresponds with the lsvg -p size.

Also, PV size will allways be a multiple of the PP size. For large PP size, you can lose some of the disk's MBs.PP size of 128MB -> max loss is 127.999MB if the last PP doesn't fit.

a SCSI disk of 36GB is a bit more than 36400 MB (x 1000000) - at least that's what lscfg says - but put it in a VG and you start dividing it in 1024s instead of 1000s - this also gives a difference of 5%. In a 64MB PP VG you get 542 PPs = 34688 MBs (x 1024 x 1024) (diff of 4.7%)

HTH,

p5wizard

i have just finished a build of AIX5.3 and i have been asked to create a new volume group, what is the recomended Physical Partition Size for doing this?

5.3 as follows

VGType,    Max PVs,   Max LVs,   Max PP per VG, Max PP sizeNormal VG, 32     ,   256    ,   32512        , 1 GBBig VG   , 128    ,   512    ,   130,048      , 1 GBScalable , 1024   ,   4096   ,   2,097,152    , 128 GB

MikeHi all,

I have 2 boxes both running ML5.2. They are configurated as a HACMP. How to check their HACMP versions and how to know any HACMP patch they have been applied already? What is the latest version and its patches? Thanks!

Regards,Jack

Find A Job or Post a Job Opening Click Here.ogniemi (TechnicalUser)11 Oct 06 15:46

lslpp -l|grep -i cluster

Hi,

I have two AIX servers and running under HACMP.The momet I do smitty clstart in one node, it start the cluster service and after successful run, it runs some application which is basically a shell script, and it is defined under HACMP setting. I tried all the way, biut couldn't locate it.

Page 209: AIX Commands1

How can I find that out and in which place it is written ?I want to stop that process which is running automatic. Any idea ?

Thanks..

Sam

Find A Job or Post a Job Opening Click Here.khalidaaa (TechnicalUser)12 Nov 06 17:08

you need to do the following:

smitty hacmp --> Extended configuration --> Extended Resource Configuration --> HACMP Extended Resource Configuration --> Configure HACMP Application --> Configure HACMP Application Server --> Change/Show An Application Server --> and remove the start and stop script fields!

Regards,Khalid

Hello,

I'm coming across this odd issue where every so often (really sporadic), my p5 510 running 1.9Ghz 1-way with 5GB of RAM on AIX 5.3 ML04 will run in a super slow state. It always happens on a weekday, always between 9:15AM - 10:00AM, and the only fix seems to be a reboot. I try to run commands during this state but the response is too long for me to wait since this is a Production machine. I run my commands from the console too, but still takes too long. I can ping the server, but my oracle apps can't connect.

I can't really tell if the system is 'Thrashing', but isn't that a tell-tale sign of a system that takes forever to respond?

The SGA size is 1.8GB.

I am using CIO mounted filesystems for Oracle. Since I'm using CIO, isn't tweaking the vmo values moot?

I did do a test yesterday w/ our DBA and had him run several  SQL statements that ran reads/writes to our Oracle Database and there were high periods of 'po' values in vmstat when ran all at the same time.

In the /etc/security/limits file, here is what I have:

oracle:                           fsize = -1                data = -1                 rss = -1                  stack = -1                cpu = -1                  nofiles = -1

This pretty much allows oracle user unlimited usage of resources including memory. I was told by Oracle to do this. What do you guys think of putting a hard limit on rss_hard instead so oracle can't usurp all of the memory.

Here are some statistics of the system during window I've specified above.

Page 210: AIX Commands1

# vmstat -I 2

kthr     memory              page                     faults        cpu             -------- ----------- ------------------------     ------------ -----------          r  b  p   avm     fre  fi  fo  pi  po  fr   sr   in   sy  cs us sy id wa 1  0  0 1269791  2305 271  25 150   0 183 5736 281 2081 616 22  3 37 39         0  1  0 1269826  3601 250  73 174  60 1128 32260 400 4178 920 17  5 37 41       2  1  0 1264021  8311 410   6 137   0   0    0 285 2690 729 17  2 39 41         0  1  0 1262058  9109 410  32 154   0   0    0 341 2006 737 14  3 41 43         1  1  0 1265977  4259 327   4 138   0   0    0 270 2932 594 22  3 37 38         0  1  0 1270081  2322 301   8 162  27 1546 34085 577 4924 1136 17  5 38 40      1  1  0 1270085  3823 310  22 164  44 1260 18072 442 3102 957 14  4 40 42       1  1  0 1264271  8398 485  26 145   0   0    0 285 1333 648  9  2 43 45         1  1  0 1262308  9653 206   7 148   0   0    0 256 1993 565 23  2 37 38         1  0  0 1266088  5085 271  30 104   0   0    0 259 2841 563 39  3 28 31         2  0  0 1264067  8189 561  11  78  31 1187 23368 352 6659 754 58  6 17 19       5  0  0 1272173  3331 801   9  72 574 2266 32042 455 9520 720 42  7 24 27       1  1  0 1266288  7477 807   6  62   0   0    0 280 2056 576 35  2 30 32         1  1  0 1266024  6482 589   5  37   0   0    0 582 6605 1196 51  4 22 23        2  0  0 1270404  2423 562  11  45 137 769 5268 648 10259 1271 52  7 20 21       0  1  0 1274318  2226 682   6  48 1543 2633 3702 488 4457 585 39  7 27 28       0  1  0 1269710  6955  60  17  40 129 129  151 546 9169 1115 28  6 54 12

# svmon -G                                                                                                               size      inuse       free        pin    virtual               memory      1261568    1245228      16340     132874    1188198               pg space    3637248     254426                                                                                                                                                            work       pers       clnt                                     pin          132874          0          0                                     in use      1024221          0     221007                                                                                                                   PageSize   PoolSize      inuse       pgsp        pin    virtual               s   4 KB          -    1194956     238202     100378    1122966               m  64 KB          -       3142       1014       2031       4077## lsps -a                                                                      Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Typepaging00        hdisk3            oraclevg      8192MB     8   yes   yes    lv hd6             hdisk1            rootvg        6016MB     7   yes   yes    lv #

# vmo –acpu_scale_memp = 8        data_stagger_interval = 161                      defps = 1          force_relalias_lite = 0                    framesets = 2                    htabscale = n/a          kernel_heap_psize = 4096      large_page_heap_size = 0                 lgpg_regions = 0                    lgpg_size = 0              low_ps_handling = 1              lru_file_repage = 0            lru_poll_interval = 10                   lrubucket = 131072              maxclient% = 80                     

Page 211: AIX Commands1

maxfree = 1088                   maxperm = 968863                maxperm% = 80                      maxpin = 1018607                maxpin% = 80             mbuf_heap_psize = 65536          memory_affinity = 1                memory_frames = 1261568memplace_data = 2        memplace_mapped_file = 2     memplace_shm_anonymous = 2          memplace_shm_named = 2              memplace_stack = 2               memplace_text = 2      memplace_unmapped_file = 2                    mempools = 1                     minfree = 960                   minperm = 242215               minperm% = 20                  nokilluid = 0                     npskill = 36608               npsrpgmax = 292864              npsrpgmin = 219648            npsscrubmax = 292864            npsscrubmin = 219648                npswarn = 146432       num_spec_dataseg = 0                   numpsblks = 4685824     page_steal_method = 0                pagecoloring = n/a           pinnable_frames = 1144691npsrpgmin = 219648            npsscrubmax = 292864            npsscrubmin = 219648                npswarn = 146432       num_spec_dataseg = 0                   numpsblks = 4685824     page_steal_method = 0                pagecoloring = n/a           pinnable_frames = 1144691 pta_balance_threshold = n/a       relalias_percentage = 0                    rpgclean = 0                  rpgcontrol = 2                       scrub = 0                  scrubclean = 0       soft_min_lgpgs_vmpool = 0            spec_dataseg_int = 512          strict_maxclient = 1              strict_maxperm = 0                    v_pinshm = 0        vm_modlist_threshold = -1            vmm_fork_policy = 1          vmm_mpsize_support = 1      

I just think we have too little physical memory for our workload, but I would love to hear what you guys think and how your AIX/Oracle environments are tuned.

Page 212: AIX Commands1

Thanks!

Find A Job or Post a Job Opening Click Here.mbourne2006 (IS/IT--Management)14 Nov 06 12:57

Hi

Consider lowering minperm% and maxperm%

e.g.

minperm%=10maxperm%=40 (you will need to lower maxclient%=40 too)

and see what difference that makes.

HTH

Kind Regards,Matthew Bourne"Find a job you love and never do a day's work in your life."

tech123786 (TechnicalUser)14 Nov 06 14:42

Yes, lowering minperm and maxperm will resolve this issue. Are you using AIOs?

Hello,Is there anyway to make the all the cronjobs reltaed to a specific users (ex: database)to failover with the resources from a primary node to a secondary node (in all types of failovers) and vice versa? Any suggestions..

Thanks

Start your own Tek-Tips Group! Click Here!columb (IS/IT--Management)13 Nov 06 10:23

Our cronjobs run on both sides of the cluster but have, as the first part of the script, a test for the existance of the relevant filesystems.i.e our filesystems are/thishost/usr/<mount point> and/thathost/usr/<mount point>.

So a cronjob can start

CODE[[ -d /thathost/usr/thatmount/subdir ]] && RunOtherHostJobCeci n'est pas une signature

Page 213: AIX Commands1

Columb Healy

tech123786 (TechnicalUser)13 Nov 06 10:33

Columb,Thanks for the response.Running cronjobs on both nodes is not an option . I was looking for a way to failover a primary nodes cronjobs on secondary and vice versa so there would be no need for users to update cronjobs on bothsides each time if they want to change something.

Could you please explain be clearly how this can be achieved?

Thanks

spamly (MIS)13 Nov 06 16:21

1. Add the following to your resource group's crontab:

CODE# Copy this crontab to /resource-filesystem every day0 0 * * * /usr/bin/crontab -l /resource-filesystem/${CRONUSER}.crontab

2. In the application stop script:

CODEcrontab -r $CRONUSER

3. In the application start script:

CODEecho "Implementing ${CRONUSER} cron..."cp /resource-filesystem/${CRONUSER}.crontab /var/spool/cron/crontabs/${CRONUSER}chmod 644 /var/spool/cron/crontabs/${CRONUSER}chown root:cron /var/spool/cron/crontabs/${CRONUSER}su - ${CRONUSER} -c "crontab -v"

tech123786 (TechnicalUser)13 Nov 06 17:03

Spamly,Thanks for the info, could you explain me little more about 1. Add the following to your resource group's crontab:

CODE# Copy this crontab to /resource-filesystem every day0 0 * * * /usr/bin/crontab -l /resource-filesystem/${CRONUSER}.crontabWhat do you mean by resource group crontab?

Thanks

spamly (MIS)13 Nov 06 17:32

Page 214: AIX Commands1

Sorry about that.  The point of that snippet is to regularly copy your users crontab to a standard location.  This should be part of the users crontab.  I do this daily so that if I do failover, it will have a crontab that is no more than 24 hours old.  

khalidaaa (TechnicalUser)13 Nov 06 18:04

I don't know how effective this solution would be but i thought of trying it on one of my test clusters (not done it yet) and see how it works!

you can copy the crontab file over to the second node!

scp /var/spool/cron/crontabs/root secondNodeName:/var/spool/cron/crontabs/root

you can add this line to the cluster events or even (but not recommended) in the start-stop application scripts.

Regards,Khalid

tech123786 (TechnicalUser)14 Nov 06 14:39

Thanks Spamly, I will try this out. And one more thing is if the node crashes then it will not stop the apps server , in that case it's better to add  crontab -r $CRONUSER in /etc/rc.d as well as app stop script.

Hy, a had a disk crash we replaced disk and no i want to restore from my mksysb backup.I don't have tape only SP CWS wich i don't know how to use.Is it posible to start up server with aix CD go to maintanance mode and do a restore from there, i would save image to a cd.

Start your own Tek-Tips Group! Click Here!MMacun (TechnicalUser)13 Nov 06 8:26

One more thing, I installed a fresh AIX on new disk and restore my rootvg from smit, but whe i restarted system, rootvg can not be varyed on becouse PVID's are different now

madmurdock (MIS)13 Nov 06 8:39

If you have an Sp cws, there is a NIM Master installed on it. So you can restore your node from a (hopefully) saved mksysb via NIM.

It would cost now a lot of time to explain it all to you, perhaps you can start by typing:

splstdata -n

and finding the node you want to restore, get the node_number and type an

Page 215: AIX Commands1

splstdata -b -l <node_number>

Thats enough for the moment, paste in the result.

hth

mad

Advanced Interactive eXecutable

MMacun (TechnicalUser)13 Nov 06 8:53

splstdata -n  17      2     1     1  sklad     sklad             ""    2.2.2.100             MP                    4 7017-S7A

splstdata -b -l <node_number>

   17 sklad     02070123EE59    0 disk             hdisk0   bos.obj.ssp.432 Tue_Apr_13_11:31:59  default   default              PSSP-3.1.1              rootvg

madmurdock (MIS)13 Nov 06 9:35

So you installed last time this node on 13th april. Take a look on the cws into /spdata/sys1/install/images and find a proper image. This is the place normally the mksysb are...

hth

Advanced Interactive eXecutable

MMacun (TechnicalUser)13 Nov 06 9:37

I don't have this image no more but i have diferent one, wich a made last weak. And i put it under /spdata/sys1/install/images.I have 3 more nodes in rack 1. This one is in rack/slot 2

madmurdock (MIS)13 Nov 06 9:42

Okay, if you have a proper mksysb on your cws, then lets install it! Type:

spchvgobj -r rootvg -h <hdisk0> -i <your_mksysb_name> -c <number_of_copies_hopefully_1> -l 17

to give this new image information and then

spbootins -r install -l 17

to let "setup_server" run and watch for "return code = 0" of this command

then type

Page 216: AIX Commands1

nodecond 2 1

to start the install. Because its the first node on the second frame, it is 17

On another window(!) type

s1term 2 1

to see what is going on on the console and follow the ongoing.

Hth

mad

Advanced Interactive eXecutable

MMacun (TechnicalUser)13 Nov 06 9:48

One more thing, it i certain that node name is correct i wouldn't like to install imae on some other node :DIn what mode must machine be (power off)?

madmurdock (MIS)13 Nov 06 9:55

You can test the nodenumber of this node ( if it is running ) by typing on the node:

/usr/lpp/ssp/install/bin/node_number

to see if its the no. 17.

To test it further, you can switch off the power on this node by typing:

spmon -power off frame2/node1

If the right node is now powerless, you are ok. If the wrong node powerless, you have a few minutes downtime, but no new install on that machine ....

hth

mad

BTW: Which country are you in?

Advanced Interactive eXecutable

MMacun (TechnicalUser)13 Nov 06 10:00

The node is powered OFF, i am working in Maintenance mode.I know that the node name is 17 and that it is in slot2 only node, but i'am just not sure that install comand would not do some stupid thing :D :DOk i will try this and i will see.

Slovenia

Page 217: AIX Commands1

MMacun (TechnicalUser)13 Nov 06 10:08

"The node is powered OFF, i am working in Maintenance mode."I want to say that this is the only thing that i can do on the node is Maintenance mode.

MMacun (TechnicalUser)13 Nov 06 10:17

NOPE the command "spbootins -r install -l 17"Returns with a lot of errors.

This is just some of them.

0042-175 c_mk_lpp_source: An unexpected result was returned by the "/usr/sbin/installp" command: rc=0 awk: Cannot divide by zero. The input line number is 1. The source line number is 1.installp: The specified device /spdata/sys1/install/aix432/lppsource        is not a valid device or file.

rc=0awk: Cannot divide by zero.

 The input line number is 1. The source line number is 1.

awk: Cannot divide by zero.

 The input line number is 1. The source line number is 1.

mknimres: 0016-375 The creation of the lppsource resource named lppsource_aix432 failed with return code 1.setup_server: 0016-279 Failure of internally called command: /usr/lpp/ssp/bin/mknimres; rc= 2.setup_server: Processing incomplete (rc= 2).orion: rc.ntp: Starting ntp daemon(xntpd)[root-spcws] </spdata/sys1/install/images>

madmurdock (MIS)14 Nov 06 2:43

Seems to be that the last install is long time before :)

Ok, error come from your lpp_image, that you have to correct in the site environment information. Enter:

smitty enter_data

and go into the "site environment information". Important points here is the name of the "default Network Install Image", which must be in /spdata/sys/install/images, but can have a size of 0 bytes, because it is a dummy, second you have to fill in the "control workstation lpp source name", which you have to control it is valid under /spdata/sys1/install. Fill in the exact name the directory with the aix-sources have. This smitty must return 0. Then you can run setup_server again and paste the output here. May you have more errors than this.

hth

Page 218: AIX Commands1

mad

Advanced Interactive eXecutable

MMacun (TechnicalUser)14 Nov 06 11:29

0042-053 lsnim: there is no NIM object named "awk:"awk: Cannot divide by zero.Thi is the first error.

I tried every thing. I even install from smit nim and everything is ok until the machine want's client.info wich i haven't got. I tried to create one with mkinstall but the error is still the same

awk: Cannot divide by zero.Thi is the first error.

Now i'am creating boot image from mksysb with smit mkcd.

Dear Users ,i have a problem ,

i got 2 disks in dbvg mirrored (capacity of each of them 73gb)and here is my question

how to do logical parition for oracle in that dbvg and map them names of them /u00 - 7gb/u01 - 20 gb thank you very much for the answer please show me example if it is possible

best regards

Start your own Tek-Tips Group! Click Here!aau (MIS)14 Nov 06 9:29

Hi,

You have to create a logical volume for each partition and then create a filesystem on each logical volume and then, mount the filesystem 1 on /u00 and the filesystem 2 on /u01

man mklvman crfsman mount

You have to be root for this

Ali

Page 219: AIX Commands1

p5wizard (IS/IT--Management)14 Nov 06 9:49

Creating an LV yourself is optional, if you can live with the default name that the system chooses when it creates an LV for you automatically. (And in any case you can change the name of the LV that was created for you...)

smit may be helpful:

some smit fastpaths:smit storagesmit lvmsmit mklvsmit crfs

HTH,

p5wizard

I have a 9117-570 and need to order more memory for it.I have been told that I need to know if the currently installed memory is DDR1 or DDR2 because they cannot be mixed.  How can I find out wihout cracking the case?

Tek-Tips Forums is Member Supported. Click Here to donate. DukeSSD (TechnicalUser)13 Nov 06 17:20

check the vpd for the CCIN number of your dimms:lscfg -vp|grep -p DIMMnote the "Customer Card ID Number"then go here:http://publib.boulder.ibm.com/infocenter/eserver/v1r3s/index.jsp?topic=/iphau/partssystem.htmand search (Ctrl + f) for the 4 digit CCIN and it will tell you the type and size of your dimms.

p5wizard (IS/IT--Management)13 Nov 06 17:41

DDR2 is 3volt memory and is only available for high end (1.9Ghz or 2.2GHz processors) p5-570.

If yours is a 1.5 or 1.65GHz model it will be DDR1 (5volt) memory.

HTH,

p5wizard

DonDavisFCB (Programmer)13 Nov 06 21:54

Page 220: AIX Commands1

p5wizard,Your voltage differences appear to be in question.My 3rd party vendor at first knew nothing. Now he is quoting this:

PC133 – 3.3vDDR1 – 2.5vDDR2 – 1.8 v

Do you have a reference I can point him to?Thanks!

p5wizard (IS/IT--Management)14 Nov 06 3:10

Well, p5-570 processors come in "standard" (which use DDR1 memory DIMMs) or "low-voltage" - for 1.9 or 2.2GHz only -(which use DDR2 DIMMs).

I was googling after your question yesterday and came across the 5V and 3.3V values, but can't find that info right now.

HTH,

p5wizard

how to reject all APPLIED packages fast not one by one?thread52-1299267any idea?

Find A Job or Post a Job Opening Click Here.cspilman (MIS)8 Nov 06 7:42

I haven't tested this but this should work (recommend testing on a test system first):

CODElslpp -lc |awk -F: '{if($5=="APPLIED"){system("installp -r " $2)}}'Regards,Chuck

kHz (MIS)8 Nov 06 17:37

Its in the smitty install menu.

DukeSSD (TechnicalUser)8 Nov 06 20:20

Page 221: AIX Commands1

smitty maintain_software

joegombos (TechnicalUser)14 Nov 06 23:46

You can use the "all" keyword provided that it's specified within a file. I strongly recommend doing a dry run first in preview mode and check for any errors, depedencies, etc, eg:

echo all > /tmp/ainstallp -rpf /tmp/a

then if all is OK run

installp -rf /tmp/a

I don't know what AIX version you're running but I have found that when attempting to reject lots of filesets (such as complete maintenance levels) in later versions of AIX invariably result in lots of filesets being left in a broken state. Make sure you take a mksysb and any other backups first!!!

Hope this helps...

Joe

Hi,

Yesterday, my AIX 5.2 server has stopped because hdisk0 was crashed but it was mirrored with hdisk1. I've seen problems on it (hdisk0) before, but I didn't unmirror rootvg, I was thinking that if it crashed, the other one will permit to work.

Question : - How are the VGDA on hdisk0 and hdisk1 if they are mirrored for rootvg ? How can I see this ?

Tks

Find A Job or Post a Job Opening Click Here.p5wizard (IS/IT--Management)12 Oct 06 8:07

By default, a two-PV volume group has 3 VGDA's. One disk has just one, the other has 2 VGDA's

So a disk crash on a two-PV mirrored rootvg would lead to a system crash 1 out of 2 times. That is because the quorum rule states that at least half of the VGDAs needs to be online (half + one) in order to keep the VG active when a disk fails.

For that type of mirroring (two disk mirrored rootvg e.g.) , you can disable the quorum rule, i.e. set the quorum value to 1. The VG stays online until the last disk fails. (See smitty chvg).

But you need to varyoff/varyon after disabling quorum rule in order for it to become effective; So for rootvg, you need to shutdown/reboot.

Page 222: AIX Commands1

Hello,

I already opened a post for my problem some time ago here: http://www.tek-tips.com/viewthread.cfm?qid=1225997

Sadly I didn't find out yet, where the problems come from. When those high numbers in the kthreads row for the (r)un queue show up, the applications running on it get very slow for several seconds, until this bottleneck is gone and everything is running smooth for a minute again, then everything "lags" again. All CPUs are busy, handling the huge amount of triggered kthreads waiting in the run queue. When I try to type some commands in a shell on the machine, it even "lags" there so I sometimes write faster than it can show the letters on putty.

Some more info:AIX 5.2 ML 6CPUs: 4 x 1,45 GHz Power4RAM: 15,5 GB

Apps running on it are DB2 V8.2 FP9, TSM-Server 5.2.6.0, WebSphere App-Server 5.0.2 FP 17, Java 1.3.1, being part of an IBM Content Manager Archive v8.1 FP 10.The IBM Support for CM is no help at all so far.

Bad thing is, I can't find anything useful in the logs of any of the applications when the slowdown occurs. Usually it is that way, that when it start to happen, it will never get better and will go on in the same intervals, about bein 20 secs very slow, then for 30-60 secs everything is running smooth again and so on.If I restart all applications, everything is running smooth coninously again.It doesn't happen every day but sometimes even twice a day, sometimes after running 6 hours very good, sometimes it happens after 4 hours and right 2 hours later again. I can't find any other influence that might impact on this yet.

Its a cpu issue by the look of it.

Does the slow down follow any pattern? Every 5 mins.. Etc

What's the top process when the systems slow?

Mem look fine to me.

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."

RodKnowlton (MIS)20 Nov 06 15:05

During your slowdowns, the kernel context switch rate (cs) drops by an order of magnitude and the cpu time spent in system calls (sy) goes through the roof.

The first thing that comes to mind is that an application is creating a sort of "thread storm", spawning off bunches of threads (as seen in the kthr) for some reason. This would explain the sy percentage (system calls to spawn, manage, and reap threads) and the context switch drop (all of an applications run in the same context) as well.

During a slow down, try running "tprof -x sleep 60" and then check the __prof.all file.

Page 223: AIX Commands1

Your culprit should be at the top of the list.

- Rod

IBM Certified Advanced Technical Expert pSeries and AIX 5LCompTIA Linux+CompTIA Security+

Wish you could view posts with a fixed font? Got Firefox & Greasemonkey? Give yourself the option. 

RodKnowlton (MIS)20 Nov 06 15:19

BTW, zaxxon, did I ever compliment you on your handle?

Check the Zaxxon World Record from October 1983 out.

Note that the editor thought the postal abbreviation for Arkansas was AK, which is Alaska.

Also, since turning forty is supposed to be career limiting in IT, I should say I was five years old at the time.

- Rod

RodKnowlton (MIS)20 Nov 06 15:22

October, January...whatever.

- Rod

zaxxon (MIS)21 Nov 06 5:20

@RodCheers and congratulations for the hiscore, even I might be a bit of late hehe! I saw Zaxxon 1st time on an arcarde machine when I was 10, back in 1984^^If you get any problems in your career advancement because of your age, tell them to ask me, I will approve the hiscore and your age back then hehe ;)

But back to the problem:For the moment that it occurs, I would say too it is a CPU problem/shortage which is what having so many kthreads in the runqueue waiting for CPUs. But until the problem starts to occure, the apps run fine for several hours, not having any high lod on the CPUs.To make it more visible it looks like this for a typical problem day:

CODE06:00 Production starts, apps are running since 22:00 they day before only being issued by some small batch jobs

Page 224: AIX Commands1

08:00 Production starting to get in the range for heavy load10:20 1st time of having issues, that the system starts to be slow, having the effect showed by the vmstat output.10:30 Restart of all apps on the box10:35 Everything runs smooth again under heavy prduction load14:30 Same problems again, restarting apps

The machine is running totally fine unless the problems occure, no problem of any kind is visible.

@mrnThe slowdowns interval is like described or as seen, being ~20 secs awful slow, many kthreads in the run queue, then ~30-60 secs everything going smooth again, then ~20 secs slowdown, then 30-60 secs running smooth again and so on, until I restart all the apps. It will not get worth or better if I do not restart the apps.

@Rod & mrnI already had a topas running and saw our DB2 being the most busy when the problems occure. When no problems occure, it is the TSM-Server together with Java being the ones using most CPU time, but at no problematic load as described.I doubt it is the DB2 having the problem, since we have similar setup of apps and os/hardware running on another box, cooperating with this one and having not the problem. Only difference is, that we have no TSM-Server there but another DB2 instance running additional there, all parts of that CM archive. Btw. I forgot to say that we never restart the TSM-Server and it works fine after a restart of the other apps.I also did a pstat -A and checked which kthreads being in the run queue waiting, but of course this was no big help. As you said, I will have the tprof running next time and instructed my co-workers to have only small parts of the applications being restarted, one by one, to find out which part of that complex bunch of apps might cause the problem.

But all in all, I am glad all of you don't think it might be caused of a OS/OS-config problem, just to be at least sure on that part.

laterszaxxon

zaxxon (MIS)22 Nov 06 5:17

We were able to see that the problem must come from the WebSphere Application Server or it's Java application running.  In the tprof outfile were the db2agents listed on top. When stopping only part of the apps, we didn't stop the DB2 itself and after starting the WAS and http ontop of it, everything was fine again.We are going to patch the software soon and hope it will be fixed. At least we know now which part of the apps it is. Thanks all for the help :)

laters

mag007 (IS/IT--Management)21 Nov 06 11:24

I have 4 ethernet interfaces (en0, en1, en2, en3).

Page 225: AIX Commands1

I have a NFS mount, and I am not sure what interface the traffic is going thru, is there a way to find out?

TIA

Find A Job or Post a Job Opening Click Here. victorv (Vendor)

21 Nov 06 14:29

hi,NFS client or server ?If you say "NFS mount" probably you are at client side.

What I will say is good for NFS or any other services.

First of all, ensure that all 4 nic are wired: ifone ore more of them are not, you have less work to do.

Similar, check if all nic have an ip address.

Each nic has an ip address and the NFS server has its own.

Ping your NFS server and note the ip address. If this is in the subnet of one of the 4 nic,that is the nic.

If the subnet mask of the NFS server is out of thesubnet of your 4 nics, or you have defined static routes(see them) or more probable the traffic passes fordefault gateway and there is just a nic that routesto DG.

bye

bambock (Programmer)21 Nov 06 15:16

You can also do this on the NFS Server.  The command "rpcinfo -p" would give you information including the port number nfsd is running on.  My system reported 2049.

You can then use "netstat -an | grep 2049" and if the mount is active you should see an established connection from the client system and the IP interface it is using.

Ethan

mag007 (IS/IT--Management)21 Nov 06 15:20

Thanks! Star deserved

Page 226: AIX Commands1

Hi Guys,

         I want to take system backup of AIX 5.2 ML 08,In order to upgrade it to Aix 5.3 ML 04,we have NIM server which has enough space to take backup ..just wondering what's command using smitty to take mksysb on NIM.(i.e Cleint's Image backup on Master NIM).i have mounted nfs  which has about 30GB on client...#smitty mksysbwhat file name should i give inorder to have backup on NIM...?I have laready did nfs mount on /mnt.Please give detail step by step in order to make mksysb on NIM from clien'ts machine .

Thanks ! looking forward for your generous replies.

Start your own Tek-Tips Group! Click Here!Breslau (TechnicalUser)

8 Aug 06 9:17

You can name it whatever you want. I usually use the hostname along with the OS level and maintenance level. so, that would look like:

myhost.5.3-04

so, in your smit screen, give it /mnt/myhost.5.3-04 and let it run. you'll then need to add the mksysb file you created as a resource on your NIM master, but really there is no need to do that until you actually need to restore the image.

DSMARWAY (TechnicalUser)8 Aug 06 9:27

hion your NIM MASTER server type smit eznimselect the option backup a clientand select client to backup

khalidaaa (TechnicalUser)8 Aug 06 9:42

CODEOn the NIM Master Server

# smitty nim_mac -> Define a Machine (and write down the required details)

One the client server

# smitty nim -> configuration Network Installatin Management Client Filset (and write down the required details)

On the NIM Master Server

# nimclient –l        (To list resources as a TEST On NIM)

# smitty nim_res -> Define a Resource -> mksysbResource Name:         mksysb_MachineName

Page 227: AIX Commands1

Server of Resources:        masterLocation:        NIM client to backup:(and write down the required details)Regards,Khalid

trifo (MIS)8 Aug 06 9:51

Hi!

Well, the easyest way to do it is just creating the backup manually, executing

mksysb -i -m -e /mnt/mounted_remote_directory/hostname.5208.backup

and when it is finished, you can just define it in NIM as an mksysb object. The you can use it whenever you want to restore your machine. At least I am using mksysb this way, and I already succeeded to restore machines this way through NIM.

--Trifo

Aixexplore (MIS)8 Aug 06 10:34

Hi Trifo,

           I just followed your procedure ..i got following error..  Creating information file (/image.data) for rootvg.

Creating list of files to back up.find: 0652-019 The status on ./update is not valid.

Backing up 30837 filesbackup: 0511-089 Cannot open /mnt/'MOUNTED DIRECTORY"/hostname.mksysb: A file or directory in the path name does not exist.

0512-005 mksysb: Backup Completed.        The backup command completed with errors.        The messages displayed on Standard Error contained additional        information.

i have already mounted Directory in which i have created my backhostname directory. using .. mount:NIM_hostname /NFS directory /mnt

Please suggest .. I appreciate your comments .. on above error.

1

Regards

kHz (MIS)

Page 228: AIX Commands1

8 Aug 06 19:24

If you are using NIM to create the mksysb for the client (I recommend) then you shouldn't have to do any nfs mounts.  Use the nim menu options on smitty to create the mksysb.  

khalidaaa (TechnicalUser)9 Aug 06 0:26

I agree with kHz

Which procedure you followed to give you the posted output?

trifo (MIS)9 Aug 06 3:07

As I see, you didn't even succeed to create the backup image itself.

Well, I am using a custom script to create backups on approx 50 hosts this way. They are using high speed network and special filesystem which is not used by NIM (GPFS). Thus the filesystem I create backups to, must be mounted right before the backup. And you have to provide a full path filename as the name of the backup. Thus my backups are created quite fast and go to tapes with no hassle.

When I need to use one to restore a machine, I copy the backup image file to a JFS or a JFS2 filesystem which can be NFS exported by NIM. (GPFS can be NFS exported as well, but NIM does not know this). Then I define the mksysb backup object in the NIM database and can go forward with the restoration process. Note: all NFS export and mounts are now handled by NIM, there should not be any NFS export on the path where the image resides.

Try creating te backup again.

--Trifo

--Trifo

CrystalWizard (TechnicalUser)20 Nov 06 23:35

make sure your mount point for the nfs directory has correct permissions. To do that, unmount the filesystem and then check the permissions on the mount point.

Hi folks. Being a relative novice in the AIX lvm, I was wondering if there's any easy way to allocate an unused lv (trainlv) between two other logical volumes, live01lv and test01lv? If it helps, below is the output for the lvs in question from smitty:

CODEdatavg:LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT

Page 229: AIX Commands1

test02lv            jfs2       220   220   1    open/syncd    /dpp/test02live01lv            jfs2       224   224   1    open/syncd    /dpp/live01test01lv            jfs2       224   224   1    open/syncd    /dpp/test01oraclelv            jfs2       160   160   1    open/syncd    /tpp/oraclespoollv             jfs2       80    80    1    open/syncd    /spp/spoollive04lv            jfs2       80    80    1    open/syncd    /dpp/live04live03lv            jfs2       8     8     1    open/syncd    /dpp/live03firstlv             jfs2       28    28    2    open/syncd    /app/firsttest03lv            jfs2       8     8     1    open/syncd    /dpp/test03trainlv             jfs2       80    80    1    open/syncd    /dpp/train

TIA

Quote (Alan Bennett):I don't mind people who aren't what they seem. I just wish they'd make their mind up.

Start your own Tek-Tips Group! Click Here!aau (MIS)24 Nov 06 4:46

Hi,

lv trainlv has a filesystem on it (mounted on /dpp/train).While this filesystem exists, you can't do anything.If your aim is to deallocate space used by lv trainlv and reallocate this space to others, then you have to do :0 - unmount filesystem /dpp/train1 - remove the filesystem /dpp/train ( rmfs which deletes the lv train too )2 - reallocate some physical partitions as you like.

Ali

KenCunningham (TechnicalUser)24 Nov 06 5:15

Thanks Ali, /dpp/train is empty/unused so I'll follow your advice.

Quote (Alan Bennett):I don't mind people who aren't what they seem. I just

Hi

I'd like to delete files with a date < 2005 in a directory that contains 3 000 000 files.

How to do it without .... out of memory error !!!

Thanks in advanceDen

Tek-Tips Forums is Member Supported. Click Here to donate. mrn (MIS)29 Nov 06 11:22

Page 230: AIX Commands1

man find

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."

sbrews (TechnicalUser)29 Nov 06 13:06

you can do something like this:

find ./ -mtime +365 -type f -exec ls -la {} \;

This will list all files (-type f) that are 365 days old or older.  Adjust the mtime number as needed so that it starts picking up your old files at the appropriate/approximate date.

You might even want to send that output to a file and review it.  If it there are no gotchas, you can change the command to this:

find ./ -mtime +365 -type f -exec rm {} \;

This command will find and delete all files that have not been modified in 365+ days.

As with all "mass" rm commands, use caution.  And as already mentioned, "man find" will help you too.

scott

RodKnowlton (MIS)29 Nov 06 15:59

to do precisely files last modified before 2005:

CODE# make a file with mod time 01/01/2005 at the zeroeth minutetouch 0101000005 /tmp/markerfile

#this find is all one linefind /3mil_dir -type -f ! -newer /tmp/markerfile -exec mv {} /dir_with_room \;

# then look through /dir_with_room to make sure you didn't overgrab.# # or you could just make an ls pass to confirm, as scott suggested

- Rod

IBM Certified Advanced Technical Expert pSeries and AIX 5LCompTIA Linux+CompTIA Security+

Page 231: AIX Commands1

Wish you could view posts with a fixed font? Got Firefox & Greasemonkey? Give yourself the option. 

bambock (Programmer)29 Nov 06 16:03

You'll need that -t option to set the timestamp option with touch.

Ethan

RodKnowlton (MIS)29 Nov 06 16:11

The -t option is not needed in the example code.

The -t option takes a different format time string, but does let you specify down to the second, should you need to.

- Rod

bambock (Programmer)29 Nov 06 20:43

I see that now in the man page.  I must have mistyped the time stamp when testing your command since it had created a file with the name 0101*.

I stand corrected :), I missed a zero.

Ethan

yoda37 (TechnicalUser)30 Nov 06 3:05

Hi Rod

here my game test.

sr1212[root]/tmp/test>ls -lrt-rw-r--r--   1 root system   0 Apr 21 2006  a-rw-r--r--   1 root system   0 Jun 29 00:01 h-rw-r--r--   1 root system   0 Jun 30 00:01 i-rw-r--r--   1 root system   0 Jun 30 00:01 b-rw-r--r--   1 root system   0 Jul 01 00:01 markerfile-rw-r--r--   1 root system   0 Jul 01 00:01 c-rw-r--r--   1 root system   0 Jul 02 00:01 d-rw-r--r--   1 root system   0 Jul 03 00:01 e-rw-r--r--   1 root system   0 Aug 01 00:01 f-rw-r--r--   1 root system   0 Aug 15 00:01 g

find ./ -type -f ! -newer ./markerfile -exec ls -la{} \;=> result nothing !find ./ -type -f -newer ./markerfile -exec ls -la{} \;=> result nothing !

Page 232: AIX Commands1

Where is my mistake ?

ksas025 (TechnicalUser)4 Dec 06 10:31

I would like to automate my mksysb's and implement a tapeless/CDless backup scheme.  To do this I figured I would write a script to mksysb a file to an NFS share on a storage server.

This seems easy enough but I am unsure how I would restore these files if I needed to.  Can anyone help shed some light on this?  I have read in a couple of places that a NIM server is the answer but how do I serve mksysb files from a NIM master?  Are there any onther ways to restore a non-bootable mksysb backup over the network?

AIX ver=4.3.3

Thanks

Alex

Start your own Tek-Tips Group! Click Here!brumme (TechnicalUser)4 Dec 06 13:03

Hi.

The olly way I know is using NIM server. And you "just" create a ressource "mksysb" that point to your image.

But If you have a AIX 5.3 NIM server you have a lot more posabilities.

/HGA

jprabaker (TechnicalUser)5 Dec 06 11:01

The mksysb is just a backup image, so if you only want specific files you can use the restore command.

To restore the image onto a system you'll need to use NIM to enable the client to boot over the network.

mag007 (IS/IT--Management)8 Dec 06 7:49

Actually, you can do it without a NIM server.

Mount your NFS share (which has your mksysb image)

Do, smitty alt_clone

rondebbs (MIS)7 Dec 06 14:09

Page 233: AIX Commands1

Is it possible to set up a user that has all the priviliges of root? I noticed that there are groups such as adm, sys, system. Even if a user is in these groups he does not seem to have all priviliges.

What if the root password is lost on an aix box. Can another admin user login and reset the root password?

Thanks - Brad

Tek-Tips Forums is Member Supported. Click Here to donate. sbrews (TechnicalUser)7 Dec 06 14:54

depending on what you want as a final solution, take a look at sudo:  http://www.gratisoft.us/sudo/

With sudo you can set up users to be able to start a shell as root, give elevated access to some commands while not turning them loose with everything, etc.

scott

rondebbs (MIS)7 Dec 06 16:16

I was hoping there was some way within native AIX to grant root priviliges. For example - in Windows if a user is a member of  the administrators group he can do everything, with no restrictions.

unclebrian (Vendor)7 Dec 06 18:06

I have done this in the past by setting up a user and then going in and editing the /etc/passwd file go change the UID and GID to zero.

rondebbs (MIS)7 Dec 06 18:53

WOW the 0:0 in /etc/passwd seems to work well as I can do everything that I tried. Interesting - when I type whoami it shows me as root rather than my real id (who am i shows my real id).

I'm guessing that my id would continue to work as root even if the root password is lost/forgotten? I know that it is unlikely to lose the root password but I heard this occured at one site.   I'm not sure how they recovered.

hfaix (MIS)7 Dec 06 19:41

I don't know the size of your company, but changing my(or any) id to 0 in /etc/passwd would not fly with my auditors.  

It's really not "that" hard to recover from a lost root password. I had to do it on a really old machine about 3 months ago.  I think I booted from media, went into recovery mode (mounting rootvg), and reset it there.  

Page 234: AIX Commands1

If you really wanted to, you could probably even setup sudo to allow you to sudo change the root password if it was lost.....

aau (MIS)8 Dec 06 5:47

Hi,

Cloning root id in /etc/passwd is not the good way to give a user root privileges.sudo as suggested by sbrews is the best way to make things clean.You have a little to do for configuring sudoers and you know what user is able to run what command as root because sudo actions and intrusions are sent to a system log.

Ali

Replies: 6 - Pages: 1 - Last Post: Aug 9, 2006 12:35 AM by: Jes

Mike, UK

Posts: 209 From: Glasgow, UKRegistered: 1/10/05

ORA-29278: SMTP transient error: 421 Service not available Posted: Feb 2, 2005 3:11 AM   Reply

Hi All,I have a bunch of e-mails sitting in the HTMLDB E-mail queue that aren't being sent. I had this working OK on the hosted site, but not in my own environment. When I run the following command from SQL Plus: exec htmldb_mail.push_queue('localhost', '25') I get the following error message: "ORA-29278: SMTP transient error: 421 Service not available"

Does this mean that my local Oracle Server needs to be identified to the SMTP server?

Thanks,

Mike

Page 235: AIX Commands1

jkallman

Posts: 1,161 From: Columbus, Ohio USARegistered: 1/10/01

Re: ORA-29278: SMTP transient error: 421 Service not available Posted: Feb 2, 2005 5:06 AM   in response to: Mike, UK   Reply

Mike,

No, this does not mean that "your local Oracle Server needs to be identified to the SMTP server."

This error message tells me that localhost, the same server where you have your Oracle database running, does not have an SMTP server up and running.

Joel

roymathew432@ya...

Posts: 48 Registered: 9/2/04

Re: ORA-29278: SMTP transient error: 421 Service not available Posted: Feb 16, 2006 3:40 AM   in response to: jkallman   Reply

how to check whether the smtp service is up and running in the local system where the database is present. i am trying to send mail from the system where the database is present.

jkallman

Page 236: AIX Commands1

Posts: 1,161 From: Columbus, Ohio USARegistered: 1/10/01

Re: ORA-29278: SMTP transient error: 421 Service not available Posted: Feb 16, 2006 6:42 AM   in response to: roymathew432@ya...   Reply

There are no capabilities directly in HTML DB to ascertain if the SMTP service is available. Additionally, there are no facilities to determine if the SMTP server in the Environment Settings is properly configured as an SMTP server or valid relay host.

If using a Unix/Linux server, I typically telnet to the machine and issue the mail command as a test, as in:

mail -v -s "FooBar" [email protected]

[email protected]

With the verbose flag specified, I get feedback on the conversation with the SMTP server.

Joel

user517800

Posts: 2 Registered: 6/29/06

Re: ORA-29278: SMTP transient error: 421 Service not available Posted: Jun 29, 2006 6:32 AM   in response to: roymathew432@ya...   Reply

Go to Control Panel->Add or Remove Programs->Click onAdd/Remove Wndows ComponentsCheck IIS check box.Select Internet Information Service (IIS) option and click on Details buttonCheck whether SMTP Service is checked or not.If not selected then select SMTP check box.

Page 237: AIX Commands1

This process should be done on server.It will help out from ORA-29278: SMTP transient error: 421 Service not available problem.

[email protected]

vohra.yasir

Posts: 64 Registered: 9/22/05

Re: ORA-29278: SMTP transient error: 421 Service not available Posted: Aug 9, 2006 12:29 AM   in response to: user517800   Reply

Guys - I dont get any error like these but when ever i am sending mail - i receive an empty mail with out having any messageplease help -

Jes

Posts: 2,363 From: UKRegistered: 6/19/04

Re: ORA-29278: SMTP transient error: 421 Service not available Posted: Aug 9, 2006 12:35 AM   in response to: vohra.yasir   Reply

Vohra,

Your problem isn't directly related to the original posters thread, so you should have really started a new thread for your problem (since it could be missed by people who would be able to solve your issue for you).

Page 238: AIX Commands1

It would also help if you posted the code that you are using to send the email, so we can look to see where the error is.

Thanks.

100UTL_SMTPUTL_SMTP is designed for sending e-mail over Simple Mail Transfer Protocol (SMTP). It does not have the functionality to implement an SMTP server for mail clients to send e-mail using SMTP.Many interfaces to the SMTP package appear as both a function and a procedure. The functional form returns the reply from the server for processing by the client. The procedural form discards the reply but raises an exception if the reply indicates a transient (400-range reply code) or permanent error (500-range reply code).Note that the original SMTP protocol communicates using 7-bit ASCII. Using UTL_SMTP, all text data (in other words, those in VARCHAR2) will be converted to US7ASCII before it is sent over the wire to the server. Some implementations of SMTP servers that support SMTP extension 8BITMIME [RFC1652] support full 8-bit communication between client and server.The body of the DATA command may be transferred in full 8 bits, but the rest of the SMTP command and response should be in 7 bits. When the target SMTP server supports 8BITMIME extension, users of multibyte databases may convert their non-US7ASCII, multibyte VARCHAR2 data to RAW and use the write_raw_data() API to send multibyte data using 8-bit MIME encoding.UTL_SMTP provides for SMTP communication as specified in RFC821, but does not provide an API to format the content of the message according to RFC 822 (for example, setting the subject of an electronic mail).You must format the message appropriately.This chapter discusses the following topics:

Exceptions, Limitations, and Reply Codes

Summary of UTL_SMTP Subprograms

Example

Note :

RFC documents are "Request for Comments" documents that describe proposed standards for public review on the Internet. For the actual RFC documents, please refer to:

http://www.ietf.org/rfc/

Page 239: AIX Commands1

Exceptions, Limitations, and Reply CodesExceptionsTable   100-1 lists the exceptions that can be raised by the API of the UTL_SMTP package. The network error is transferred to a reply code of 421- service not available.Table 100-1 UTL_SMTP Exceptions Exception Description

INVALID_OPERATION Raised when an invalid operation is made. In other words, calling API other than write_data(), write_raw_data() or close_data() after open_data() is called, or calling write_data(), write_raw_data() or close_data() without first calling open_data().

TRANSIENT_ERROR Raised when receiving a reply code in 400 range.

PERMANENT_ERROR Raised when receiving a reply code in 500 range.

LimitationsNo limitation or range-checking is imposed by the API. However, you should be aware of the following size limitations on various elements of SMTP. Sending data that exceed these limits may result in errors returned by the server.

Table 100-2 SMTP Size LimitationElement Size Limitation

user The maximum total length of a user name is 64 characters.

domain The maximum total length of a domain name or number is 64 characters.

path The maximum total length of a reverse-path or forward-path is 256 characters (including the punctuation and element separators).

command line

The maximum total length of a command line including the command word and the <CRLF> is 512 characters.

reply line The maximum total length of a reply line including the reply code and the <CRLF> is 512 characters.

text line The maximum total length of a text line including the <CRLF> is 1000 characters (but not counting the leading dot duplicated for transparency).

recipients buffer

The maximum total number of recipients that must be buffered is 100 recipients.

Reply CodesThe following is a list of the SMTP reply codes.

Page 240: AIX Commands1

Table 100-3 SMTP Reply CodesReply Code

Meaning

211 System status, or system help reply

214 Help message [Information on how to use the receiver or the meaning of a particular non-standard command; this reply is useful only to the human user]

220 <domain> Service ready

221 <domain> Service closing transmission channel

250 Requested mail action okay, completed

251 User not local; will forward to <forward-path>

252 OK, pending messages for node <node> started. Cannot VRFY user (e.g., info is not local), but will take message for this user and attempt delivery.

253 OK, <messages> pending messages for node <node> started

354 Start mail input; end with <CRLF>.<CRLF>

355 Octet-offset is the transaction offset

421 <domain> Service not available, closing transmission channel (This may be a reply to any command if the service knows it must shut down.)

450 Requested mail action not taken: mailbox unavailable [for example, mailbox busy]

451 Requested action aborted: local error in processing

452 Requested action not taken: insufficient system storage

453 You have no mail.

454 TLS not available due to temporary reason. Encryption required for requested authentication mechanism.

458 Unable to queue messages for node <node>

459 Node <node> not allowed: reason

500 Syntax error, command unrecognized (This may include errors such as command line too long.)

501 Syntax error in parameters or arguments

502 Command not implemented

Page 241: AIX Commands1

Reply Code

Meaning

503 Bad sequence of commands

504 Command parameter not implemented

521 <Machine> does not accept mail.

530 Must issue a STARTTLS command first. Encryption required for requested authentication mechanism.

534 Authentication mechanism is too weak.

538 Encryption required for requested authentication mechanism.

550 Requested action not taken: mailbox unavailable [for , mailbox not found, no access]

551 User not local; please try <forward-path>

552 Requested mail action aborted: exceeded storage allocation

553 Requested action not taken: mailbox name not allowed [for example, mailbox syntax incorrect]

554 Transaction failed

Section 1 - Planning and Design

Page 242: AIX Commands1

Evaluate the potential HACMP nodes' ability to service applications (e.g., CPU, memory, I/O bandwidth, in a failed over condition)

Evaluate potential HACMP nodes for additional devices (e.g., tape, X.25, SNA, Async device)

Evaluate potential HACMP nodes for host names, uname, node names and service labels

Evaluate application compatibility with planned OS and HACMP versions

Evaluate network components such as the type of IP network, and the use of virtual IP addresses

Evaluate user connectivity to the node

Evaluate network components for single point of failure at the physical and logical layers

Evaluate requirements of a non-IP network

Evaluate the use of IPAT

Evaluate network security

Plan LVM (Logical Volume Manager) requirements (e.g., disk connections, FAStT limitations, volume groups, raw logical volumes, files system mount points, recovery type, sequential/parallel, root volume group mirrored)

Evaluate environmental points of failure (e.g., power, air conditioning, building)

Evaluate application scripts (e.g., application start scripts, application stop scripts, application monitor, application restart scripts, application cleanup scripts)

Evaluate resource requirements and behavior (e.g., DNP, sites, NFS, GMD, PPRC, GPFS, cron, time, communication links)

Assess HACMP suitability and implementation options (e.g., HACMP/XD: HAGEO, HACMP/XD: PPRC)

Section 2 - Installation/Configuration Configure TCP/IP networks

Configure and test Non-IP networks

Create shared LVM configuration (e.g., manual and automatic configuration)

Determine which updates are necessary for an HACMP installation (e.g., firmware, adapter microcode, operating system)

Verify HACMP pre-reqrequisites (e.g., bos.adt, bos.data, RSCT)

Based on HACMP requirements, determine which components of HACMP to install and/or update

Define the cluster

Select communication devices (e.g., RS232, TMSSA, TMSCSI, Disk HB)

Configure cluster resources

Convert volume groups to enhanced concurrent access

Section 3 - Testing and Verification Evaluate successful cluster start

Page 243: AIX Commands1

Perform cluster shutdowns (e.g., graceful, takeover, forced, induced)

Verify successful node reintegration including forced stops

Verify the cluster behavior after IP failure (e.g., switch, cable, adapter, multiple adapter, etc.)

Verify the cluster behavior after non-IP failure (e.g., disk HB)

Emulate errlog entries

Determine whether application monitors function as designed

Validate rootvg mirror

Verify site failure

Determine cluster status (e.g., clstat, snmpinfo)

Verify that the client applications work

Verify nfs functionality

Section 4 - Post Implementation/Administration Define custom cluster events

Configure pre and post events

Configure error notification

Implement application monitoring

Create and manage cluster snapshots

Employ C-SPOC for filesystem maintenance

Manage Clustered users and groups using C-SPOC

Determine which HA logs and/or system error logs should be used for problem determination

Manage resource groups

Start and stop clusters

Perform periodic cluster verification

Perform routine cluster monitoring

Plan and implement software updates (AIX, HACMP)

Plan and implement hardware replacement and changes

Determine and recover from an unsuccessful cluster event

Recover from a failed DARE operation

Page 244: AIX Commands1

1A planning session is setup to evaluate a customer's systems for the potential of a two-node cluster. During the evaluation, a nonstandard disk subsystem is discovered. The disk devices have a unique type in the ODM database. They require that specific commands be executed in order to make the disks available on system startup. Other commands are also available to identify IO rates, manage reservation locks and lock resets, manage disk capacity, and read the configuration from the disk. What limitations does HACMP impose on disk subsystem usage?

o Only disks that can be identified as IBM or other authorized vendors can be used with HACMP.

o For a disk to function under the control of HACMP, all disks must subscribe to the SCSI protocol regardless of physical connection type.

o Unusual disk types are allowed as long as they can be identified in the CuDv with the PdDvLn field and have the necessary support programs.

o There are no restrictions on the disk type that can be used with HACMP, as long as the device works correctly in a single system instance it will work with HACMP.

A customer is configuring the network components for an HACMP cluster. The plan is to use a four-port Ethernet adapter with IPAT via IP aliasing for the three service IP labels. Which of the following would be a concern with the proposed configuration?

o The four-port adapter is not supported.

o A single physical adapter is not supported.

o The four-port adapter is a single point of failure.

o There should be a "spare" port for each service IP label.

Which statement is true regarding hearbeats over IP aliases?

o The Heartbeat IP aliases must be defined in the /etc/host file.

o The service and non-service IP labels have no subnet restrictions.

o The service and non-service IP labels must be on separate subnets.

o The Heartbeat IP alias address can also be used to carry other traffic.

During a planning session, the customer expresses a concern about the security of the networks managed by HACMP. Specifically, the customer is concerned about the methods used by HACMP for synchronization of configuration information. How do HACMP nodes exchange configuration information?

o On a public port with security records in /.rhosts

o On a private port with security records in /.rhosts

o On a public port with security records in /usr/es/sbin/cluster/etc/rhosts

o On a private port with security records in /usr/es/sbin/cluster/etc/rhosts

The customer has a high volume application. GPFS was implemented across three nodes to provide the application with the required performance level. If a node fails, the customer wants

Page 245: AIX Commands1

the remaining nodes to assume the identify of the failed node. Which type of resource group can be used in this environment?

o Rotating resource groups

o Parallel resource groups

o Cascading resource groups

o Concurrent resource groups

A customer has an application that is 90% reads and 10% writes on a 35 Terabyte database. During a conversation with the customer, it was discovered that HACMP/XD:HAGeo was being considered but size of the database would make it too expensive. What facility of HACMP/XD:HAGeo needs to be clarified with the customer?

o HACMP/XD:HAGeo only mirrors the writes across the geography after the initial synchronization.

o HACMP/XD:HAGeo uses the all systems in the geography for reads the initial synchronization to increase performance.

o HACMP/XD:HAGeo mirrors the read and writes across the geography after the initial synchronization for better performance.

o HACMP/XD:HAGeo only mirrors the reads across the geography after the initial synchronization if the local system is slow.

A customer wants to install HACMP but has limited resources. The only system available to make a backup node is constrained by IO slots. There will only be space for one Ethernet adapter in the backup node. Why this configuration is problematic?

o A single adapter node will not work.

o A single adapter node will work if IPAT via IP aliasing is used.

o A single adapter node will work if IPAT via IP replacement is used.

o A single adapter node will work but will be a single point of failure.

A customer is moving two of four nodes in a cluster to a new computer room three floors down in the current building. The separation was prompted by a lack of physical space in the original computer room. The intention is to add separate power and air conditioning to the second computer room, making the cluster more highly available. Connection to the shared disk subsystems was not affected by the move, and the length of cables is within the disk subsystem specification. The RS232 heartbeat cable has exceeded the length, and RS232 line drivers have been used to extend the distance. Under what condition will the RS232 line drivers function properly with HACMP in this situation?

o With no configuration adjustments

o If the speed of the network is set in the Network Module

o If the speed of the line driver device is set to 8,1,none and a speed of 9600

o If the speed of the line driver device is set to 8,1,none and a speed of 38400

A customer has installed a cluster with all of the LPP's on the installation media that would install without error. The normal startup of the cluster includes all of the processes except the "Lock

Page 246: AIX Commands1

Manager". If the customer wishes to monitor the cluster from a "Windows" based system, what additional step needs to be performed?

o The clstat application needs to be compiled in a "Windows" environment.

o The clinfo application needs to be compiled in a "Windows" environment.

o A native "Windows" SNMP client agent needs to be configured on the "Windows" client.

o A Web server with the appropriate cgi application needs to be configured on a cluster node.

An administrator has a requirement to monitor the cluster status from a remote AIX client. It has been decided the cgi version of clstat will be available on the Web server cluster node. In order to monitor the cluster from the client, what cluster software needs to be installed?

o clstat.jar

o cluster.es.client

o cluster.adt.client

o none, just the Web browser

A customer is implementing a new two-node cluster and wants the most highly available solution including Fast Disk Takeover. The cluster has the following:

o storage connected by a fibre switch

o asynchronous adapter with unused ports

o unused 10/100 Ethernet

o a pair of 1000 Ethernet adapters on each node

Best practice for the most robust heartbeat configuration would be to use the:}

o async ports and disk heartbeating.

o spare Ethernet connection and disk heartbeating.

o spare Ethernet connection and async ports for heartbeating.

o spare Ethernet connection and the 1000 Ethernet connection for heartbeating.

A customer has had a cluster for a long time and has upgraded it many times over the years. The cluster currently has 10 resource groups, each with several Volume Groups. The upgrading process has defaulted the resource groups to process sequentially. To speed up the completion time for acquiring resource groups, an investigation has started. The customer does not wish to use enhanced concurrent mode for the Volume Groups. What additional feature of HACMP may impact the resource acquisition time?

o Nothing can be done to speed up the resource acquisition because the time is limited to the disk type.

o The processing time can be reduced by changing the resource groups to use the fast disk takeover feature.

o By changing the resource group processing order to not use an ordered list, the processing time should be reduced.

Page 247: AIX Commands1

o Decreasing the time in the network modules will facilitate faster detection of network failures and speed up the over all process.

Which of the following is true about cluster startup?

o Cluster nodes are started in parallel.

o Cluster nodes are started sequentially.

o Cluster nodes started in parallel cannot use auto-restart.

o Cluster nodes using settling timers cannot start sequentially.

The customer stopped a node in a cluster with the "shutdown -F" command. What will happen to the resource groups on the node that stopped?

o The resource groups will start on the next available node after the settling timer has expired.

o The resource groups will go off line unless the inactive takeover flag is set in the resource group.

o The resource groups will be brought on line on the next available node as configured in the resource group.

o The resource groups will go off line unless the inactive takeover flag is set in the HACMP run-time parameters.

A node on a running cluster recently re-integrated into the cluster. An administrator can determine if the resource groups have returned to their expected locations by using which command?

o cldare

o clRGinfo

o cllistres

o clshowres

An administrator is working on the network interfaces of a cluster node that uses IPAT via IP aliasing. The administrator changes one of the interfaces in use by HACMP from "up" to "down" with the ifconfig command. After noticing the interface is down, what will HACMP do?

o Move any IP service label to another available interface.

o Move any resource group using that interface to another node.

o Issue a command to change the interface to an "up" condition, and, if successful, will not move any IP service labels.

o Move any IP service label to another available interface on the same node, and then issue a command to change the interface to an "up" state.

A customer is testing a cluster before putting it into production. The customer wants to test the resource group fallover based on a volume group loss of quorum. The recommended method for testing resource group fallover for loss of quorum is to:

o force vary off the volume groups.

o emulate error notification function in HACMP.

Page 248: AIX Commands1

o disconnect the cables leading to the disk subsystem.

o remove disk drives from the system until loss of quorum is reached.

To which logfile will the output of the custom application monitor be logged?

o None

o /tmp/hacmp.out

o /var/hacmp/app_mon.log

o /usr/es/adm/cluster.log

Which of the following commands should be used to verify that the rootvg is successfully mirrored?

o lsvg -l rootvg

o lspv -M rootvg

o lsmirror -l rootvg}

o lqueryvg -Mr rootvg

What utility is used to determine the status of the remote site in a HACMP/XD:HAGeo cluster?

o clstat

o clsite

o clRGinfo

o clsiteinfo

To provide additional cluster monitoring, a Tivoli Netview solution has been proposed. The administrator has been tasked with the configuration issues. One issue is the cluster must be modified to send traps to the Tivoli Management Console. On the cluster nodes, what file must be modified to use traps?

o /etc/snmpd.conf

o /etc/inetd.conf

o /usr/es/sbin/cluster/etc/clhosts

o /usr/es/sbin/cluster/etc/cltopinfo

An administrator wants to see the current state of a cluster and resource groups, 'rg1' and 'rg2'. Which of the following commands, executed at the command-line, will display the current state of the cluster and resource groups?

o cldump

o clfindres -v

o cllistclstate -g

o clgetrg -r rg1 and clgetrg -r rg2

Page 249: AIX Commands1

In an attempt to improve a cluster client's application availability, the client node is being made cluster aware by installing the HACMP client software on an AIX client. To enable a client node to detect cluster state changes in a running cluster, which file must be configured?

o /etc/hosts

o /etc/snmpd.conf

o /usr/es/sbin/cluster/etc/rhosts

o /usr/es/sbin/cluster/etc/clhosts

A customer is heavily dependant on HACMP providing highly available NFS services. What command can be used to verify the NFS exports are correct?

o lsnfs

o showmount -e

o cat /etc/exports

o cat /usr/es/sbin/cluster/etc/exports

A two-node cluster has been installed with five resource groups. Only one resource group has a service IP label. If a network error occurs the resource group with the service IP label migrates to the backup node. The administrator would like to move all the resource groups when an event like this occurs. What is the best way to accomplish this?

o Modify the crontab and inittab.

o Configure pre or post event scripts.

o Add event for hardware failure using smit.

o Set the /usr/es/sbin/cluster/diag/cf_failover script.

Which of the following statements regarding Application Monitoring is specific to a custom resource monitor?

o It can monitor more subtle aspects of application performance.

o It may not be an appropriate option for all types of applications.

o It can detect the death of one or more processes of an application using RSCT

o It is easier to set up since it uses custom plugins for monitoring capability and requires no scripts.

To handle an application's growing demand for storage, a new volume group is being planned in an existing cluster environment. System outages are limited to one weekend every other month. How can HACMP be used to manage the downtime limitations?

o Create the VG using the C-SPOC option Create a Shared Volume Group.

o Create the VG using the C-SPOC option Import a Shared Volume Group.

o Create the VG outside of HACMP and add it into HACMP during next outage.

Page 250: AIX Commands1

o Create the VG outside of HACMP let the HACMP Lazy Update feature find it.

A cluster node has been started and has not acquired the resources in the resource groups. Which log file will show the details of any event script processing that has occurred?

o /tmp/hacmp.out

o /tmp/clstrmgr.debug

o /usr/es/adm/cluster.log

o /var/adm/hacmp/hacmp.out

Which command can be used at the command line to move a resource group?

o cldare

o rgmove

o rg_move

o clRGmove

A stable cluster has not had an opportunity to fallover in several months. What would be a non-disruptive method of checking that the cluster is ready to function as expected?

o Fail a node.

o Run the clstat utility.

o Run the clverify utility.

o Perform cluster synchronization.

A customer with a multi-site HACMP cluster was changing resource groups to add another IP service label to a resource group. An error occurred during synchronization. Since the last node was added at the remote site, the cluster had previously synchronized correctly and had been running successfully for several months. What is the most likely cause of the synchronization error?

o When using the site parameter, DARE is not allowed.

o The service IP labels were not properly defined to HACMP

o Changing the resource groups with the cluster running is not allowed.

o The resource group can only have one service IP label for each resource group.

Answer Key:

C

C

B

D

C

A

Page 251: AIX Commands1

D

B

D

D

A

C

B

B

B

A

B

A

A

A

A

A

D

B

B

A

A

A

D

C

A

Monitoring Script

#---------------------------------------------------------------------------# FileName : /home/ibm/perfstats/perfs# Info : Collect performance stats - sar, vmstat, iostat and ps# Srin, 15/03/02#---------------------------------------------------------------------------DAY=`date +%Y%m%d`TIM=`date +%H%M`

Page 252: AIX Commands1

if [ ! -d /tmp/ibmperf/$DAY ] then mkdir /tmp/ibmperf/$DAY else echo ""fiOUT=/tmp/ibmperf/$DAY/$TIMecho "------------------------------------------------------------" >> $OUTecho "Starting Performance collector" >> $OUTecho `date` >> $OUTecho "Writing to $OUT" >> $OUTecho "Disk stats " >> $OUTdf -k >> $OUTecho "-------------------------------------------------------------" >> $OUTecho "System activity report " >> $OUTsar -P ALL 2 10 >> $OUTecho "-------------------------------------------------------------" >> $OUTecho "Virtual Memory Statistics " >> $OUTvmstat 900 4 >> $OUTecho "-------------------------------------------------------------" >> $OUTecho "Input Output Disk statistics " >> $OUTiostat -d 5 2 >> $OUTecho "--------------------------------------------------------------" >> $OUTecho "Process CPU Utilization " >> $OUTps aux | head -n 20 >> $OUTecho "--------------------------------------------------------------" >> $OUTecho "error report" >> $OUTerrpt >> $OUTecho "--------------------------------------------------------------" >> $OUTecho "Finished collecting peformance statistics " >> $OUTecho "--------------------------------------------------------------" >> $OUTcd /psoft/fscmsp2du -sk * >> $OUT

"perfs.sh" 43 lines, 1597 characters

Daylight Saving Time changes in 2007Abstract: You may be aware of the upcoming changes in U.S. Daylight Saving Time (DST) beginning in 2007

Here is the IBM web site on the topic.

http://www.ibm.com/support/alerts/daylightsavingstimealert.html

Correction: Daylight Saving Time changes in 2007

You may be aware of the upcoming changes in U.S. Daylight Saving Time (DST) beginning in 2007, which will affect computers and applications with date and time processing functions. While this is an industry-wide issue rather than IBM-specific, many IBM products will be affected and IBM is providing DST rule changes and recommended approaches for a smooth transition to the new schedule. We want to bring this to your attention so you can inform your customers who may be affected. IBM product support related to these changes will continue to be available through your normal channels. The following IBM Web site will provide you and your customers with more information: http://www.ibm.com/support/alerts/daylightsavingstimealert.html

Page 253: AIX Commands1

Changes and impact

In 2007, U.S. Daylight Saving Time (DST) will begin on the second Sunday in March and end on the first Sunday in November.  This change in the schedule -- the first in 20 years -- will make U.S. Daylight Saving Time four weeks longer. The U.S. Energy Act of 2005 made this change to reduce energy consumption. This will impact many existing technology products and solutions. While the business risk associated with having systems reflect the wrong time by one hour for four weeks in 2007 is not as great as Y2K, the extent of the IT impact is not trivial and may impact users in the United States as well as in non-U.S. geographies.

The DST change will affect computers and applications with date and time processing functions in the United States, as well as Canada and Bermuda where their start/end DST dates conform to the U.S. change. Those who use calendar or scheduling functions may be impacted if they are dependant on date and time stamps or if they process or manipulate dates or times. Users in countries not implementing the DST changes could be impacted if they support users, transactions or applications originating in the countries that are changing DST. For example, applications or systems that interact with the U.S. involving calendar notices should be updated.

Actions

It is important for users to assess their environments and develop appropriate plans for applying the necessary changes. As this pertains to technology products, the DST rules changes for IBM products, recommended actions and additional information are posted on IBM's Web site: http://www.ibm.com/support/alerts/daylightsavingstimealert.html. To have a better understanding of the DST impact, customers can visit this site, check their IBM products and make the necessary changes to be ready for the new 2007 DST schedule.

Company Name Here[Click here and type return address]

[Date]

[Click here and type recipient’s address]

Dear _______:

In 2007, U.S. Daylight Saving Time (DST) will begin on the second Sunday in March and end on the first Sunday in November. This change in the schedule will make U.S. Daylight Saving Time four weeks longer, which will have implications for certain technology products.

The DST change will affect computers and applications with date and time processing functions in the U.S., as well as Canada and Bermuda where their start/end DST dates conform to the U.S. change. You may be impacted if you use calendar or scheduling functions or if you are dependant on date and time stamps or process or manipulate dates or times. Customers in countries not implementing the DST changes could be impacted if they support users, transactions or applications originating in the countries that are changing DST. For example, applications or systems that interact with the U.S. involving calendar notices should be updated.

While this is an industry-wide issue, rather than specific to a particular company or technology, many IBM products will be affected by this change and IBM is providing the necessary DST rule changes for their products, as well as recommended approaches for a smooth transition. Information about the IBM products impacted and schedules for the product changes are available on the IBM Web site: http://www.ibm.com/support/alerts/daylightsavingstimealert.html. It is important to

Page 254: AIX Commands1

make the necessary changes prior to the start of the new 2007 DST schedule.

Sincerely,

Here is info on an Aix 5.3 Fix:

IY75211: DAYLIGHT SAVING TIME DEFAULT CHANGING IN 2007 A fix is available

Obtain fix for this APAR

APAR statusClosed as program error.

Error description The United States official Daylight Saving Time begin and end dates have changed as of the year 2007. The new start date is the second Sunday of March; the new end date is the first Sunday of November.Local fix Problem summary DayLight savings change for year 2007 and beyondProblem conclusion DST changes handled for year 2007 and beyondWhile a reboot is not require after applying this update, any application which uses the date/time functions in libc.a will need to be restarted to pick up the changes. The user may choose to reboot the system rather than try to identify all applications which might need to be restarted. The cron daemon is one example of an application that uses date/time functions from libc.a and would require a restart.Temporary fix Comments APAR information

APAR numberIY75211

Reported component nameAIX 5.3

Reported component ID5765G0300

Reported release530

StatusCLOSED PER

PENoPE

HIPERNoHIPER

Submitted date2005-08-11

Closed date2005-09-28

Last modified date2006-11-10

APAR is sysrouted FROM one or more of the following:

Page 255: AIX Commands1

APAR is sysrouted TO one or more of the following:IY75213 IY75214 IY91593

Publications Referenced

Fix information

Fixed component nameAIX 5.3

Fixed component ID5765G0300

Changes to Daylight Saving Time will affect HMC

Changes to Daylight Saving Time will affect HMC

URGENT Actions Required:

Changes to Daylight Saving Time will affect HMC.

Abstract

The Energy Policy Act of 2005, which changes the effective dates of US Daylight Saving Time (DST) in 2007 for the United States. The user may need to take action to apply HMC change to have correct DST time of 2007

Content

Starting in the spring of 2007, the U.S. Daylight Saving Time (DST) will be extended by four weeks, starting three weeks earlier on the second Sunday in March and ending one week later on the first Sunday in November. As a result of this change, APARs, maintenance, or actions will be required for all java applications, operating systems, and machine control programs (HMC code).

Information about the Energy Policy Act can be found on the US Department of Energy Web site.

The Energy Policy Act changes the effective dates of DST. Beginning in 2007, DST start and end dates will be as follows:

Start date: Second Sunday of MarchEnd date: First Sunday of NovemberWho may need to take action on the new DST:Daylight Saving Time rules affect all date and time processing functions in a computer.

Any US time zone based application which uses time will be affected. If these time zone rules are not correct, then time could be incorrect by 1 hour for four weeks each year. When time is incorrect, the date will also be incorrect under certain circumstances.

The following table describes the PTF required to apply on your HMC, in order for the time to change correctly on the HMC, according to the new DST rules. Reference the HMC Support web site for more information on the HMC Version and associated PTFs at:

Page 256: AIX Commands1

http://www14.software.ibm.com/webapp/set2/sas/f/hmc/home.html

HMC VersionPackage(s) that must be installed

HMC 6.1There is no need to install additional package

HMC 5.2APAR MB01365 / PTF MH00586

HMC 5.1APAR MB001275 / PTF MH00493

HMC 4.5APAR MB001276 / PTF MH00494

HMC 3.3.7APAR IY87070 / PTF U808917

HMC 3.3.6 APAR IY79212 / PTF U806370

FAQ: How can I find out What storage products are supported on System p servers, ie... is a 3580 tape drive supported on 9117-570? And which adapter is supported?

pSeries Frequently Asked QuestionAnswer to this FAQ:

The Interoperability Matrix on the IBM System Storage and Total Storage website provides a wealth of information on the various storage offerings and System p compatibility. See the URL below.

http://www-03.ibm.com/servers/storage/product/interop.html

Virtualization Engine TS7700 Frequently Asked QuestionFAQ: Which TS7700 Virtualization Engine functions became available in which Code Releases and which LM code is co-reqed

Answer to this FAQ:

TS7740 Function and Code Release Cross Reference

Release 1 (8.0.0.194) GA 09/29/06

For the complete content of this release, refer to announcement letter 106-654, dated August 29, 2006.

3592 native J1A and E05 emulating J1A

Page 257: AIX Commands1

Attachment to TS3500 (3584) libraries

128 virtual drives

500,000 virtual volumes

2 or 4 FICON adapters

6 TB cache

2 cluster Grid

Requires 534.03 LM code

Release 1.1 (8.0.1.24) GA 01/26/07

256 virtual volumes

Autonomic Ownership Takeover Manager

3592 E05 drives in native mode

JB media

3 TB cache configuration

2 - 6 Cache Increments (FC5267)

RPQ Q8B3409 - Fiber Ethernet Card for Grid IP Connection

RPQ Q8B3411 (ordered on B10 or B20) to migrate standalone B10/B20 attached to 3584 to TS7740 (attached to same 3584)

Requires 534.22 LM code

Changes to Daylight Saving Time (DST) in the USA and Canada - 2007Abstract: The new USA Energy Policy Act of 2005 has changed Daylight Saving Time (DST) in the USA, beginning in 2007.

These new dates are NOT observed in Hawaii, American Samoa, Guam, Puerto Rico, the Virgin Islands, and by most of Arizona (with the exception of the Navajo Indian Reservation in Arizona).

The State of Indiana, which used to be split with a portion of the state observing DST and the other half not, is now whole. In the past, counties in the Eastern Time Zone portion of the state did not observe DST. They were on standard time year round. A state law was passed in 2005 that has the entire state of Indiana observing DST beginning in April 2006.

Canada is implementing the same DST changes.

DST Prior to 2007:DST Began - 2 a.m. on the first Sunday of April.DST Ended - 2 a.m. on the last Sunday of October.

Beginning in 2007:DST Begins - 2 a.m. on the second Sunday of March.DST Ends - 2 a.m. on the first Sunday of November.

Page 258: AIX Commands1

IBM has created a focal point website for all DST2007 related information. Users should investigate this website for all IBM equipment and software notices related to DST2007.http://www.ibm.com/support/alerts/us

Notes:

z9 EC and z9 BC: Required MCLs prior to the new DST change beginning in March 2007.SE code - G40717.001SE code - J99678.003HMC code - G40716.001 <=== Applicable to HMC Driver 64 even when attached to 9672 G5/G6 or zSeries)

9037 Sysplex Timers:Customers are responsible to schedule the DST offset at the appropriate time at the 9037 console. This is business as usual.

Server Time Protocol (STP):If you are using STP which has the option of automatically scheduling DST based on your timezone, IBM is planning on making code changes to support the new dates. Customers will need STP MCL's (HMC/SE) for the auto adjust to work on the correct date in 2007. This flash will be updated when the MCLs become available.z9 EC - TBDz9 BC - TBDz990 - TBDz890 – TBD

POWER5 Firmware Maintenance - What you need to knowAbstract: How will you manage upgrades and maintenance to your POWER5 system firmware. Depending on the System i model, you may have the option to manage the system firmware using i5/OS (OS managed) or you may be required to use the Hardware Management Console (HMC). It is imperative that the system administrator understand that these two methods exist, when i5/OS is an option and when the HMC managed method is required, what benefits are provided with the HMC managed method, and where to go for current information on available POWER5 firmware updates and upgrades.

The Ins and Outs of System Firmware

By Allyn Walsh When IBM announced the newest generation of processor technology, the POWER5™, in May 2004, this introduced a basic change in the hardware architecture for the iSeries platform. It has been over two years since POWER5 was introduced and there are still many questions and misconceptions on exactly what this change entails. Such as what purpose does it fulfill and how does it affect your operations and system management processes.

Is there any wonder why there is confusion when even within IBM there are a variety of terms used to refer to this firmware change, such as: EC level (Equipment Change), PHYP (Power Hypervisor), FSP (Flexible Service Processor), POWER5 Firmware, or simply Firmware. You may also see references to Global System Firmware which is an attempt to include all the server based components and the one external component, which is the Hardware Management Console (HMC). For the sake of this article we will use the term, System Firmware to be all inclusive. This article will explain what this change includes and how to manage firmware maintenance.

Page 259: AIX Commands1

POWER5 and System Firmware - why is this better?The changes in the underlying architecture of the POWER5 server were implemented to further isolate the hardware management functions from any operating system dependencies. Prior to i5/OS*, OS/400* included several layers of microcode referred to as System License Internal Code (SLIC) and the Technology Independent Machine Interface (TIMI). Within these operating-system layers, AS/400* and iSeries servers implemented the functions of service processor and a Hypervisor, in the form of a primary partition or stand-alone partition, which handled hardware resource management. This approach bundled these advanced technologies within the operating system, making them operating system dependent and limited to a single server. Some of the functions in SLIC were moved into the system firmware and the HMC (Hardware management Console). Those i5/OS components that remain are now referred to simply as LIC (License Internal Code) and TIMI. By removing this function from SLIC, the system firmware

System firmware is no longer associated with any specific OS. The Power Hypervisor provides new function that enables ‘uncapped processor sharing’

between partitions in the same shared processor pool. Supports AIX natively on an eServer i5 or System i5, either as a hosted OS or with its own

I/O resources. Linux continues to be supported as well. Has additional repair and verify processes, as well as extensive error and resource

monitoring. Removes the requirement for a primary partition and all the resources needed for this, such

as memory, CPU, load-source device, installation device and console. Provides a new user interface to manage system resources and enables a single focal

point capable of managing multiple POWER5 servers.

The first step in understanding System Firmware is to identify what the components are. It is important to understand that every POWER5 server will have the PHYP, FSP and SPCN firmware components, and depending on the specific model or the advanced features being used there are several additional components.

The firmware components include the following (Figure 1):

The Partition Firmware (PFW) supports the pSeries Power Architecture* Platform Requirements+ (PAPR+) interface. This component also enhances the interface for Linux.

The Power Hypervisor (PHYP) firmware, which is based on the iSeries Hypervisor, provides VLAN, virtual I/O, sub-processor partitioning support and uncapped processor sharing.

The Flexible Service Processor (FSP) firmware provides diagnostics, initialization, configuration, runtime error detection and correction.

The System Power Control Network (SPCN) firmware provides power monitoring and control and interfaces with bulk power controllers.

The Bulk Power Control (BPC) firmware controls each bulk power unit in the Central Electronic Complex (CEC) and towers. This firmware is specific to the i595

The HMC firmware provides converged platform configuration, management and services

The fact that these server firmware layers exist affects fix management for server firmware. For the models i520, i550 and i570, you may use either an HMC or i5/OS; but the i595, and the i570 with the optional dual FSP require that firmware maintenance be handled by an HMC. Furthermore, because the HMC is an external appliance, it has its own procedure for fix management. All of this requires your careful consideration when planning your maintenance strategies

Managing your Server Firmware

The two methods to upgrade or update your server firmware are often referred to as ‘Inband’, which is OS managed, or ‘Outband’, which is HMC managed. The vast majority of installed servers today are using the OS Managed method, and from an operational perspective, nothing has changed with firmware management. The system firmware is maintained using standard i5/OS PTF management processes. Your server firmware fixes, upgrades and updates happen transparently during the server IPL step. Firmware maintenance is packaged as MHxxxxx PTFs

Page 260: AIX Commands1

and is included in the cumulative PTF package and the Hiper Group PTF package. For a single i5/OS image system, the server will automatically reboot the FSP as part of the IPL process. A reboot of the FSP is referred to as a ‘deep IPL’. For OS Managed firmware maintenance, a deep IPL is always required. For non-partitioned systems this is not an issue, however, on a partitioned system firmware maintenance can only be applied by the partition that is identified as the service partition and all other partitions must be shut down when the service partition is IPL’d. This requirement would be very similar to performing PTF maintenance on a ‘primary partition’ on a pre-POWER5 server.

There are advantages in using the HMC managed method, such as ‘Concurrent Firmware Maintenance’ which allows updates and fixes (not upgrades) to the server firmware while the system is operational. For a system that is running two or more partitions, allowing these partitions to remain operational and available to the business during firmware maintenance, may be a significant factor. Another example might be if you have multiple POWER5 servers managed by a single HMC. The HMC will store a copy of the firmware updates and can distribute the updates to any server that it is configured to manage. The ultimate goal is to deploy most firmware updates without any disruption to the business applications. Concurrent firmware maintenance is currently only available using the HMC managed method.For additional details on the HMC, refer to eServer Magazine, October 2005, cover story “Taming the HMC", by Allyn Walshhttp://www.eservercomputing.com

Not every POWER5 server requires an HMC. However, there are conditions where an HMC is mandatory, such as the following:

• Systems with LPARs (there is an exception to this called Virtual Partition Manager, which allows a single i5/OS image to host up to four Linux partitions with some additional restrictions. • Systems that plan to utilize the full capabilities of Capacity Upgrade on Demand (CUoD). • Systems with redundant service processors, which are included with every i595, p590 and p595 and optional on the i570 and p570. • Systems with bulk power assemblies (on i595, p590 and p595 only)

Firmware Update PolicyThe Firmware Update Policy controls how firmware updates are managed. The default for this is automatically changed from OS managed (Inband) to HMC managed (Outband) once an HMC is attached. Even if you are not using an HMC today the Update Policy could have been set to HMC managed if an HMC was attached to this server at any previous time. While in this state, even though firmwares PTFs are loaded through the OS, and they will appear under the DSPPTF 5722999 listing as applied, they are not actually applied to the firmware components.

If you need to change the Firmware Update Policy, this must bet set using the Advanced System Management Interface (ASMI). Sign on using the ASMI administrator user ID and password. Expand the option for System Management; select the tab Firmware Update Policy. Select the preferred update policy. A deep IPL is required to activate this change. For more details on how to access ASMI please refer to the System i/p Hardware Information Center at: http://publib.boulder.ibm.com/infocenter/eserver/v1r3s/topic/iphby/accessasmi.htm)

Note: With the exception of the i595 or i570 with redundant service processor, you can choose to perform firmware maintenance using the OS Managed option. If this is a partitioned system, you must also designate an i5/OS service partition. Firmware updates will be installed when PTF maintenance is applied on the service partition and a deep IPL is performed when the service partition is IPL’d.

o To set a service partition: Sign on to the HMC with Super Admin authority. From the <Management Environment Panel, expand Server and Partition Select Server Management

Page 261: AIX Commands1

Highlight the desired server and right click the mouse Select Properties On the Properties panel, expand the Service Partition tab and select the

desired partition.

Check your firmware levelIBM has not provided a simple method to correlate i5/OS PTF IDs with firmware levels to and the corresponding HMC firmware level. Adding to the confusion, within IBM we have used the term ‘GA-Level’ to denote dependencies between HMC and server firmware. The following link is available for Registered Support Center users http://www-912.ibm.com/s_dir/slkbase.NSF/slkregdocs?openform :then search on document # 400809308

Here is an ‘UNOFFICIAL’ table that maps the Inband PTF IDs with the Outband fixpack format and the corresponding HMC level. This table should be current as of mid-July 2006: (Figure 2)

Understanding how firmware maintenance is delivered OS Managed maintenance, including upgrades, is packaged for i5/OS in PTF format using

MHxxxxx PTF identifiers. HMC Managed, maintenance is delivered as ‘Fixpacks’. Updates and upgrade packages

use the same packaging format:PPNNSSS_FFF_DDD and will have a corresponding MHxxxxx marker PTF:

PP = package identifier; 01 = managed system and 02 = power subsystem. NN = machine type model group; SF = system firmware and BP = bulk power. SSS = fixpack code stream indicator, i.e., a code level (e.g., 240) FFF = fixpack number for current fixpack level DDD = fixpack number for the last disruptive fixpack levelFor example, the most current level available today is SF240_219_202

HMC firmware is tracked by Version/Release/modification. Updates to HMC firmware also use the MHxxxxx identifiers, however, these are not included in Cum or Hiper PTF packages HMC firmware used VRM

Version Release Point release (modification level)

If you do not have an HMC, you can check your firmware level in either of two ways. From a 5250 session, sign on to SST (System Service Tools) and check the flash level.

The procedure is:o strssto sign on o option 1 (start a service tool)o option 4 (Display/Alter/Dump)o option 1 (Display/Alter Storage)o option 2 (LIC data)o option 14 (Advanced analysis)o Select FLASHLEVELSo hit enter (don’t need to specify options)o flash levels are displayed

The result will look something like this: (figure 3)

Server Time Protocol Overview PresentationAbstract: This overview will provide you with an introduction to Server Time Protocol (STP). The Server Time Protocol feature is designed to provide the capability for multiple servers and Coupling Facilities to maintain time synchronization with each other, without requiring a Sysplex Timer.

Page 262: AIX Commands1

I have a Developer that requires an iSeries with an AIX partition with 2 processors. He doesn't want tape drive in his AIX partition. He wants to use the embedded LAN ports to do a network backup to a SAN or tape.. Can this be done? Please give some detail on how I'm sure he will ask.... Frequently Asked Question

FAQ: I have a Developer that requires an iSeries with an AIX partition with 2 processors. He doesn't want tape drive in his AIX partition. He wants to use the embedded LAN ports to do a network backup to a SAN or tape.. Can this be done? Please give some detail on how I'm sure he will ask....

Answer to this FAQ:

Sure, no reason why you can't do this. To use the embedded Ethernet, just assign the 10/100/1000 Ethernet adapter in T5 (or similar) to the AIX LPAR. T6 will be assigned at the same time, since it's really the same Ethernet adapter on the backplane.

This is more of a general comment, however: I'd still be very curious about where the rest of the resources for AIX (disk, for instance) are coming from, or which slots are planned for an i5/OS LPAR. Is there an LVT?

AIX Frequently Asked QuestionFAQ: I have a tight LPAR for my developer 9406-520. Can I use a 2844 IOP with 5761 Fiber Channel card on switchable IOP. I want to use for i5/OS partition and AIX 53 partition if I deallocate the IOP when I want to utilize for AIX53. Is there a document that describes the process?

Answer to this FAQ:

Yes and no. In principle, there's no problem with allocating an IOP + IOA to i5/OS, then just the IOA to AIX. Not much of a process associated with it, you just use the HMC to switch ownership of only the IOA to AIX. However, that Fibre IOA is not supported for AIX right now. If you need an answer today, it's that it's not possible with that IOA.

There's a good chance that the 4-Gbit Fibre IOAs will be announced for AIX soon, they're just not out yet.

AS/400 Frequently Asked QuestionFAQ: Is Value Pack still available? How do I configure in eConfig the System i Software 5722-VP1, value pack, and where is it located in econfig?

Answer to this FAQ:

In eConfig select Software product, then Shared Preferences tab, then select i5/OS Common Preferences by double clicking or selecting the Edit Spec button, then select Misc Preference tab, ValuPak (VP1) under Packages.

FAQ: Where can I go to track the latest virtualization enhancements?

Page 263: AIX Commands1

Power5 Frequently Asked Question

Answer to this FAQ:

You can go to the following site:

http://techsupport.services.ibm.com/server/vios/documentation/home.html

This site will give you more information regarding new features as well as other features of VIO.

Source: IBM System p Advanced POWER Virtualization Best Practices Redpaper

Host bus adapters for attachment of IBM TotalStorage devices to System i and other platforms

Abstract: Is there a tool available from IBM which allows me to determine which host bus adapter is needed to attach an IBM Total Storage device to a System i?

There is an excellent web site maintained by IBM System Storage under their "Support" link, which allows you to select a Total Storage solution, the host platform (for example, System i) and (optionally) the connection protocol - Fiber, ESCON, iSCSI, SCSI, etc. Indicate the following: the Total Storage solution you wish; the host to which it will attach; the protocol (optional) and the web site will return the supported host bus adapter(s) for your selections.Access the web site at the following URL:

http://www-01.ibm.com/servers/storage/support/config/hba/index.wss

IBM Virtual I/O Server(VIOS) V1.3                  

1       Storage Solutions

1.1    Supported Storage Subsystems

Specific models of the IBM Storage Solutions

2105 Enterprise Storage Server (models 800, 750, Fxx)

2107 Model 921    IBM System Storage DS81002107 Model 922    IBM System Storage DS83002107 Model 9A2    IBM System Storage DS83002107 Model 92E    IBM System Storage DS8000 Expansion Unit2107 Model 9AE    IBM System Storage DS8000 Expansion Unit

1750 Model 511    IBM System Storage DS68001750 Model EX1   IBM System Storage DS6000 Expansion Unit

Page 264: AIX Commands1

IBM System Storage DS4800IBM System Storage DS4700IBM TotalStorage     DS4500 (FAStT900)IBM TotalStorage     DS4400 (FAStT700) IBM TotalStorage     DS4300 (FAStT600) IBM System Storage DS4200IBM TotalStorage     DS4100 (FAStT100)FAStT200 Storage Server FAStT500 Storage Server   

IBM System Storage N3700 (iSCSI attach only)IBM System Storage N5200 (iSCSI attach only)

IBM TotalStorage SAN Volume Controller

Under-the-cover IBM parallel SCSI devices

1.2    Recognized Storage Subsystems

Virtual I/O Server issues will be addressed for selected configurations which include specific models of the following disk subsystems:

EMCHDSHP

- contact your storage vendor representative for model details

2      Operating Systems       (IBM Virtual I/O Server can provide virtual I/O resources to client partitions for the following operating systems)

AIX 5.3 (or later)

SUSE LINUX Enterprise Server 9 for POWER (or later)                                          

Red Hat Enterprise Linux AS for POWER Version 3(update 2 or later)

Red Hat Enterprise Linux AS for POWER Version 4 (or  later)

NOTE:  AIX 5.3 is the only applicable client operating system for use with the Recognized Storage Subsystems(section 1.2) at this time

 3     Host Software    (supported on the IBM Virtual I/O Server)

AIX Multipath I/O (MPIO)

IBM TotalStorage Multipath Subsystem Device Driver (SDD  v1608) - for ESS and SVC

IBM TotalStorage Multipath Subsystem Device Driver (SDDPCM v2108) - for ESS and SVC

RDAC

AutoPath

        -  contact your storage vendor representative for details regarding host software for recognized storage subsystems        -  NOTE: SDD V1.6.1.0 is not supported at this time        -  NOTE: within a VIOS, migrating from SDD to SDDPCM is not supported   at this time

Page 265: AIX Commands1

4    SAN switches    (selected models from the following suppliers)

Brocade

McData

Cisco

CNT

- the list of switches above refers to specific switch vendors. It should be noted that VIOS SAN configurations that include switches should utilize an IBM switch machine type model, or the equivalent vendor model and firmware level.- not all Recognized Storage Subsystems(section 1.2) acknowledge configurations with all of the switch vendors listed.  Verify switch models and machine types with your IBM representative or Business Partner.

5    End-to-end solutions

VIOS attached storage

storage software running on the

VIOS

MPIO supported on

the AIX client

IBM System Storage DS8000 / DS6000 and ESS

SDDPCM YES

SDD ( 2 )         NO ( 1 )IBM TotalStorage DS4000 / FAStT   RDAC     YES

SAN Volume ControllerSDD ( 2 )        NO ( 1 )

SDDPCM YESIBM System Storage N3700 and

N5200MPIO (default PCM) YES

EMCPowerPath ( 2 ) YES

MPIO (default PCM) YES

HDSHDLM ( 2 ) YES

MPIO (default PCM) YESHP AutoPath YES

      1     -     not supported at this time

      2    -      Virtual disk devices created in certain non-MPIO VIOS environments may require a migration effort in the future.                    This migration may include a complete back-up and restore of all data on affected devices.                      See the VIOS FAQ on the VIOS website for additional detail.

6  VIOS Supported I/O Feature Codes

Page 266: AIX Commands1

Virtual I/O Server I/O feature codesFeature Code (FC)

IBM System i IBM System p

LAN    

PCI 1Gbps Ethernet IOA 0620 5700

1978PCI 1Gbps Ethernet UTP IOA 0621 5701

1979PCI 10/100Mbps Ethernet w/ IPSec 4962 4962

PCI 10/100Mbps Ethernet UTP 4-port 0637 4961

PCI 10/100/1000Mbps Ethernet UTP 2-port 5706 5706

1983PCI-X 10/100/1000Mbps Ethernet UTP 2-port 1990PCI 1Gbps Ethernet Fiber 2-port 5707 5707

1984PCI-X 10/100/1000Mbps Ethernet 4-port 5740 5740

1954PCI 10Gbps Ethernet Fiber  5718 5718

1981PCI 10Gbps Ethernet Fiber  5719 5719

1982PCI-xddr 10Gbps Ethernet Fiber 5721 5721

PCI-xddr 10Gbps Ethernet Fiber 5722 5722

    

Storage Controllers  IBM System i IBM System p

PCI 2Gb Fibre Channel0611 6228

PCI-X DDR Dual Channel Ultra320 SCSI Adapter 57361912

PCI-X DDR Dual Channel Ultra320 SCSI RAID Adapter 5737 5737

1913

Dual Channel SCSI RAID Enablement Card

5728

572719081976

PCI-X Dual Channel Ultra320 SCSI RAID Adapter 0628 5703

57111975

PCI-X Dual Channel Ultra320 SCSI Adapter5710

57121974

2Gb Fibre Channel PCI-X Adapter 0625 6239

0646 57161977

2Gb Fibre Channel PCI-X Adapter ( Low Profile ) 1957

Page 267: AIX Commands1

PCI Universal Differential Ultra SCSI Adapter 6204 6204

PCI 160MB U3 SCSI LVD 6203 6203

PCI 160MB U3 SCSI LVD RAID 4-port 0642 2498

PCI 1Gb iSCSI TOE (copper) 5713 5713

1986PCI 1Gb iSCSI TOE (fiber) 5714 5714

19874Gb Fibre Channel PCI-X 2.0 DDR Adapter (Single-Port) 5758 5758

19054Gb Fibre Channel PCI-X 2.0 DDR Adapter (Dual-Port) 5759 5759

1910

Hi,

I'm having trouble getting my VIO client to using 2 paths.  After building the partition, lspath only shows one link, from my second VIO server - when I'm expecting 2.  Does any additional software need to be installed on the client to use mutlipathing?

Thanks,John

p5wizard (IS/IT--Management)21 Nov 06 9:21

please show output of

==> on VIO serverslsmap -all|grep -p hdiskXX (for a specific ESS disk)lsdev -vpd -dev vtscsiYY (from lsmap output)lsdev -vpd -dev hdiskXX (from lsmap output)

==> on VIO clientlscfg -vl hdiskZlspath -l hdiskZlsdev -Ccadapter -t IBM,v-scsilscfg|grep vscsi

Do this for a VIO client disk hdiskZ which is served by your VIO server(s) as vSCSI target disk vtscsiYY for ESS disk hdiskXX (I hopes this makes sense to you).

Also, have you turned off SCSI device reservation on both VIO servers? Are you sure the VIO client's vscsi adapters are coorectly linked to the VIO server's vhost adapters?

HTH,

p5wizard

jprabaker (TechnicalUser)22 Nov 06 6:44

I knew it was something simple.  The reserve policy was not set on one of the vio servers.

Page 268: AIX Commands1

Defining SANStorage networks are distinguished from other forms of network storage by the low-level access method that they use. Data traffic on the SAN Fabric is very similar to those used for internal disk drives, like ATA and SCSI.In a storage network, a server issues a request for specific blocks, or data segments, from specific disk drives. This method is known as block storage. The device acts in a similar fashion to an internal drive, accessing the specified block, and sending the response across the network.In more traditional file storage access methods, like SMB/CIFS or NFS, a server issues a request for an abstract file as a component of a larger file system, managed by an intermediary computer. The intermediary then determines the physical location of the abstract resource, accesses it on one of its internal drives, and sends the complete file across the network.Most storage networks use the SCSI protocol for communication between servers and disk drive devices, though they do not use its low-level physical interface. Typical SAN physical interfaces include 1Gbit Fibre Channel, 2Gbit Fibre Channel, 4Gbit Fibre Channel, and (in limited cases) 1Gbit iSCSI. The SCSI protocol information will be carried over the lower level protocol via a mapping layer. For example, most SANs in production today use some form of SCSI over Fibre Channel system, as defined by the FCP mapping standard. iSCSI is a similar mapping method designed to carry SCSI information over IP.

[edit] BenefitsSharing storage usually simplifies storage administration and adds flexibility since cables and storage devices do not have to be physically moved to move storage from one server to another. Note, though, that with the exception of SAN file systems and clustered computing, SAN storage is still a one-to-one relationship. That is, each device (or Logical Unit Number (LUN)) on the SAN is "owned" by a single computer (or initiator). In contrast, Network Attached Storage (NAS) allows many computers to access the same set of files over a network. The contrast between the SAN and NAS has been blurred with the creation of a NAS head.SANs tend to increase storage capacity utilization, since multiple servers can share the same growth reserve.Other benefits include the ability to allow servers to boot from the SAN itself. This allows for a quick and easy replacement of faulty servers since the SAN can be reconfigured so that a replacement server can use the LUN of the faulty server. This process can take as little as half an hour and is a relatively new idea being pioneered in newer data centers. There are a number of emerging products designed to facilitate and speed up this process still further. For example, Brocade Communication Systems offers an Application Resource Manager product which automatically provisions servers to boot off a SAN, with typical-case load times measured in

Page 269: AIX Commands1

minutes. While this area of technology is still new, many view it as being the future of the enterprise datacenter.SANs also tend to enable more effective disaster recovery processes. A SAN attached storage array can replicate data belonging to many servers to a secondary storage array. This secondary array can be local or, more typically, remote. The goal of disaster recovery is to place copies of data outside the radius of effect of an anticipated threat, and so the long-distance transport capabilities of SAN protocols such as Fibre Channel and FCIP are required to support these solutions. (The physical layer options for the traditional direct-attached SCSI model could only support a few meters of distance: not nearly enough to ensure business continuance in a disaster.) Demand for this SAN application has increased dramatically after the September 11th attacks in the United States, and increased regulatory requirements associated with Sarbanes-Oxley and similar legislation.Newer SANs allow duplication functionality such as "cloning", "Business Continuance Volumes (BCV)" and "snapshotting," which allows for real-time duplication of LUN, for the purposes of backup, disaster recovery, or system duplication. With higher-end database systems, this can occur without downtime, and is geographically independent, primarily being limited by available bandwidth and storage. Cloning and BCV's create a complete replica of the LUN in the background (consuming I/O resources in the process), while snapshotting stores only the original states of any blocks that get changed after the "snapshot" (also known as the delta blocks) from the original LUN, and does not significantly slow the system. In time, however, snapshots can grow to be as large as the original system, and are normally only recommended for temporary storage. The two types of duplication are otherwise identical, and a cloned or snapshotted LUN can be mounted on another system for execution, or backup to tape or other device, or for replication to a distant point.

[edit] Disk controllersThe driving force for the SAN market in the enterprise space is rapid growth of highly transactional data that require high speed block level access to the hard drives (such as data from email servers, databases, and high usage file servers). Historically, enterprises would have "islands" of high performance SCSI storage RAIDs that were locally attached to each application server. These "islands" would be backed up over the network, and when the application data exceeded the maximum amount of data storable by the individual server, the end user would often have to upgrade their server to keep up.The disk controllers used in enterprise SAN environments are designed to provide applications with block level access to high speed, reliable "virtual hard drives" (or LUNs). In addition, modern SANs allow enterprises to intermix FC SATA drives with their FC SCSI drives. SATA drives have lower performance, a higher failure rate, higher capacity, and lower prices than SCSI. This allows enterprises to have multiple tiers of data that will migrate over time to different types of media. For example: many enterprises relegate files that are rarely accessed to FC SATA while keeping their frequently used data in FC SCSI.

Page 270: AIX Commands1

Another feature of most enterprise disk controllers is a I/O cache. This feature allows higher overall performance for writing to the controller, and in some cases (like for contiguous file access where read ahead is enabled) reading from the controller.

[edit] SAN typesSANs require an infrastructure specially designed to handle storage communications called a fabric. Thus, they tend to provide faster and more reliable access than higher level protocols such as NAS. A fabric is similar in concept to a segment in a local area network.The industry standard SAN technology is Fibre Channel networking with the SCSI command set. A typical Fibre Channel SAN fabric is made up of a number of Fibre Channel switches. Today, all major SAN equipment vendors also offer some form of Fiber Channel routing solution, and these bring substantial scalability benefits to the SAN architecture by allowing data to cross between different fabrics without merging them. These offerings use proprietary protocol elements, and the top-level architectures being promoted are radically different. When extending Fibre Channel over long distances for disaster recovery solutions, it can be mapped over other protocols. For example, products exist to map Fibre Channel over IP (FCIP) and over SONET/SDH. It can also be extended natively using signal repeaters, high-power laser media, or multiplexers such as DWDMs.Cisco has recently turned their attention toward fabric switching. The network hardware giant has introduced some comparable and even superior fabric switching alternatives. Cisco recently released a 10gb fiber channel switch.

[edit] Centralized storage area networksA centralized storage area network contains many heterogeneous servers connected to one single storage space. The single storage space can have heterogeneous storage entities or disk drives. Centralized storage area networks are useful for simplifying the storage architecture in large organizations. The storage space can be treated as a black box so that administration of storage is easy. Centralized storage area networks are compatible with many heterogeneous server environments including Linux, Windows based servers.A distributed storage area network contains many geographically-dispersed disk drive networks. All the networks are treated as one unit and are connected by the iSCSI storage area network protocol. Distributed storage area networks is a sub-network of shared storage devices that allows for all information stored to be shared among all of the servers on the network. Distributed storage area networks are most popular in large organizations with geographically dispersed storage pools, that can be connected and communicate through iSCSI. bye

[edit] CompatibilityOne of the early problems with Fibre Channel SANs was that the switches and other hardware from different manufacturers were not entirely compatible. Although the basic storage protocols (such as FCP) were always quite standard, some of the higher-level functions did not interoperate well.

Page 271: AIX Commands1

Similarly, many host operating systems would react badly to other Operating Systems sharing the same fabric. Many systems were pushed to the market before standards were finalized and vendors innovated around the standards.The combined efforts of the members of the Storage Networking Industry Association (SNIA) improved the situation during 2002 and 2003. Today most vendor devices, from HBAs to switches and arrays, interoperate nicely, though there are still many high-level functions that do not work between different manufacturers' hardware.

[edit] SANs at workSANs are primarily used in large scale, high performance enterprise storage operations. It would be unusual to find a Fibre Channel disk drive connected directly to a SAN. Instead, SANs are normally networks of large disk arrays. SAN equipment is relatively expensive, therefore, Fibre Channel host bus adapters are rare in desktop computers. The iSCSI SAN technology is expected to eventually produce cheap SANs, but it is unlikely that this technology will be used outside the enterprise data center environment. Desktop clients are expected to continue using NAS protocols such as CIFS and NFS. The exception to this may be remote replication sites. Remote replication enables the data center environment to exist in multiple locations for disaster recovery and business continuity purposes. The performance issues inherent in iSCSI are likely to limit its deployment to lower-tier applications, with Fibre Channel remaining incumbent for high performance systems.

[edit] SANs in a Small Office / Home Office (SOHO)With the increasing rise of digital media in all phases of life and its effect on storage needs, it's natural that SANs have begun to enter into the SOHO market. Historically, this market was dominated by NAS systems, but SOHO is poised to become a major market for SAN infrastructure as SOHO performance requirements rise.Systems such as film scanners and video editing applications require performance that cannot be provided by traditional file servers. For example, motion picture film at 2048x1536 requires more than 300MBytes/s for each real-time stream, and several of these streams can be required simultaneously. As a result, several Gigabits per second can be required, which creates a problem for standard NAS technologies. In addition, these systems need to work with the same files collaboratively, so they cannot be distributed through different file servers or DAS connections.Instead of having many computers connected to the network, with each one requiring a low bandwidth and only the server being stressed under heavy traffic, the SOHO "real-time" area only needs to integrate a few systems, but all of them require high bandwidth to access to the same files. These problems are addressed very well by 4Gbit Fibre Channel SAN infrastructures, where the aggregated bandwidth for sequential I/O operations is extremely high.

Page 272: AIX Commands1

[edit] Storage virtualization and SANs Storage virtualization refers to the process of completely abstracting logical storage from physical

storage. The physical storage resources are aggregated into storage pools, from which the logical storage is created. With storage virtualization, multiple independent storage devices, that may be scattered over a network, appear to be a single monolithic storage device, which can be managed centrally. Storage Virtualization is commonly used in SANs. Virtualization of storage helps achieve location independence by abstracting the physical location of the data. The Virtualization system presents to the user a logical space for data storage and itself handles the process of mapping it to the actual physical location.

NAS

DescriptionNAS differs from the traditional file serving and Direct Attached Storage in that the operating system and other software on the NAS unit provide only the functionality of data storage, data access and the management of these functionalities. Furthermore, the NAS unit does not limit clients to only one file transfer protocol . NAS systems usually contain one or more hard disks, often arranged into logical, redundant storage containers or Redundant array of independent disks RAID arrays, as do traditional file servers. NAS removes the responsibility of file serving from other servers on the network and can be deployed via commercial embedded units or via standard computers running NAS software.NAS uses file-based protocols such as NFS (popular on UNIX systems) or Server message block (SMB) (used with MS Windows systems). Contrast NAS's file-based approach and use of well-understood protocols with storage area network (SAN) which uses a block-based approach and generally runs over proprietary protocols. Minimal-functionality or stripped-down operating systems are used on NAS computers or devices which run the protocols and file applications that provide the NAS functionality. A "leaned-out" FreeBSD is used in FreeNAS, for example, which is open source NAS software meant to be deployed on standard computer hardware. Commercial embedded devices and consumer "network appliances" may use closed source operating systems and protocol implementations.

[edit] HistoryNetwork-attached storage was introduced with the early file sharing Novell's NetWare server operating system and NCP protocol in 1983. In the UNIX world, Sun Microsystems' 1984 release of NFS allowed network servers to share their storage space with networked clients. 3Com's 3Server and 3+Share software was the first purpose-built servers (including proprietary hardware, software, and multiple disks) for open systems servers, and the company led the segment from 1985 through the early 1990s. 3Com and Microsoft would develop the LAN Manager software and protocol to further this new market. Inspired by the success of file servers from Novell, IBM, and Sun, several firms developed dedicated file servers. While 3server was among the first firms to build a dedicated NAS for desktop operating systems, Auspex Systems was one of the first to develop

Page 273: AIX Commands1

a dedicated NFS server for use in the UNIX market. A group of Auspex engineers split away to create the integrated Network Appliance "filer", which supported both Windows and UNIX, in the early 1990s, starting the market for proprietary NAS arrays.

[edit] BenefitsAvailability of data can potentially be increased with NAS because data access is not dependent on a server: the server can be down and users will still have access to data on the NAS. Performance can be increased by NAS because the file serving is done by the NAS and not done by a server responsible for also doing other processing. The performance of NAS devices, though, depends heavily on the speed of and traffic on the network and on the amount of cache memory (the equivalent of RAM) on the NAS computers or devices. Scalability of NAS is not limited by the number of internal or external ports of a server's data bus, as a NAS device can be connected to any available network jack. NAS can be more reliable than DAS because it separates the storage from the server. If the server fails, there is unlikely to be filesystem corruption, although partially-created files may linger. However, if the power source or OS of the NAS fails, corruption is still possible.

[edit] NAS usesNAS is useful for more than just general centralized storage provided to client computers in environments with large amounts of data. NAS can enable simpler and lower cost systems such as load-balancing and fault-tolerant email and web server systems by providing storage services. The potential emerging market for NAS is the consumer market where there is a large amount of multi-media data. Such consumer market appliances are now commonly available. Unlike their rackmounted counterparts, they are generally packaged in smaller form factors. The price of NAS appliances has plummeted in recent years, offering flexible network based storage to the home consumer market for little more than the cost of a regular USB or FireWire external hard disk. Many of these home consumer devices are built around ARM, PowerPC or MIPS processors running an embedded Linux operating system. Examples include Buffalo's TeraStation [1] and Linksys NSLU2 [2].

[edit] NAS headsA NAS head refers to a NAS which does not have any on-board storage, but instead connects to a SAN. In effect, it acts as a translator between the file-level NAS protocols (NFS,CIFS,etc.) and the block-level SAN protocols (Fibre Channel, iSCSI). Thus it can combine the advantages of both technologies.

[edit] NAS operating systems for consumer PCsOpen source NAS-oriented distributions of Linux and FreeBSD are also available, including FreeNAS, NASLite and Openfiler. They are easy to configure via a Web-based Interface and run on low-end conventional computers. They can run off of LiveCDs, bootable USB flash drives, or off of one of the mounted hard drives. They run Samba, NFS daemon, and FTP daemons that are freely available for those operating systems.

Page 274: AIX Commands1