Friday, July 4, 2014

Command reference for AIX system admins - very handy for me - try it :)

AIX Administration Command Lists

System and Software Installation Commands

# /usr/bin/tcbck To check if TCB is enabled on your system
# smit alog_show To view logs in the /var/adm/ras directory
# alog –L To view the logs defined in the alog database
# alog -f path of bosinstlog -o To view the content of log file
# alog -o -t boot To view the boot log
# last Shows the previous login and logoffs records from /var/adm/wtmp
# last root console To find when root user login and logoff from console
# last shutdown To determine when system was last shutdown
# /usr/lib/acct/fwtmp </var/adm/wtmp |grep run-level display a history of previous run levels using
# telinit M To change run level

# oslevel To see the current maintenance level of your system
# oslevel –r To see the current maintenance level of your system
# oslevel –s To see the current SP level of your system
# oslevel –sq To see the all SP and maintenance level of your system
# oslevel –g ML To see the greater ML of current ML
# oslevel –rl 5300-07 To see the ML which are less that specified

# cfgmgr –f Configure the devices as a phase 1
# cfgmgr Configure the devices as a phase 2
# cfgmgr –p Configure the devices as a phase 3
# cfgmgr -i /usr/sys/inst.images To find the installation medium to install drivers
# cfgmgr -l scsi0 Specifies the named device to configure along with its children

# bootinfo -s hdiskx It gives the size of the disk
# bootinfo -y System Hardware bit
# bootinfo -K System kernel bit
# bootinfo -p System architecture
# bootinfo -m Shows the memory

# shutdown –Fr To perform a fast shutdown and restart the system

# installp -avX -d/usr/sys/inst.images bos.net To install all filesets within the bos.net
# installp -acpX -d/usr/sys/inst.images bos.net To preview an install of all filesets within the bos.net
# cat /var/adm/sw/installp.summary A record of the installp output can be found
# installp -cgX all To commit all updates
# installp -rBfX ./reject.list To reject all applied updates listed in the file
# installp -ugp -V2 bos.net.ipsec.rte To preview a remove of bos.net.ipsec.rte and its dependents
# installp –C To do a cleanup after a installation failed
# installp -L -d /dev/cd0 To list the software that is on your CD-ROM
# geninstall -d/dev/cd0 R:cdrecord R:mtools To install the cdrecord and mtools open source RPM packages

smitty install_latest. To install software products
smitty install_commit To commit an applied software update
smitty install_reject To reject a service update that you have installed
smitty install_remove Remove installed and committed software
smitty install_software To install open source software
smitty maintain_software To clean up after failed installation
smitty easy_install To install software bundle created

To apply a TL while you are doing clonning
# alt_disk_copy -I acNgXY -P all -b update_all -l /fixpackfs/AIX_fix_packs/5300-08-10-1015 -d hdisk1

smitty alt_mksysb To run an alternate mksysb
smitty alt_clone To run an alternate rootvg on disk

# alt_disk_copy -d hdisk1 To clone a rootvg on hdisk1
# alt_disk_copy -e /etc/exclude.rootvg -d hdisk1 To clone a rootvg on hdisk1 with exclude some of the files
# alt_rootvg_op -X altinst_rootvg To de-clone a rootvg
# alt_rootvg_op -q -d hdisk0 To determine the boot disk for a volume group with multiple PV
# alt_rootvg_op -v alt_disk_530 -d hdisk2 To modify an alt_disk_install volume group name
# alt_rootvg_op -W -d hdisk0 To "wake up" an original rootvg after booting from the new alternate disk
# alt_rootvg_op -S -t To "put to sleep" a volume group that had experienced a "wake-up"
# alt_rootvg_op -d "hdisk3 hdisk4" -b update_all -l /updates To update the alternate rootvg to the latest fileset levels available in /updates and install them into the alternate root volume group

To create a bff image
# gencopy -X -b "-qv" -d /fixpackfs/AIX_fix_packs/5300-09-00-0846 -t /usr/sys/inst.images -f File 2>&1
OR
smitty bffcreate

# lslpp –l To see what maintenance level your filesets
# lslpp –f To list the individual files that are installed with a particular fileset
# lslpp -h bos.sysmgt.trace To list the installation and update history of filesets
# instfix -T -d /dev/cd0 To list fixes that are on a CD-ROM
# instfix -ik IY73748 To determine if APAR IX75893 is installed
# instfix -aik IY73748 To examine information about APAR IX75893 and what it does
# instfix -i | grep ML To list what maintenance levels have been installed
# instfix -k IY73748 -d /dev/cd0 To install APAR IY73748 from /dev/cd0

smitty show_apar_stat Show the apar statistic
smitty update_by_fix. To install the fixes using SMIT
smitty update_all To install all new fixes that are available from IBM

smitty assist To call the Configuration Assistant
smitty alt_install To create alternate installation disk
smitty alt_clone To clone your rootvg to a new disk
smitty alt_mksysb To create the alternate mksysb system


