AIX Cheat sheet sysinfo AIX Server Release info oslevel -r Server type prtconf | grep -i 'System Model' Hardware Info lscfg -v lscfg -l ent0 lscfg -vl fcs0 (find the WWN of HBA adapter) lsdev lsdev -Cc disk lsdev -Cc disk -p scsi0 lsslot -c [pci|phb|port] lsslot -c pci -l ent0 lspath -l hdisk0 diag Operating System oslevel [-r|-s] Memory prtconf -m prtconf |grep -i memory lsattr -El sys0 -a realmem bootinfo -r CPU (type, number, etc) prtconf |grep -i processor Disk Drives lsdev -Cc disk lsdev -Cc disk -p scsi0 (specific controller) lsdev -Cc disk -S [a|d|s] (available, defined, stopped) lscfg -v -l hdisk0 Kernel File and associated directories /unix /usr/lib/boot /usr/lib/drivers Note: /unix - symbolic link to kernel file i.e /usr/lib/boot/unix_64 Kernel 32 or 64 prtconf -k bootinfo -K Display Firmware prtconf |grep -i firmware lscfg -pv invscout Display IRQ, IO ports and DMA prtconf GUI admin tool smit smitty Memory and Swap Memory prtconf -m prtconf |grep -i memory lsattr -El sys0 -a realmem bootinfo -r page size (memory) pagesize pagesize -a (display all supported pagesizes) display swap lsps -a (detailed) lsps -s adding swap mkps -a -s 4 -n # change the attributes chps -a n paging00 (don't use after restart) # change the logical volume attributes (name in this case) chlv -n (chang page space name) Note: -a reconfigure paging space after restart -s size of the page space (logical partitions) -n activiates the paging space (use swapoff to deactivate) also see /etc/swapspaces file removing swap swapoff /dev/paging00 rmps paging00 Note: paging space must be deactiviated before removing Disks, Filesystems and Devices Disk Drives lsdev -Cc disk lsdev -Cc disk -p scsi0 (specific controller) lsdev -Cc disk -S [a|d|s] (available, defined,stopped) lscfg -v -l hdisk0 Disk serial Number, type, etc lscfg -vl hdisk0 lscfg -vl hdisk* Disk disk partitions lsvg -l rootvg lchangelv cat /etc/filesystems List Raw Partitions Just create a new LVOL without a filesystem # create a raw volume mklv -y rawVolume vg01 10 Bad Blocks chlv -b [y|n] Note: enables bad block relocation Filesystem commands df -k lsfs [] lsfs -q (detailed) Filesystem (create|remove) crfs -v jfs2 -d data02lv -m /data02 -A yes -v filesystem type -d device or logical volume -m mountpoint -A mount after restart [yes|no] rmfs -ri /data02 -r remove the mountpoint -i display warning before removing chfs -a size=+1G /var (grow by additional 1GB) chfs -a size=1G /var (grow to 1GB in size) Tune Filesystems chfs Note: you can perform the following resize freeze change mountpoint permissions lots more.............................. backup filesystem backup|restore tar dd cpio Display the boot device bootinfo -b (display last boot device) bootlist -m [normal|service] -o (display bootable devices) Setting the boot device bootlist -m normal hdisk0 hdisk1 Creating boot device (MBR) bosboot -a (uses default device) bosboot -ad hdisk1 mount/unmount floppy mount /dev/rfd0 /floppy mount/unmount CDROM mount -v cdrfs -r /dev/cd0 /cdrom umount /cdrom create boot disk or recovery tape mksysb boot into maintenace mode 1. Restart the machine. 2. Wait the the AIX splash screen to come up. Devices begin to initialize here. 3. When you see the [keyboard] word on screen hit the F5 button or the 5 key depending on your console. 4. Choose “select boot options ” when the maintenance screen comes up, then option 1, then option 1 for scsi, then option 3 service mode boot Device paths floppy: /dev/fd0 /dev/rfd0 disk: /dev/hdisk0 cdrom: /dev/cd0 update /dev directory cfgmgr cfgmgr -l scsi0 mkdev remove or change a device rmdev rmdev -l cd0 chdev chdev -l rmt0 -a ret=no list device drivers lsdev lsdev -Cc disk lsdev -Cc disk -p scsi0 lsslot -c pci -l ent0 lscfg lscfg -l ent0 lscfg -vl fcs0 (find the WWN of HBA adapter) lspath -l hdisk0 getconf DISK_SIZE hdisk1 (detailed) Networking Basic network information stores information in the ODM (Object Database Manager) (hostname, ip address) displaying network interfaces ifconfig -a entstat -d lsdev -Cc if lsdev -Cc tcpip odmget -q "name=en0" CuAt lsattr -EHl en0 Configure network interface mktcpip (completely setup a network interface) rmtcpip (remove all network interfaces) # configure an interface mktcpip -h aix1 -a 192.168.1.200 -m 255.255.255.0 -i en1 -g 192.168.0.10 -h - hostname assigned to interface -a - ip address -m - netmask -i - interface name -g - gateway ip address # remove an interface ifconfig en1 detach ifconfig (configures IP address) chdev (add aliases to network interface) Starting and stopping a network interface ifconfig en0 up ifconfig en0 down ifconfig en0 detach (remove) Setting NIC speed chdev -l ent0 -a media_speed=1000_Full_Duplex -P chdev -l ent0 -a media_speed=Auto_Negotiation -P Note: entX - physical device enX - frame type run on entX Change NIC parameters netstat -v entstat -d no -a no -o "ipforwarding=1" Display NIC statistics netstat -i [-f inet] netstat -s entstat -d display MAC address netstat -ia Displaying network packets tcpdump -i iptrace -i ipreport (used with iptrace to view reports) Note: you must stop the iptrace by using "kill -15" default router route add 0 Note: there is no file that holds the default router display routing table netstat -rn netstat -r -f inet lsattr -EHl inet0 -a route Test IPMP, Bonding smitty etherchannel (creates, deletes and tests) entstat -d ent0 change the hostname hostname chdev -l inet0 -a hostname= setup DNS /etc/resolv.conf Name service switch file (DNS client) /etc/netsvc.conf /etc/resolv.conf /etc/irs.conf (may not be there) chnamsv (change name service) rmnamsv (remove a name service) lsnamsv -C (list name services) Flush DNS cache netcdctrl -t dns -e hosts -f Domain Name domainname Obtain IP Address routing route -n get Find Services on the network Boot (jumpstart) servers: rpcinfo -b bootparam 1 NFS servers: rpcinfo -b mountd 1 NIS servers/slaves: rpcinfo -b ypserv 1 Crash Dump Crash Dump sysdumpdev -l (list dump destination) sysdumpdev -e (estimates dumpsize) sysdumpdev -L (info) sysdumpstart -p (start dump primary) sysdumpstart -s (start dump secondary) # set the dump device permanently sysdumpdev -p -P # analyse dump file echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0 Performance Monitoring and Diagnostics CPU topas -P topas -L (logical partitions) mpstat sar -c w (load average) uptime (load average) lparstat ps iostat -tT 1 tprof curt Memory topas vmstat sar -b svmon ps ipcs -a lockstat (version 4) rmss Network [ent|tok|fddi|atm]stat netstat netpmon (trcstop to stop trace) Disk topas -D (disk) topas -F (filesystem) iostat sar -D fcstat (fibre) lvmstat filemon (trcstop to stop) fileplace # disk stat history chdev -l sys0 -a iostat=true lsattr -HEl sys0 -a iostat Application topas truss sar probevue tprof svmon -P NFS nfsstat Kernel Modules and Parameters display loaded modules genkex set kernel parameters (tuning) chdev -l sys0 -a = no -a (network) vmo -a (virtual memory) nfso -a (NFS) ioo -a (Input/Ouput) raso -a (reliability, availability, serviceability) schedo -a (processor scheduler) vi /etc/security/limits cd /etc/tunables tunchange, tundefault, tunsave, tunrestore, tuncheck Note: most parameters are dynamically changed in AIX , for example memory segments are dynamically adjusted display kernel parameters lsattr -EHl sys0 Note: only a few kernel parameters can be changed build kernel chdev -l sys0 -a = Note: most parameters are dynamically changed in AIX , for example memory segments are dynamically adjusted interprocess communication ipcs -a Services display services lssrc -a start services startsrc -s startsrc -g stop services stopsrc -s stopsrc -g reload service refresh -s restart service stopsrc -s startsrc -s service status lssrc -a service logging, etc /var/adm/ras /etc/syslog.conf /etc/rc.tcpip Patching / Software display installed patches instfix -ia adding patch instfix -k removing patch installp -r display installed packages lslpp -L all (all filesets) lslpp -L (single fileset) lslpp -w (file belongs) lslpp -ha (history of filesets) rpm -qa (all packages) rpm -q (single package) rpm -qf (file belongs) rpm -qi (very detailed) oslevel -g (install packkages above os level) whereis which_fileset adding package installp -a installp -c (cleanup after failed install) rpm -i geninstall (generic installer: installp, RPM, etc) removing packages installp -u (commited packages) installp -r (applied packages) rpm -e geninstall -u verify package lppchk -v rpm -V List files in package lslpp -f rpm -ql Package directory /usr/lpp /var/lib/rpm List libraries required for binary program ldd Accounts display users cat /etc/passwd lsuser -f ALL (detailed) create a user mkuser useradd remove a user rmuser userdel modify a user chuser -a usermod passwd -f passwd -s chfn chfn change user password passwd pwdadm pwdck -t ALL create a group mkgroup remove a group rmgroup modify a goup chgroup password files /etc/security/passwd useful user commands id whoami who w uptime (displays # of users logged in) finger # License information lslicense chlicense # Maximum number of processes for a user lsattr -D -l sys0 -a maxuproc chdev -l sys0 -a maxuproc= useful group commands groups setgroups lsgroup ALL NFS NFS Daemons server: rpc.mountd, nfsd client: rpc.statd, rpc.lockd NFS files /etc/exports /etc/xtab List nfs clients that have a remote mount /etc/xtab display nfs shares exportfs showmount -e localhost create nfs share mknfsexp -d mknfsmnt shareall uncreate nfs share rmnfsexp -d (unshares and removes from file) exportfs -u unshareall start/change nfs daemons mknfs chnfs startsrc -s nfsd startsrc -s rpc.mountd stop nfs daemons rmnfs stopsrc -s nfsd stopsrc -s rpc.mountd nfs status lssrc -a |grep -i nfs nfs reload exportfs -av nfs performanace nfsstat nfs Options nfso -a nfso -o