# lppchk -c X11.adt.include Check to ensure all fileset are installed correctly
# lppchk -l X11.adt.include Verifies the symbolic link for filesets
# lppchk –v How to verify if all filesets are correctly installed
# mkitab "xcmd:2:respawn:find / -type f > /dev/null 2>&1" Add a record named xcmd on the /etc/inittab
# lsitab xcmd Show the new record with the lsitab
# rmitab xcmd To delete this record from the /etc/inittab file
# chitab "xcmd:2:once:find / -type f > /dev/null 2>&1" Change the action field on the record xcmd from respawn to once

# bootlist -m normal –o To display a boot list
# bootlist -m normal cd0 hdisk0 To make changes to your normal boot list
# bootlist -m normal -f filename To make changes to your normal boot list using file

# cat /etc/.init.state Identifying the current run level

# odmget -q "type LIKE lv*" PdDv To interrogate ODM PdDv class about all objects
# odmget lpp|head -30 To interrogate the lpp class

Configuration Commands

# mknfs –N To start the NFS daemons immediately
#startsrc -g nfs System Resource Controller to start

smitty mknfsexp To export the directory
smitty rmnfsexp Un-export an NFS directory
smitty mknfsmnt To establish predefined mounts through SMIT
smitty chnfsexp Changing an exported file system

# showmount -e It shows what is exported by current server
# showmount -e servername It shows what is exported by servername
# /usr/sbin/exportfs –a Tells the kernel to reread the exportfs file, that have edited
# exportfs -i /dirname Exporting an NFS directory temporarily
# exportfs -u /dirname Un-export the file system on the server
# umount /backup To unmount an explicitly or automatically mounted NFS

# cat /etc/netsvc.conf The default hostname resolution order specification

smit mkroute To add a route to the private network through the gateway
smit mktcpip To change or set IP addresses

# lsdev -Cc if To identify network interfaces on your server
# ifconfig –a To identify all network interfaces configured on your server
# ifconfig Interface To get information about one specific network interface
# ifconfig tr0 up To activate a network interface using ifconfig
# ifconfig tr0 10.1.2.3 netmask 255.255.255.0 up To activate a network interface and assign IP and netmask
# ifconfig Interface down To deactivate an interface
# ifconfig tr0 delete To delete the network address from tr0
# ifconfig tr0 detach To remove the interface tr0 from the network interface list
# ifconfig tr0 10.1.2.3 mask 255.255.255.0 alias To bind the IP address of 10.1.2.3 to tr0 as a alias
# ifconfig tr0 10.1.2.3 mask 255.255.255.0 delete When this alias is no longer required, you can remove it
# ifconfig en0 mtu 2000 To change the MTU size of tr1

Adding network adapter
# lscfg |grep -i adapter network adapters on your system
# lsdev -Cc if interfaces are already on the system
Shut down and power off the system
Physically install the new network adapter
Power on the system in normal mode
# cfgmgr

Removing network adapter
# ifconfig Interface down Deactivate all network interface definitions for the network adapter
# ifconfig Interface detach Remove (detach) all network interface definitions
# rmdev -l Interface –d Delete the network interface definitions
# rmdev -l Adapter –d Delete the network adapter definition
# shutdown -F now Shutdown the system
Physically remove the network adapter
Power on the system

Smitty chgenet To change the media speed for an Ethernet adapter

# pg /etc/swapspaces All paging related information is listed in this file
# lsps –a To display all info about paging space
# lsps –s To see the total paging space used by system
# chps -s 3 hd6 To increase the size of hd6
# chps -d 1 hd6 To decrease the size of hd6
# migratepv -l hd6 hdisk0 hdisk1 To move the default (hd6) paging space from hdisk0 to hdisk1
# swapoff DeviceName To deactivate paging space
# swapon DeviceName To activate the paging space
# rmps paging03 To removed paging space

Reducing the size of hd6 paging space: this is applicable only on below version 5L
# mkps -a -n -s 30 rootvg hdisk0 Create a temporary paging space on rootvg
# chps -a n hd6 to deactivate the hd6 paging spaces

Change the paging space entry in the /sbin/rc.boot from swapon /dev/hd6 to swapon /dev/paging00

# sysdumpdev –l to check the primary dump device designation
# sysdumpdev -P -p /dev/paging00 change it to some other paging space
# bosboot -d /dev/hdisk0 –a Create a bootable image with the bosboot command
# shutdown –r shutdown the operating system and reboot
# rmps hd6 After the system reboots, remove the hd6 paging space
# mklv -t paging -y hd6 rootvg 30 Create a new paging space LV of the size 120 MB for the hd6
# sysdumpdev -P -p /dev/hd6 Change the primary dump device designation

Change the paging space entry in the /sbin/rc.boot file from swapon /dev/paging00 to swapon /dev/hd6

# bosboot -d /dev/hdisk0 –a Create a bootable image with the bosboot command
# chps -a y hd6 to make the new hd6 paging space automatically activate when reboot
# shutdown –r Reboot the system
# rmps paging00 After the system reboots, remove the temporary paging space

# lsdev -P –H To list all devices in the Predefined Devices object class
# lsdev -C –H To list all the devices in the Customized Devices object class
# lsdev -C -c adapter -S a To list the adapters that are in the Available state
# lsdev -P -r class To list all the classes of supported devices on your system
# lsdev -C -c disk To show the disk drives on your system

# lscfg To display the system configuration
# lscfg -v -p -l rmt0 To display the VPD for about rmt0
# lscfg -v -p -l ent2 To obtain the physical location and firmware version of eth0

# lsattr -l rmt0 –D To list the default attribute values for the tape device rmt0
# lsattr -l rmt0 -E To list the current attribute values for the tape device rmt0
# lsattr -l scsi0 -a bus_intr_lvl –E To list the current value of the bus_intr_lvl attribute
# lsattr -l scsi0 -a bus_intr_lvl –D To list the default value of the bus_intr_lvl attribute

# chdev -l ent0 -a media_speed=100_Full_Duplex -P Change the media_speed forcefully to 100_Full_Duplex
# chdev -l ent0 -a media_speed=Auto_Negotiation Change to auto negotiate for speed duplex

# mkdev -l rmt0 To make the predefined rmt0 tape device available to use

# rmdev -l rmt0 To make available rmt0 to defined state
# rmdev -dl rmt0 To unload the device configuration from the ODM
# chdev -l rmt0 -a attr=value To change the attribute of the rmt0 device
smitty devices Smit screen to configure devices
smitty chdev Smit screen to change device attribute
smitty rmdev Smit screen to remove the device configuration from ODM

# lssrc -a List all services and their status
# startsrc -g Start network service group
# startsrc -s Start network service subsystem
# stopsrc -g Stop network service group

# /usr/lib/errdemon To start the error daemon
# /usr/lib/errdemon –l To determine the path to your system's error log file
# /usr/lib/errdemon -s 2000000 To change the maximum size of the error log file
# /usr/lib/errdemon -B 16384 To change the size of the error log device driver's

# errpt To display a complete summary report of the errors
# errpt –a To display a detailed report of all the errors encountered
# errpt -a -j E19E094F To display a detailed report of all errors logged error identifier E19E094F
# errpt -a -s 0828093001 Displaying the errors by time reference
# errlogger Testing use of errlogger command To log operator messages to the system error log
# errclear 0 Deletes all entries from the error log
# errclear -d S 0 To delete all entries in the error log classified as software errors
# errinstall Installs messages in the error logging message sets
# errupdate Updates the Error Record Template repository

# bindprocessor –q Query the available processors
# smtctl -m off -w now To turn off simultaneous multithreading immediately
# smtctl -m on -w boot To turn on simultaneous multithreading after the next reboot

# chdev -l hdisk7 -a pv=yes Assigning a PVID to a physical volume
# chdev -l hdisk7 -a pv=clear Clears the PVID from the physical volume

Reconfiguring a system from a 32-bit to a 64-bit kernel
To identify the type of system hardware you have, either 32-bit or 64-bit, execute the bootinfo -y command. If the command returns a 32, you cannot use the 64-bit kernel.64-bit kernel information stored in the /usr/lib/boot.
unix_mp 32-bit kernel for multiprocessor systems
unix_64 64-bit kernel for 64-bit processor systems

# ln -sf /usr/lib/boot/unix_64 /unix
# ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
bosboot: Boot image is 23137 512 byte blocks.
# shutdown -r
# ls -al /unix
lrwxrwxrwx 1 root system 21 Nov 11 11:30 /unix -> /usr/lib/boot/unix_64

Logical Volume Management Commands

# lspv hdisk2 To display detailed information about a physical volume
# lspv -l hdisk0 To display the names of all the lv that have at least one partition on pv
# lspv -p hdisk0 To display the allocation of PPs to logical volumes
# lspv -M hdisk0|more To display the layout of a physical volume
# chpv -an hdisk2 Disabled the ability to allocate new free physical partitions
# chpv -ay hdisk2 To turn on the allocation permission
# chpv -vr hdisk3 Makes hdisk3 unavailable
# chpv -va hdisk3 Makes hdisk3 available again
# chpv -c hdisk1 To clear the boot record located on physical volume hdisk1
# chpv -hy hdisk3 To define hdisk3 as a hot spare
#chpv -hn hdisk3 To remove hdisk3 from the hot spare pool
# migratepv hdisk1 hdisk5 Migrates the data from hdisk1 to hdisk5
# migratelp testlv/1/2 hdisk5/123 Migrates the data from the second copy of the logical partition number 1 of logical volume to hdisk5 on physical partition 123.
# lquerypv -M hdisk0 To find the LTG size for a physical disk

# lsvg To display all volume groups known to a system
# lsvg –o To display all active volume groups
# mkvg -y vg1 -s64 -V99 hdisk4 Creating an original volume group
# mkvg -B -y vg2 -s 128 -f -n -V 101 hdisk6 Creating a big volume group
# mkvg -S -y testvg -s 1 -f hdisk3 hdisk4 hdisk5 Creating a scalable volume group
# lsvg testvg To display details about a specific volume group
# lsvg -l rootvg To display logical volumes contained in a volume group
# lsvg -p test1vg To display all physical volumes contained in a volume group
# chvg -ay newvg Testvg to be activated automatically the next time the system is restarted
# chvg -an newvg Not be activated automatically next time the system is restarted
# chvg -Qn testvg To turn off the quorum
# chvg -Qy testvg To turn on the quorum
# chvg -hn test1vg Changes the hot spare policy of the volume group
# chvg -sy test1vg Changing synchronization policy of a volume group
# chvg -hy test1vg Changes the hot spare policy of the volume group
# chvg -hn test1vg Changes the hot spare policy of the volume group to no
# chvg -t 16 testvg Change the maximum number of physical partitions per physical volume
# chvg -G db2vg Changing a volume group format
# chvg -L 128 testvg Change the LTG size for the testvg volume group
# chvg -P 2048 testvg Changing the maximum number of physical partitions
# chvg -v 4096 testvg Changing the maximum number of logical volumes
# chvg –u Remove the lock of volume group
# extendvg test1vg hdisk7 Extend a volume group with hdisk7
# extendvg -f test1vg hdisk4 Extend a volume group with hdisk4 forcefully
# reducevg testvg hdisk7 Reduce volume group with hdisk7
# reducevg -d testvg hdisk7 Reduce volume group with hdisk7 forcefully
# synclvodm testvg To synchronize ODM to contain the latest LVM information for VG
# exportvg testvg To export the volume group testvg
# importvg -y testvg hdisk7 Import volume group testvg using hdisk7
# varyoffvg testvg Varyoff volume group
# varyonvg testvg Varyon volume group
# syncvg -p hdisk4 hdisk5 To synchronize the copies located on pv hdisk4 and hdisk5
# syncvg -v testvg To synchronize the all physical partitions from volume group testvg
# mirrorvg rootvg To mirror a rootvg on another disk

Mirroring a rootvg
# bootinfo –s hdisk1 To check the size of disk
# bootinfo –s hdisk0 To check the size of disk
# extendvg rootvg hdisk1 To add a new disk to rootvg
# Mirrorvg rootvg hdisk1 To mirror a rootvg on hdisk1
# bosboot –ad /dev/hdisk1 To create boot logical volume on hdisk1
# bootlist –m normal hdisk0 hdisk1 To set the bootlist


# splitvg -y newvg -c 1 test1vg To split a volume group
# joinvg test1vg To rejoin the two copies of the volume group test1vg

# lslv lv1 To display details about a specific logical volume
# lslv -l lv1 Displays a LV on which disk and In Band policies
# lslv -m lv1 To display LPs and PPs number
# mklv -y lv3 -t jfs2 -a im test1vg 10 hdisk5 Create a logical volume
# extendlv lv05 3 Extend a logical volume with 3 PP
# rmlv lv7 Remove a logical volume
# rmlv -f lv1 Remove a logical volume without confirming
# chlv -x 1000 lv1 Sets the maximum number of logical partitions allocated to LV

# cplv -v dumpvg -y lv8 lv1 To copy LV lv1 to the dumpvg volume group under the name of lv8
# mklvcopy -k lv1 3 hdisk7 & To create and synchronize extra copies of logical partitions
# splitlvcopy -y copylv testlv 2
# rmlvcopy testlv 2 hdisk6


File System Commands

# crfs -v jfs -g testvg -a size=10M -m /fs1 Creating file systems without specifying logical volumes
# crfs -v jfs2 -d /dev/testlv -a logname=loglv01 -m /test -a size=130M Creating file systems on previously defined LV
# mount /dev/fslv02 /testfs Mount a file system
# mount Show all mounted file systems
# lsfs –a Show all file systems
# rmfs /test Remove the file system
# chfs -a size=250M /fs2 Change the size of file system
# fsck -y /dev/hd1 File system consistancy check
# logform /dev/loglv01 To format loglv01 once it has been created
# defragfs /home Increases a file system's contiguous free space
# istat /etc/passwd Inode statistics for file

Restoring the backup of the superblock over the primary superblock
# dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00

# find /home -type d -exec fuser -u {} \; If cannot umount filesystem

Backup Commands

# mksysb -i /dev/rmt0 To generate a system backup and create an /image.data file
# mksysb -i -e /dev/rmt1 Generate backup with excluded files
# lsmksysb List the content of mksysb of tape drive
# lsmksysb -f /dev/cd1 List the content of mksysb of CD
# restorevgfiles -r -f /dev/rmt0 ./tmp/zabbix_agentd.log To restore a file from mksysb file
# savevg -f /dev/$rmt -i sapvg1 To take backup of user VG
# restvg -f /dev/rmt1 hdisk2 hdisk3 To restore the volume group image from the /dev/rmt1 device
# restvg -l -f /dev/rmt0 To display volume group information from tape

# mkcd -d /dev/cd1 To make the mksysb using the mkcd

smitty mksysb smit panel for mksyb
smitty lsmksysb smit panel to list mksysb
smitty restmksysb to restore only several files from the mksysb image
smitty savevg To take backup of user VG
smitty restvg To restore a user VG backup

# find /home -print | backup -i -f /dev/rmt0 To back up all the files and subdirectories in the /home
# backup -0 -u -f /dev/rmt0 / All files are backup from /
# backup -1 -u -f /dev/rmt0 / Backup files that have been modified since the last level 0
# restore -rvqf /dev/rmt0 To restore an entire file-system archive
# restore -xdvqf /dev/rmt0 /home/mike/tools To restore a specific directory and the contents
# restore -xvqf /dev/rmt0 /var/mydirectory To restore a specific directory from a file-system archive
# tar -cvf /dev/rmt0 /var/mydirectory To create an archive of /var/mydirectory
# tar -xvf /dev/rmt0 /var/mydirectory To restore that directory
# tar -tvf /dev/rmt0 /var/mydirectory To view the contents of the archive
# tar -xm -f/dev/rmt0 /var To extract the contents of certain directories
# gzip -d -c archiv.tgz | tar xvf - Extract a compressed tar archive under AIX
# cpio -ov path /dev/fd0 To copy files onto diskette
# tcopy /dev/rmt0 To verify an mksysb image integrity
# bootinfo -e It makes sure that boot from tape is enable


Secirity Commands

# chsec -f /etc/security/user -s default -a mindiff=4 Change Security Attribute in a file
# lssec -f /etc/security/user -s default -a mindiff List Security attribute in a file
# chuser su=true sugroups=system root Change users attributes
# chrctcp -d mrouted Disabled the daemon from /etc/rc.tcpip
# chsubserver -r inetd -C /etc/inetd.conf -d -v 'telnet' -p 'tcp6' Diseabled the telnetd from inetd.conf file
# chmod ugo= /usr/bin/rcp To remove all permissions on the remote services
# chmod ugo= /usr/bin/rlogin To remove all permissions on the remote services
# no -p -o ipignoreredirects=1 System will not process IP redirects. Changes network options
# chssys -s syslogd -a "-r" This does not allow a syslog messages from other host
# chssys -s syslogd -a "" Remove the suppression of remote syslog messages
# /usr/dt/bin/dtconfig -d Disable CDE start up
# /usr/dt/bin/dtconfig -e To re-configure the auto-start of the CDE
# visudo -c Validate the visudo syntax


Miscelanious
# mkcd -L -S -I /iso-images -m /var/backups/mksysb.obj Create a bootable DVD image from an mksysb
# kdb. To analyze a dump
# genkex | grep 'ext$' Display all actually loaded kernel extensions
# lsmcode List the firmware level of a p5 system
# snap -gfiLGc Create a snap suitable for IBM support
# lparstat -i LPAR statistics
# topas -C Statistics about all LPARs sharing the same resources
# chdev -l inet0 -a route=net,-hopcount,0,,0,192.168.1.1 To set a static route
# chdev -l inet0 -a delroute=net,-hopcount,0,,0,192.168.1.1To remove these specific static routes
# emgr -l Get a list of all installed efixes with
# emgr -e <EFIX>.epkg.Z To apply an efix or ifix
# emgr -r -L <LABEL> To remove an efix from the system
# lqueryvg -Atp hdisk100 Read out the VGDA of a PV
# redefinevg -d hdisk100 myvg To synchronize the ODM w ith the VGDA of another disk
# synclvodm myvg To synchronize the ODM w ith the VGDA
# ipl_varyon -i Find all hdisks containing an AIX boot signature
# fcstat fcs0 Statistics of an HBA






AIX 6.1 Additional Commands

# mkwpar –n mywpar To create a system WPAR whose name is mywpar
# lswpar To list all define wpar
# startwpar mywpar To start the wpar
# clogin mywpar Do a console login to a wpar
# stopwapr mywpar To stop wpar
# wparexec –R attribute=value To set the application wpar attribute value at time of creation
# mkwpar –R attribute=value To set the system wpar attribute value at time of creation
# chwpar –R attribute=value To change the attribute value for system wpar
# wlmstat To check the statistic of wpar

# wparexec -n myappwpar /usr/bin/sleep 100 & To create a pplication wpar named myappwpar

# efsenable -a To enable EFS in AIX
# cd /var/efs ; ls To see directories created to facilitate EFS
#crfs -v jfs2 -g rootvg -m /sales -a size=100M -a efs=yes EFS creating through command line
# mkuser salesman Creating keystore for users
# efskeymgr -C sales Keystore creation for group
# cd /var/efs/group ; ls To check the keystore for group
# mount /sales Mount the FS
# mkdir YearlyReport Create a dir in sales FS
# efsmgr -E YearlyReport
# efsmgr -L YearlyReport
# cd YearlyReport
# efskeymgr -o ksh Load EFS keystore to shell
# touch file1 Create a sample fiel in yearlyReport
# ls -U file1 To see encrypted files in EFS
# efsmgr -l file1 List the encrypted file attribute
# efsmgr -a file1 -g sales granting access to a group
# efsmgr -r file1 -g sales Revoking access to group

# sanpshot -o snapfrom=/fs -o size=128M To create External sanpshot for fs
# snapshot -q /fs Query the fs snapshot
# snapshot -o size=+1 /dev/fslv08 Increase the size of snapshot dynamically
# snapshot -o size=-1 /dev/fslv08 Decrease the size of snapshot dynamically
# mount -v jfs2 -o snapshot /dev/fslv08 /mnt/snapfs mount the sanpshot to see the usages
# snapshot -d /dev/fslv08 Delete the sanposhot
# rollback -v /lpar2rrd /dev/fslv08 To revert to previous snapshot

# crfs -vjfs2 -d cglv -m /cg -A yes -a isnapshot=yes To create FS with internal snapshot
# snapshot -o snapfrom=/cg -n cgsnap1 create a internal snapshot for fs
# snapshot -q /cg Query the internal snapshot
# rollback –v -n cgsnap1 /cg To get back to the previous snapshot
# snapshot -d -n cgsnap1 /cg To delete the internal snapshot



Network Installation Manager Commands


# lsnim Listing all define NIM objects
# lsnim -t lpp_source Listing all defined objects of a specific type
# lsnim -l LPP_53_ML4 Showing an object's definition
# lsnim -c networks List the nim information according to network class
# lsnim -O machinename To check what operation we can perform on machines
# lsnim -L machinesname To display a list of resources available to machines
# cat /etc/niminfo Nim master or client information

# nimconfig -r To rebuild the NIM master /etc/niminfo file
# niminit -a master=master -a name=client To rebuild and recover a NIM client /etc/niminfo file

# nim –o allocate -a spot=spot1 PRDAPP1 To allocated the resources to machnie
# nim -o check myspot To have NIM check on the usability of a SPOT named myspot
# nim -o lppchk spot1 To check fileset version and requisite consistency on the SPOT spot1
# nim -o remove dump_files To remove a resource named dump_files
# nim -o remove LPAR55 Removing a NIM client definition
# nim -o showres script1 To show the contents of the config script script1
# nim -Fo reset CIMcsddev To reste the client state
# nim -Fo reset resource To reset the client resource

# export NIM_MKSYSB_SUBDIRS=yes To create subdirectories during NIM mksysb creation

# nim -o allocate -a spot=spot1 -a lpp_source=images krakatoa To allocated the resources to machnie
# nim -o update -a packages=all -a source=/dev/cd0 lpp_source1 To add all the filesets of /dev/cd0 to lpp_source1
# nim -o deallocate -a lpp_source=images client1 Deallocate an lpp_source from the client1
# /usr/lpp/bos.sysmgt/nim/methods/m_backup_db /tmp/nimdb_backup Backing up a NIM master configuration

# alog -f /usr/adm/ras/nimlog -o alog command to view the nimlog file


NIM Filesets: Master--->bos.sysmgt.nim.master bos.sysmgt.nim.spot bos.sysmgt.nim.client
Client---->bos.sysmgt.nim.client bos.sysmgt.nim.client

smitty install_latest To install NIM filesets
smitty nimconfig To configure selected machine as nim master
smitty nim_mkres To configure nim basic resources
smitty nim_mkmac To define the client
smitty nim_task_inst To start the client installation
smitty nim_list_install_sw Check the result of the installation through rte


bootps : Bootstrap Protocol Server
tftp : Trivial File Transfer
# echo "status"|tftp 0 To check that the tftpd daemon is working

Required file system for NIM master
# crfs -v jfs2 -g rootvg -a size=64M -m /tftpboot -A yes -p rw -a logname=INLINE
# crfs -v jfs2 -g rootvg -a size=4G -m /export/lpp_source -A yes -p rw -a logname=INLINE
# crfs -v jfs2 -g rootvg -a size=1G -m /export/spot -A yes -p rw -a logname=INLINE
# crfs -v jfs2 -g rootvg -a size=6G -m /export/images -A yes -p rw -a logname=INLINE


Configuring NIM Master using nimconfig command
# nimconfig -a netname=net_10_1_1 -a pif_name=en0 -a netboot_kernel=mp -a cable_type=tp -a client_reg=no

To define lpp_source and copy filesets from cd0
# nim -o define -t lpp_source -a server=master -a location=/export/lpp_source/lpp5300 -a source=/dev/cd0 lpp5300

Creating a non-/usr SPOT from a nim lpp_source
# nim -o define -t spot -a server=master -a location=/export/spot -a source=lpp5300 -a installp_flags=-aQg spot5300

Create a standalone NIM client
# nim -o define -t standalone -a platform=chrp -a if1="net_10_1_1 lpar55 0 ent0" -a cable_type1=tp -a netboot_kernel=mp LPAR55
or
# nim -o define -t standalone -a if1="net_10_54_145 PRDAPP2 0 ent0" PRDAPP2

Creating a NIM mksysb resource
# nim -o define -t mksysb -a server=master -a source=CIMCSDDEV -a mk_image=yes -a location=/mksysb_backup/CIMCSDDEV-29Jan2012 mksysb_CIMCSDDEV
Modifying a client definition
# nim -o change -a <attribute>=<value> <client>
# nim -o change -a netboot_kernel=mp <client>
Re-initializing a client
# rm /etc/niminfo
# niminit -a master=<MASTER_HOSTNAME> -a name=<CLIENT_NIM_NAME>
Installing a client
# nim -o bos_inst -a spot=spot5300-08 -a lpp_source=lpp5300-08 -a fb_script=script -a script=postinstall_script -a no_client_boot=yes -a accept_licenses=yes LPAR55
Installing a client with an MKSYSB image
# nim -o bos_inst -a source=mksysb -a spot= spot5300-08 -a mksysb=mksysb_LPARtest -a lpp_source=lpp5300-08 -a fb_script=script -a script=postinstall_script -a no_client_boot=yes -a accept_licenses=yes LPAR6
Reset a NIM client
# nim -F -o reset <client>
# nim -o deallocate -a spot=<spot> -a ...=... <client>
# nim -o deallocate -a subclass=all <client>
Enabling a maintenance boot
# nim -o maint_boot -a spot=<spot> <client>
Start an Alternate Disk Migration
# nimadm -c client1 -l lpp source -s spot -d hdisk -Y
or
# nimadm -j nimadmvg -c aix1 -s spotaix61031 -l lppsourceaix61031 -d "hdisk1" –Y
Where:
–j flag specifies the VG on the master which will be used for the migration
-c is the client name
–s is the SPOT name
-l is the lpp_source name
-d is the hdisk name for the alternate root volume group (altinst_rootvg)
–Y agrees to the software license agreements for software that will be installed during the migration.

VIO server Commands

# oem_setup_env To become a root
# alias i=/usr/ios/cli/ioscli By default ioscli command is not available for root user
# i lsmap -all So that root user xcan run the ioscli command
# help List all ios commands
# help command Gives detail help of particular command
# ioslevel To check the IOS version
# updateios -dev /mnt/iosfixes -accept To apply IOS fixes
# shutdown -restart To reboot the VIO server
# lspv -free To list unmapped disks
# lspv -free | grep vpath To list unmapped disks if using vendor specific device driver

# cfgdev To configure the devices

# rmdev -dev cd0 To unconfigure the cd0 CD-ROM device
# rmdev -recursive -dev scsi1 To unconfigure the SCSI adapter scsi1 and all of its children
# rmdev -pdev scsi1 Unconfigure just children of the SCSI adapter scsi1, but not adapter itself

# mkvdev -vdev lv20 -vadapter vhost0 Create virtual device that maps the lv20 a virtual disk vhost0
# mkvdev -vdev hdisk6 -vadapter vhost2 -vtd name Map the hdisk6 to vhost2
# mkvdev -vdev rmt0 -vadapter vhost2 Map the tape rmt0 to vhost2
# mkvdev -sea ent4 -vadapter ent6,ent7,ent9 -default ent6 -defaultid 8
Create SEA that map physical EA ent4 as VEA for the client partitions served by the virtual Ethernet adapters ent6, ent7, and ent9, using ent6 as the default adapter and 8 as the default ID

# rmvdev -dev vtdiskname Unassigned a disk or lv from a virtual SCSi host adapter
# lsnports List NPIV capable port

# vfcmap -vadapter vfchost7 -fcp fcs0 To map virtual FC, vfchost7, to the physical FC port fcs0
# vfcmap -vadapter vfchost7 -fcp To unmap virtual FC vfchost7, from any physical FC port


# license -view To view the license in the en_US locale
# license To view if the license has been accepted
# license -accept -lang fr_FR To accept the license in the fr_FR locale
# hostmap -ls To list all host entries in the database
# hostname Sets or displays the name of the current host system

# lstcpip -stored To list the Virtual I/O Server TCP/IP configuration
# lstcpip -routtable To list the current routing table
# lstcpip -interfaces To display all interface information

# mktcpip -hostname name -inetaddr <IP> -interface en0 -nsrvaddr <NSIP> -nsrvdomain domain-start
To set the required values for starting TCP/IP
# chtcpip -interface en0 -inetaddr 9.1.1.1 -netmask mask To changes the current network address and mask
# chtcpip -interface en0 -gateway -add 9.2.3.4 -remove 9.1.2.3 To changes the default gateway from 9.1.2.3 to 9.2.3.4

# rmtcpip -all To remove all Virtual I/O Server TCP/IP configuration
# rmtcpip -f -interface en0 To unconfigure a network interface en0 without confirmation
# rmtcpip -f -routing To cleanup the static routing table
# rmtcpip -f -interface en0 -nextboot To remove IP information from a network interface on the next boot, keeping the current configuration running execute

# netstat -routtable To display routing table information
# netstat -state To display interface information
# netstat -socket To display network sockets

# seastat -d sea0 To display Shared Ethernet Adapter statistics for sea0
# seastat -d sea0 -c To clear the Shared Ethernet Adapter statistics for sea0

# startnetsvc telnet To start the telnet daemon (network service daemon)
# stopnetsvc telnet To stop the telnet daemon (network service daemon)

# mkvt -id 3 Create a virtual terminal connection to the partition with ID 3
# rmvt -id 3 To close a virtual terminal connection to the partition with ID 3

# lsdev | grep keyword Gives the list of devices of keyword match

# lsmap -vadapter vhost2 To list all virtual target devices and backing devices mapped vhost2
# lsmap -vadapter ent4 -net To list the SEA and backing device mapped to the Ethernet adapter ent4
# lsmap -all -npiv List Virtual fiber channels
# lsmap -all -net To list shared ethernet adapter
# lsmap -all To list all disk mapping
# mirrorios -force hdisk4 mirror the vio roovg vio to hdisk4
# unmirrorios hdisk4 unmirror the vio rootvg

# alt_root_vg -target hdisk2 -bundle my_bundle -location /tmp/update Create copy of rootvg on hdisk2 & install bundle
# backupios -cd /dev/cd1 -cdformat To generate a backup to the optical device named /dev/cd1
# backupios -tape /dev/rmt0 To generate a system backup to a tape device named /dev/rmt0
# backupios -file filepath To generate a system backup to a file
# bootlist -mode service -rm To invalidate the Service mode boot list
# bootlist -mode normal hdisk0 hdisk1 rmt0 To set bootlist in normal mode
# diagmenu Places the user into the diagnostic menus
# errlog -ls To display a complete detailed error report
# errlog -rm 5 To delete error-log entries older than 5 days
# errlog -rm 0 To delete all error-log entries
# lslparinfo Displays the logical partition number and name
# viostat VIO statistic
# lssvc Lists the available agents and services
# startsvc Starts the agent or service that is specified
# stopsvc Stop the agent or service that is specified


Installing the VIO Server using the HMC
Before Installing the VIO server code, you need to know the metwork configuration data for the server
  1. Insert the VIO server CD or DVD into HMC DVD drive
  2. Enter installios on the HMC command Line Interface to invoke the installios wizard where you can install the VIO server code by answering the prompts
  3. Alternatively, the command listed below will install the code without the wizard prompts. The -n option tells the the installation not to configure the network interface. You will do that manually.
  4. When the installation complete, open a terminal window to the partition on the HMC
  5. Log in as padmin user and choose a new password.
  6. Before using VIO server, you must accepts the Licence
  7. To view Licence, Enter licence -ls at the command line
  8. To accept the licence, Enter licence -accept


HMC Commands

# lshmc -v To check HMC version
# lshmc -n Network configuration of the HMC
# hmcshutdown -t now -r Reboot the HMC
# chhmcusr -u hscroot -t passwd To change the HMC password
# monhmc -r disk -n 0 Show Available Filesystem Space
# lssyscfg -r sys -F name:serial_num:state LPAR Status symtax
# lssyscfg -m pserver -r lpar -F name:state LPAR status of machine pserver
# lspartition -dlpar Overview DLPAR status
# mkvterm -m pserver -p mylpar To get virtual console
# rmvterm -m pserver -p mylpar If console is active, you can close it
# vtmenu Start the virtual terminal menu

# chsysstate -r lpar -m pserver -o on -f myprofile -n mylpar Activation of an LPAR

# chsysstate -o on -r sys -n pserver -c full Power on a System Running in Manage system

# chsyscfg -r lpar -m pserver -i "name=barney,new_name=mylpar1" Change an LPAR's Name

# chsyscfg -r sys -m pserver -i "new_name=pserver1" Rename a Managed System

# chhwres -r proc -m pserver -o a -p mylpar --procunits 8 Increase Number of Proc Units of an LPAR

# lshwres -r io -m pserver --rsubtype slot --filter -F lpar_name:drc_name:description Show a List of All I/O Adapters

# lssyscfg -r lpar -m pserver -F lpar_id:name:serial_num:state Overview LPAR IDs

No comments:

Popular Posts

Is this site helping you ?