Professional Documents
Culture Documents
To remove or replace physical volumes in a volume group for maintenance purposes, use SMIT or the
chpv command.
# reducevg <VGname> <PVname>
# rmdev -dl hdisk<n>
Mirroring rootvg
If you do not mirror the root volume group, you have a single point of failure. Always mirror rootvg! I
have seen too many unnecessary system rebuilds because rootvg was not mirrored. Mirroring rootvg is
a straightforward process and consists of the following steps, in which we are going to mirror rootvg to
a new disk called hdisk1:
1. Add hdisk1 to the rootvg for mirroring:
# extendvg rootvg hdisk1
2. Use this command if all the rootvg logical volumes were created properly:
# mirrorvg rootvg
3. Or (if a problem was encountered) manually mirror rootvg and do not mirror the dump device (lv00
in example):
# lsvg
# lsvg -l rootvg
# lsvg rootvg
4. Mirror each logical volume:
# for N in $(lsvg -l rootvg | grep syncd | awk '{print $1}' | grep -v lv00)
> do
> echo $N
> mklvcopy $N 2
> done
5. Sync the volume group:
# syncvg -v rootvg
# lsvg -l rootvg
6. Configure the boot devices:
# ipl_varyon -i
PVNAME BOOT DEVICE PVID VOLUME GROUP ID
hdisk0 NO 00001047375ac230 000010472822f021
hdisk1 YES 000010472822e532 000010472822f021
# bosboot -a -d /dev/hdisk0
bosboot: Boot image is 6955 512 byte blocks.
# ipl_varyon -i
PVNAME BOOT DEVICE PVID VOLUME GROUP ID
hdisk0 YES 00001047375ac230 000010472822f021
hdisk1 YES 000010472822e532 000010472822f021
The mirrorvg command does all of the mklvcopy commands under the covers for you. Since disk
quorum was disabled, we must reboot the system for the changes to take effect.
# shutdown -r now
FS COMMANDS
lsfs Lists all filesystems in the /etc/filesystems 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 -a size='+1024M' /usr Add 1GB space to FS /usr
chfs -m /si /bi Change the mount point from /si to /bi
chfs -A /si To auto mount the filesystem si
chfs -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 mode
crfs -v jfs -g testvg -a size=64465 -m /siju Creates FS /siju of type jfs in VG testvg of blocksize
64465
crfs -v jfs -g datavg -a size=10M -m /oracle Creates FS /orzcle of type jfs in VG datavg of 10MB
crfs -v jfs -d /dev/lv00 -m /siju Create FS /siju of type jfs on device /dev/lv00
rmfs /siju Deletes FS /siju and associated LV
rmfs -r /siju Deletes FS /siju its mount point and associated LV
defragfs /sifs To defragment the file system /sifs
defragfs -q /sifs Display the current defrag status of the file system
fsck -y n /dev/lv00 To fsck the filesystem associated to /dev/lv00 assuming response "yes"
fsck -p /dev/lv00 To restore superblock from backup superblock
PV COMMANDS
lspv hdisk0 Display status and characteristics of the PV
lspv -p hdisk0 Display PP usage of hdisk0
lspv -l hdisk0 To list all logical volumes on PV hdisk0
chpv -v r hdisk1 Close the PV (Used while removing PV without varyon)
chpv -v a hdisk1 Open the PV
chpv -c hdisk0 Clear the master boot record on PV hdisk0
migratepv hdisk1 hdisk2 To move PPs from PV hdisk1 to hdisk2
migratepv -l silv hdisk1 hdisk2 To migrate LV silv from PV hdisk1 to hdisk2
LV COMMANDS
lslv -l lv00 Display info about LV by PV
lslv -p hdisk1 Display LV allocation map for hdisk1
chlv -t copy lv00 To change the lv00 to copy type
chlv –n silv lv00 To rename lv00 to silv
chlv -p r lv00 To change the lv00 to readonly mode
rmlv silv To remove silv
rmlv -f silv To remove silv without user intervention
mklv -s n -c 3 silv hdisk1 To make LV silv with three copies on hdisk1
extendlv silv 5 To extend the LV silv with 5 LPs
mklvcopy -s n lvsi 2 hdisk1 To mirror LV lvsi on same PV with 2 copies
mklvcopy lvsi 3 hdisk1 hdisk2 To mirror LV lvsi on PV hdisk1 and hdisk2 with 3 copies
rmlvcopy 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 2LPs
logform /dev/log00 To format jfslog volume log00
BLV COMMANDS
bootlist -m normal -o To see the boot sequence in normal mode
bootlist -m service -o To see the boot sequence in service mode
bootlist -m normal cd0 hdisk0 To change boot sequence to cd0,hdisk0 in normal mode
bootlist -m service cd0 rmt0 hdisk0 To change boot sequence to cd0,rmt0,hdisk0 in service mode
bosboot -ad /dev/hdisk1 To create boot image on PV hdisk1
mkboot -cd /dev/hdisk1 To clear the boot image
bootinfo -b Specifies the bootable disk
bootinfo - t Specifies the type of boot
1 Disk boot
3 CD-ROM boot
4 Tape boot
5 Network boot
bootinfo -e Check the machine can boot from tape
bootinfo -T To see the machine hardware type
bootinfo -s hdisk0 To see the size of hdisk0
bootinfo -r To see the size of memory in KB
bootinfo –k To see the key position (1 Secure, 2 Service, 3 Normal)
bootinfo –m To see the machine model code
bootinfo –o hdisk0 To list the location code of hdisk0
bootinfo –z To see the machine is MP capable (0 – Not Capable, 1 – Capable)
bootinfo –p To find out if the machine can run 64-bit kernel
(Returns the string "32", if executed on a machine that is only capable
of running the 32-bit kernel. The command returns "chrp", if the
machine is capable of running the 64-bit kernel or the 32-bit kernel)
bootinfo –K or prtconf –k To find out the currently enabled kernel mode
(Returns "32" if the 32-bit kernel is enabled, and "64" if the 64-bit
kernel is enabled.)
bootinfo -y command will identify the type of system hardware you have, either
32-bit or 64-bit. If the command returns a 32, you cannot use the 64-bit
kernel.
# prtconf -k
Kernel Type: 32-bit
If 64-bit:
LANG=en_US
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_MESSAGES="en_US"
LC_ALL=
If 32-bit:
lrwxrwxrwx 1 root system 21 Mar 25 2002 /unix@ -> /usr/lib/boot/unix_mp*
lrwxrwxrwx 1 root system 21 Jul 10 16:48 /unix -> /usr/lib/boot/unix_up
If 64-bit:
rwxrwxrwx 1 root system 21 Jun 04 2002 /unix@ -> /usr/lib/boot/unix_64*
If 32-bit :
oracle: executable (RISC System/6000) or object module not stripped
If 64-bit :
oracle: 64-bit AIX executable or object module not stripped
How to Change Kernel Mode of IBM AIX 5L (5.1) for more information.
There are three kernels available in the /usr/lib/boot directory:
• unix_up 32-bit kernel for uniprocessor systems
• unix_mp 32-bit kernel for multiprocessor systems
• unix_64 64-bit kernel for 64-bit processor systems
The following example provides the commands to run to enable the 64-bit kernel after system installation:
# ln -sf /usr/lib/boot/unix_64 /unix
# ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -r
After the system has rebooted, it will be running the 64-bit kernel. To reactivate the 32-bit kernel, follow the same
procedure, substituting unix_up or unix_mp for unix_64, depending on your system type.
# lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type
paging00 hdisk0 rootvg 512MB 1 yes yes lv
hd6 hdisk0 rootvg 512MB 0 no no lv
# lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type
paging00 hdisk0 rootvg 512MB 0 no no lv
hd6 hdisk0 rootvg 512MB 1 yes yes lv
# sysdumpdev -P -p /dev/hd6
primary /dev/hd6
secondary /dev/sysdumpnull
copy directory /var/adm/ras
forced copy flag TRUE
always allow dump FALSE
dump compression ON
# rmps paging00
# lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type
hd6 hdisk0 rootvg 512MB 1 yes yes lv
#
SYSTEM DUMP COMMANDS
sysdumpdev -l To list the current dump destination
sysdumpdev -L List the details of the previous dump
sysdumpstart -p Starts dump in the primary dump device
sysdumpstart -s Starts dump in the secondary dump device
sysdumpdev -p /dev/lv00 To make lv00 as primary dump device
sysdumpdev -P -p /dev/lv00 To make lv00 as primary dump device permanently
sysdumpdev -s /dev/rmt0 To make rmt0 as secondary dump device
sysdumpdev -z To determine a new system dump occurred
Device related commands
cfgmgr To configure devices and installs device software in system
cfgmgr -l vscsi0 To configure the components connected to the vscsi0 interface
lscfg To display config, diagnostics and vital product definition info
lscfg -l mem0 Display info about device mem0
lscfg -l ent* Display info about all Ethernet cards
lscfg -v Display vpd
lscfg -v -l hdisk0 Display vpd of hdisk0
lscfg -vp |grep -e "Memory DIMM" -e "Size" DIMMs Details
mkdev -l rmt0 To change device rmt0 from defined state to available state
lsdev -P To lists all supported devices
lsdev -P -c disk To list all supported disks
lsdev -P -r class To display supported class
lsdev -P -r subclass To display all sub class
lsdev -C To lists all configured devices
lsdev -Cc if To display existing network interfaces
lsdev -C -l mem0 To display the properties of mem0
chdev -l sys0 -a maxproc=100 To change default maxproc value to 100
chdev -l rmt0 -a blocksize=512 To change the block size to 512
chdev -l rmt0 -a ret=no To avoid tape retension
rmdev -l rmt0 To remove the device rmt0
rmdev -d -l rmt0 To remove the device totally from database
rmdev -l rmt0 -S To change the state of the device stopped
lsparent -C -k rs232 To display possible parent devices which accept rs232 devices
lsparent -C -l hdisk0 To display parent devices which accept child device hdisk0
lsattr -Dl rmt0 To see the default values of the device rmt0
lsattr -El rmt0 To see the current values of the device rmt0
lsattr -El tty0 -a login -R To see all possible values of the login attribute of tty0
lsconn -p scsi0 To list all possible connection scsi0 can accept
lvlstmajor To list the available major numbers
mknod /dev/null c 2 2 Create null device with major (2) and minor (2) nos. (c - char device)
Backup commands
mksysb -i -X /dev/rmt0 Creates image.data and system backup (-X expands /tmp if
required)
mksysb -m /dev/rmt0 Creates image.data file with map file and system backup
mksysb -e /dev/rmt0 Creates system data but excludes the files listed in /etc/exclude.rootvg
mkszfile Creates /image.data file
mkcd -d /dev/cd1 Creates system boot backup to the CD-R device /dev/cd1
mkcd -d /dev/cd1 -v vg00 Creates backup of vg vg00 to CD-R device /dev/cd1
mkcd -d /dev/cd1 -G Creates generic boot backup
savevg -i -f /dev/rmt0 vg00 Creates vg00.data image file and backup vg vg00
savevg -ef /dev/rmt0 vg00 Creates vg00 backup but excludes files listed in the /etc/exclude.vg00
find / -print | backup -ivf /dev/rmt0 Backup entire system to rmt0
backup -0vf /dev/rmt0 /home Backup /home directory to rmt0 with backup level 0
restore -Tvf /dev/rmt0 List the archive in rmt0
restore -xvf /dev/rmt0 /home Restore /home from archive in device rmt0
find ./home -print |cpio -ocvumB > /dev/rmt0
Archives /home directory
cpio -icvdumB < /dev/rmt0 Restores cpio archive from rmt0
cpio -ivt < /dev/rmt0 List the contents of cpio archive from rmt0
cpio -icvd < /dev/rmt0 /homeRestores /home directory from rmt0
tar -cvf /dev/rmt0 /home Archives /home to rmt0 device
tar -tvf /dev/rmt0 List the archives in rmt0
tar -xvf /dev/rmt0 /home Extract /home from rmt0
dd if=si of=si1 conv=ebcdic Convert and copy ascii file si to ebcdic si1
dd if=/dev/rmt0 ibs=512 obs=1024 of=/dev/rmt1
To copy blocks from rmt0 with 512 blocks to rmt1 with 1024 blocks
tctl -f /dev/rmt0 rewind To rewind the tape
tctl -f /dev/rmt0 offline To eject the tape
tctl -f /dev/rmt0 status To show the status of tape
chdev -l rmt0 -a block_size=512 To change the block size of the tape to 512
When using variable block size, the dd command can be employed with an excessive block size to
buffer input to tar, cpio, backup, and restore.
# dd if=/dev/rmt0.1 ibs=64k obs=512 | restore -xvf-
# dd if=/dev/rmt0.1 ibs=64k obs=5120 | tar -xvBf-
# dd if=/dev/rmt0.1 ibs=64k obs=5120 | cpio -ivB
# dd if=/dev/rmt0.1 ibs=64k obs=5120 | pax –rf
You can change the default block size defined to AIX for a tape device using the chdev command or
through SMIT, as shown in the following listing. Remember that this does not alter the physical block
size used by the device!
# chdev -1 rmt0 -a "block_size=0" Variable block size
# chdev -1 rmt0 -a "block_size=512" Fixed 512-byte block size
# chdev -1 rmt0 -a "block_size=1024" Fixed 1024-byte block size
Shutdown Commands
# shutdown -m +5 Shut system down to single user in 5 minutes
# shutdown -r Shut down and reboot
# shutdown now Shut down immediately without rebooting
# shutdown -r Reboot now
# shutdown -Fr Reboot now without any user warning
# shutdown -r now Reboot now and warn the users
# shutdown -k Avoid shutting down the system
ODM:
Customized object classes represent the devices actually present on the system.
/etc/objrepos/Pdxxx ODM predefined Attributes, Connections, and Devices: PdAt PdCn PdDv
/etc/objrepos/Cuxxx ODM customized Attributes, Dependencies, Device Drivers and Vital Product
Data: CuAt CuDep CuDv CuDvDr CuVPD Config_Rules CuOD (New to 5L!)
/usr/share/lib/objrepos Components of the SoftWare Vital Product Data (SWVPD) : lpp history
inventory product
Device object classes are linked hierarchically into subclasses.
# odmshow <ObjectClassName>
Print commands
qchk -q To display the default q
qchk -P lp0 To display the status of the printer lp0
qchk -# 123 To display the status of job number 123
qchk -A To display the status of all queues
qcan -x 123 To cancel the print job 123
qcan -X -P lp0 To cancel all jobs submitted to lp0
qpri -#570 -a 25 To change the priority of the job to 25
qhld # 569 To hold the job 569
qhld -r -#569 To remove holding from 569
qmov -m lpa -#11 To move the job 11 to queue lpa
enable psq To enable queue psq
disable psq To disable queue psq
cancel -#111 To cancel job 111
lpstat To display the status all queues
lpstat -p lp0 To display the status of print queue lp0
lpstat -u root To display the jobs submitted by user root
lpq -P lp0 To display the status of queue lp0
last To list all the records in the /var/adm/wtmp file
last | grep shutdown To show the shutdown sessions
uptime (w -u ) To show how long the system has been up
# switch.prt -s AIX Switch to the AIX printer subsystem
# switch.prt -s SystemV Switch to the System V printer subsystem
Once the printer driver is installed, you can proceed to add the System V printer to the system. There
are three steps to enable the printer. The lpadmin command is used to add the printer:
# mkdev –c printer –t hp4V –s parallel –p ppa0 –w p
# lpadmin -p hp4V -v /dev/lp0 -D "Hewlett-Packard LaserJet 4/4M"
After the System V printer has been added to the system, you need to use the accept command to allow
the printer to accept print requests:
# accept hp4V
The last step is to enable the new print queue using the enable command:
# enable hp4V
To define the print queue on the remote client, use the following command syntax:
# lpadmin -p <client_printer_name> -s <remote_pr_server>!<remote_pr_queue>
The System V filesets that are installed by default include the following:
bos.msg.en_US.svprint
bos.svprint.fonts
bos.svprint.hpnp
bos.svprint.ps
bos.svprint.rte
bos.terminfo.svprint.data
Licensing commands
oslevel To list the operating system level
oslevel –r To get the ML info
instfix -i | grep ML To get the ML info
lslicense To see the number of license
chlicense -u30 To change the fixed user license to 30
chlicense -f on To enable floating user license
User commands
id To list all system identifications for current user
id -gn To list the default group for current user
id -Gn To list all system groups for current user
lsuser root To list the attribute of user root
lsuser ALL To list the attributes of all users
lsuser -a HOME ALL To list the home directory of all users
lsuser -a ALL To list all usernames
lsuser -a auth1 auth2 ALL To list the authentication method for all users
lsuser -a expires ALL To list expiry date
lsuser -a account_locked ALL To check account lock status of all users
chuser -a login=true san To enable the user san
chuser -a rlogin=true san Enable san to login remotely
mkuser si Creates user si with default values in /usr/lib/security/mkuser.defalault
mkuser su=false si Create user si without su facility
rmuser si To remove user si
rmuser -p si To remove user si and his all attributes
who List users with tty nos and ip numbers
who /var/adm/wtmp Lists history of login logout system startup and shutdowns
who -r To list the run level
who am i /who -m To list the current user
mkgroup dcm To create the group dcm
chgroup users=u1,u2,u3 dcm To add users u1 u2 and u3 to dcm group
rmgroup dcm To delete the group dcm
chauthent To change the authentication methods
To enable a non-root administrator to use pwdadm, simply add their ID to the "security" group
Subsystem Commands
lssrc -a To list the status of all subsystems
lssrc -h node1 -a To list the status of all subsystems on foreign host node1
lssrc -s kadmind To list the status of the subsystem kadmind
lssrc -g tcpip To get the status of the subsystem group tcpip
mkssys To add a subsystem
rmssys -s kerberos To remove the subsystem kerberos
chssys -s kerb -s kad To rename the subsystem kerb to kad
startsrc -s kadmin To start the subsystem kadmin
startsrc -g tcpip To start the subsystem group tcpip
stopsrc -s kadmin To stop the subsystem kadmin
stopsrc -g tcpip To stop the subsystem group tcpip
refresh -s nfsd To refresh nfsd subsystem
refresh -g tcpip To refresh tcpip subsystem group
refresh –s lpd
Scheduling commands
crontab -l To list the crontab entries
crontab -e To edit the crontab entries
crontab -l > /si To copies the entries of crontab to /si file
crontab -r To remove all crontab entries
crontab -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 service
at -l To list the jobs scheduled via at command
at -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 service
batch To run the command when the system load permits
atq joe To list all the jobs submitted by user joe
ODM Commands
odmget sm_menu_opt To get the objects from class sm_menu_opt
odmget -q "id=licenses" sm_menu_opt To list objects that matches query id=licenses from
object sm_menu_opt
odmdelete -o sm_menu_opt -q "id=licenses" To delete the entries from class
sm_menu_opt which
agrees the query id=licenses
odmshow sm_menu_opt To show the object class definition
odmdrop -o sm_menu_opt To drop sm_menu_opt object class
odmchange -o sm_menu_opt -q "id=licenses" file1 To change the attributes from file1
Daemons of NIS
Server Slave Server Client
ypserv ypserv ypbind
yppasswd
ypupdated
Slave Server
Change the nis domain name
chypdom –B mca
Edit hosts file, keep entries for loopback, this machine and of server
Execute mkslave –O –B –C mca
Client machine
Change the nis domain name
chypdom –B mca
Edit hosts file, and keep entries for loopback , this machine and of server
Execute mkclient –B mca
Check for ypbind with lssrc –s ypbind
LPAR
indyoradst# uname -L
1 06-C891G
indyoradst# prtconf -L
LPAR Info: 1 06-C891G
indyoradst#
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 node1
clgetgrp -g sh1 To list the info about resource group sh1
clgetgrp -g sh1 -f nodes To list the participating nodes in the resource group sh1
clgetif To list interface name/interface device name/netmask associated with
a specified ip label / ip address of a specific node
clgetip sh1 To get the ip label associated to the resource group
clgetnet 193.9.200.2 255.255.255.0 To list the network for ip 193.9.200.2, netmask 255.255.255.0
clgetvg -l nodelv To list the VG of LV nodelv
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)
kadmind The authentication database daemon for password changing and administration tools
Listens 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 authentication
database.
kerberos Daemon that provides authentication services & ticket granting ticket for clients.
kpropd Daemon to receive update for a secondary database server
hardmon Daemon that monitors and controls the state of SP hardware
It checks acl file /spdata/sys1/spmon/hmacls
ngcreate -s 1:1 si To create node group si with 1st node in 1st frame
ngcreate -n 1 2 3 si To create node group si with 1st 2nd and 3rd nodes
ngcreate -N ng1,ng2 si To create node group si with node groups ng1 and ng2
ngcreate -w n1,n2 si To create node group si with host name n1 and n2
ngcreate -ae n1,n2 si To create node group si with all nodes in the current partition
excluding hosts n1 and n2
delnimclient -l 1 2 3 To delete nim client definition for nodes 1 2 and 3 from NIM master
mknimclient -l 1 2 3 To make node 1 2 and 3 as NIM clients
delnimmast -l 1 17 33 To unconfigure nodes 1 17 and 33 as NIM masters and remove filesets
mknimmast -l 1 17 33 To make nodes 1 17 and 33 as NIM masters
ntpdate 90.1.2.1 Sets date and time by enquiring ntp server 90.1.2.1
rcmdtgt To obtain a maximum life time ticket for rcmd services on local
node
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
ksrvutil list To list the principals and version number in the server key file
ksrvutil -f /etc/srvtab.bak list To list the principals in the file /etc/srvtab.bak
ksrvutil change To change the key version in the default srvtab file
ksrvutil delete To delete the keys in the /etc/krb-srvtab file
ksrvutil -f /etc/srvtab.bak delete To delete the keys in the /etc/srvtab.bak file
spacs_cntrl block user1 To block user1 on the node
spacs_cntrl unblock user1 To unblock user1
spacs_cntrl deny user1 To deny user1
spacs_cntrl allow user1 To allow user1
spacs_cntrl -f /tmp/si deny To deny the list of the users in the file /tmp/si
cw_allowed List of users to be allowed to login to CWS
cw_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 for
second file will be in /etc/profile file)
Procedure to Build a file collection with name siju for files in /home/siju
1) go to /var/sysman/sup
2) create dir siju
3) change ownership and group of siju to bin
4) copy contents of /var/sysman/sup/user.admin to siju
5) edit list file for including and omitting files in /home/siju directory
It should contains entry like the following
symlinkall
upgrade ./home/siju
omit ./home/siju/abc
omitany ./home/siju/s*
6) Add a symbolic link to siju file in lists directory to list in siju directory
ie ln -s /var/sysman/sup/siju/list /var/sysman/sup/lists/siju
7) Update /var/sysman/file.collections file with following entry
primary siju - / - / EDO power no
8) Update sup.admin file collection to reflect the changes made to file.collections
dsh -av supper update sup.admin
9) Install file collection siju in the nodes
dsh -av supper install siju
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)
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
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 SCUSER
if [ aclcheck -f /etc/substart.acl $SCUSER ] {
exec /etc/substart.srv $SubSystem
return
}}
if condition in the above example checks for kerberos user in the acl file /etc/substart.acl
If the condition is true it execute the command /etc/substart.srv with arguments passed by
substart 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 file
include /etc/substart.tcl
8) Distribute the files to all nodes
pcp -av /usr/bin/substart
pcp -av /etc/substart.tcl
pcp -av /etc/substart.srv
pcp -av /etc/substart.acl
pcp -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
NIM Commands
smit nimconfig Configure and start NIM master
smit nim_mknet Create NIM network objects
smit nim_mkroute Define NIM network routes
smit nim_mkmac Create client network object
smit nim_mkres Create lpp_source
smit nim_alloc Create bos.inst resources
lsnim List NIM-defined objects
bootinfo -q Check IPL ROM emulation
bosboot -r Create IPL ROM media
smit nim_alloc Create bos_inst resource on client
smit nim_perms Set master push permission
smit nim_mac_op Select client and resource
smit nim_mkgrp Create a NIM client group
smit bos_inst Push install stand-alone client
smit nim_install Pull install from client
smit dksl_init Initialize diskless client
smit nim_mac_opp lppchk Verify installation
smit nim_backup_db Back up NIM configuration
smit nim_restore_db Restore NIM configuration
smit nim_client_op Remotely operate a NIM client
smit nim_unconfig Unconfigure NIM master
nimconfig -a pif_name=en0 -a netname=net1
To initialise the NIM master with network name net1
nimconfig -r To rebuild /etc/niminfo file which contains the variables for NIM
nimclient The client version of nim command (User can obtain same results of nim in server )
Network Install Manager (NIM)
1. First, create a /tftpboot filesystem before running smitty nim_config_env. To create the /tftpboot
filesystem and install the NIM software, use the following command sequence:
# mklv -y 'lvtftp' rootvg 1
# crfs -v jfs -d lvtftp -m /tftpboot -A yes
# mount /tftpboot
# chfs -a size=120000 /tftpboot
# df -k /tftpboot
# installp -qaX -d <device> bos.sysmgt..nim.master bos.sysmgt.nim.spot
# smitty nim_config_env
2. Create a /tftpboot filesystem and install the NIM filesets using the preceding command sequence.
3. Configure the NIM Master from CD-ROM using smitty nim_config_env.
4. Define the client machine(s) using smitty nim_mac.
5. Create a mksysb image and define a mksysb resource using smitty nim_res.
6. Install a stand-alone client from the mksysb image using smitty nim_bosinst.
7. Boot the client.
NFS Daemons
There are a number of daemons that need to run on both the client and the server.
Client
biod Improves NFS performance by filling and emptying the buffer cache. By default 6
biod daemons are started however this can be changed to improve performance.
These are started in the /etc/rc.nfs file.
rpc.statd Allows the remote procedure calls
rpc.lockd Handles File locking
Server
portmap Provides a standard way of looking up the port for a certain application. The
application registers with portmap, then portmap listens on the appropriate port.
When a client communicates on the NFS port, portmap replies with the real port
number of NFS. Portmap is included in the /etc/rc.tcpip file and must be started
before inetd and the RPC servers so that it can accept the registrations.
nfsd A server daemon that handles the client requests for file system operations. Each
daemon accepts one request at a time, however once it has passed the request on to
the kernel it is free to accept a new request. Bu default 8 nfsd daemons are started,
however if the server is a busy nfs server then a value 50 to 100 might be more
appropriate. These are started from /etc/rc.nfs and are under the control of SRC.
rpc.mountd Accepts a mount request from the client and allows the export if authorised.
rpc.statd Allows Remote procedure calls
rpc.lockd Implements file locking
# smit mkslave
HOSTNAME of the master server [Master]
Can existing MAPS for the domain be overwritten? yes
START the slave server now, both
at system restart, or both?
Quit if errors are encountered? Yes
# smit mkclient
START the NIS client now, both
at system restart, or both?
NIS server - required if there are no []
NIS servers on this subnet
To stop, start, or check status of the NIS client ypbind daemon, run the following commands:
# lssrc –s ypbind
# stopsrc –s ypbind
# startsrc –s ypbind
NIS PLUS
NIS Packages - bos.net.nisplus
To create NIS+ master servers and clients, invoke the SMIT FastPath smit nisp_config. AIX also
provides setup scripts to set up NIS+: nisserver, nispopulate, and nisclient.
The following table contains a list of common NIS+ commands to manage different NIS+ components.
Command Description
niscat Displays object properties of an NIS+ table
nisls Displays the contents of an NIS+ table
nisrmdir Removes an NIS+ object from a namespace
nisrm Removes NIS+ directories and subdirectories from a namespace
rpc.nisd The NIS+ daemon; provides NIS+ services
nisinit Initializes a workstation to be an NIS+ client
nis_cachemgr Starts the NIS+ cache manager daemon
nisshowcache Displays the contents of the shared cache file
nisping Pings the replicas and prompts for updating
nislog Displays the contents of the transaction log
nisgrpadm Creates, deletes, and performs miscellaneous administration operations on NIS+ groups
nisdefaults Displays the seven default values currently active in the namespace
nisaddent Creates NIS+ tables from corresponding /etc files or NIS maps
Sendmail Files
The sendmail MTA uses the following files for configuration and data:
/etc/mail/sendmail.cf Sendmail configuration file
/etc/mail/aliases Mail aliases
/etc/mail/aliases.db Compiled alias file
/etc/mail/sendmail.pid PID of sendmail daemon
/etc/sendmail.pid Link to sendmail.pid file
/etc/mail/statistics Mail statistics
The sendmail program accesses configuration file information from a compiled version of the
/etc/sendmail.cf table. To compile a new version of the database, use sendmail with the -bz flag.
# /usr/lib/sendmail –bz --- Compile a new sendmail.cf database
sendmail accesses alias information from a dbm version of the /etc/aliases table. To compile a new
version of the /etc/aliases table, use /usr/lib/sendmail -bi.
# /usr/lib/sendmail –bi ---- Create new alias database
The sendmail program is invoked as a subsystem from the /etc/rc.tcpip script. The AIX sendmail
automatically compiles the /etc/mail/aliases and /etc/mail/sendmail.cf files when it is started. If you are
running a non-IBM-supplied sendmail, you may need to force a compile of these files as part of the
start-up. If you update any of the configuration information while sendmail is running, refresh the
sendmail subsystem by issuing an SRC refresh command or by sending the daemon a SIGHUP.
# refresh -s sendmail
# kill -1 'head –1 /etc/sendmail.pid'
The basic startup flags for sendmail should invoke sendmail as a daemon and specify the time in
minutes between mail queue scans for postponed messages. These flags are -bd and -q<time>.
# /usr/lib/sendmail -bd -q30m # Start and scan mail queue every 30 minutes
To stop the sendmail daemon, use the SRC stopsrc command or send a SIGABORT to the daemon.
# stopsrc -s sendmail
# kill -6 'head –1 /etc/sendmail.pid'
To restart the stopped server, use the SRC startsrc command. (Note that starting
sendmail with startsrc requires an additional parameter.)
# startsrc -s sendmail -a'-bd -q30m'
To check the status of the sendmail daemon, use the SRC lssrc command.
# lssrc -s sendmail
To display the set of supported signals, use the -l argument of the kill command:
# /bin/kill -l
Datavg recovery
# varyonvg datavg
0516-082 varyonvg: Unable to access a special device file.
Execute redefinevg and synclvodm to build correct environment.
snitsoradbs06# lsvg
rootvg
datavg
snitsoradbs06# lsvg datavg
0516-010 : Volume group must be varied on; use varyonvg command.
# lspv
hdisk0 00cdb75d801c9e88 rootvg active
hdisk1 00cdb75dc9733fb1 rootvg active
hdisk2 00cdb75d0ae46707 datavg
# synclvodm datavg
0516-010 : Volume group must be varied on; use varyonvg command.
0516-544 synclvodm: Unable to access volume group datavg.
# varyonvg datavg
# mount -a
mount: 0506-324 Cannot mount /dev/hd1 on /home: The requested resource is busy.
mount: 0506-324 Cannot mount /proc on /proc: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/hd10opt on /opt: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/lv09 on /unix_stage: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/lv00 on /oracle: A file or directory in the path name does not
exist.
mount: 0506-324 Cannot mount /dev/lv01 on /oracle/data1: A file or directory in the path name does not exist.
mount: 0506-324 Cannot mount /dev/lv02 on /oracle/data2: A file or directory in the path name does not exist.
mount: 0506-324 Cannot mount /dev/lv03 on /oracle/data3: A file or directory in the path name does not exist.
mount: 0506-324 Cannot mount /dev/lv04 on /oracle/data4: A file or directory in the path name does not exist.
mount: 0506-324 Cannot mount /dev/lv05 on /bkup_arch_logs: A file or directory in the path name does not
exist.
mount: 0506-324 Cannot mount /dev/lv06 on /transfer_edi: A file or directory in the path name does not exist.
mount: 0506-324 Cannot mount /dev/lv08 on /apps: A file or directory in the path name does not exist.
mount: 0506-324 Cannot mount /dev/lv07 on /non_edi_data: A file or directory in the path name does not
exist.
# mount /oracle
mount: 0506-324 Cannot mount /dev/lv00 on /oracle: A file or directory in the path name does not
exist.
# fsck /dev/lv00
fsck: 0506-035 /dev/lv00 is not a known file system.
# ls /dev/lv00
ls: 0653-341 The file /dev/lv00 does not exist.
# varyoffvg datavg
# exportvg datavg
# lsvg
rootvg
datavg
# lsvg -l datavg
datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv00 jfslog 1 1 1 closed/syncd N/A
lv00 jfs 57 57 1 closed/syncd /oracle
lv01 jfs 92 92 1 closed/syncd /oracle/data1
lv02 jfs 103 103 1 closed/syncd /oracle/data2
lv03 jfs 110 110 1 closed/syncd /oracle/data3
lv04 jfs 149 149 1 closed/syncd /oracle/data4
lv05 jfs 4 4 1 closed/syncd /bkup_arch_logs
lv06 jfs 1 1 1 closed/syncd /transfer_edi
lv07 jfs 1 1 1 closed/syncd /non_edi_data
lv08 jfs 6 6 1 closed/syncd /apps
AIX FS Recovery
Maintenance
88 Help ?
99 Previous Menu
Warning:
If you choose to access a root volume group, you will not be able to return
to the Base Operating System Installation menus without rebooting.
0 Continue
88 Help ?
>>> 99 Previous Menu
Type the number for a volume group to display the logical volume information
and press Enter.
Choice: 1
Choice [99]: 2
Importing Volume Group...
rootvg
Checking the / filesystem.
# fsck /dev/hd2
** Checking /dev/rhd2 (/usr)
** Phase 0 - Check Log
log redo processing for /dev/rhd2
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Inode Map
** Phase 6 - Check Block Map
32400 files 10371960 blocks 2473096 free
# fsck /dev/hd3
** Checking /dev/rhd3 (/tmp)
** Phase 0 - Check Log
log redo processing for /dev/rhd3
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Inode Map
** Phase 6 - Check Block Map
1142 files 292240 blocks 1018480 free
# fsck /dev/hd4
** Checking /dev/rhd4 (/)
** Phase 0 - Check Log
log redo processing for /dev/rhd4
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Inode Map
** Phase 6 - Check Block Map
1998 files 194240 blocks 67904 free
# fsck /dev/hd9var
** Checking /dev/rhd9var (/var)
** Phase 0 - Check Log
log redo processing for /dev/rhd9var
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Inode Map
** Phase 6 - Check Block Map
7096 files 2011784 blocks 2968952 free
# fsck /dev/hd10opt
** Checking /dev/rhd10opt (/opt)
** Phase 0 - Check Log
log redo processing for /dev/rhd10opt
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Inode Map
** Phase 6 - Check Block Map
581 files 56271 blocks 205873 free
# logform /dev/hd8
logform: destroy /dev/hd8 (y)?y
# bootlist -m normal -o
cd0
rmt0
hdisk0
# df -k
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/ram0 131072 107680 18% 363 1% /
/dev/cd0 611836 0 100% 305918 100% /SPOT
RIO Configuration
+------------- Remote I/O Attachment Summary --------------+
STARTING SOFTWARE
PLEASE WAIT...
-------------------------------------------------------------------------------
Welcome to AIX.
boot image timestamp: 22:26 04/09
The current time and date: 13:52:27 07/23/2004
number of processors: 2 size of memory: 4096Mb
boot device: /pci@400000000111/pci@2,2/scsi@1/sd@5:\ppc\chrp\bootfile.exe
closing stdin and stdout...
-------------------------------------------------------------------------------
Type a 1 and press Enter to use this terminal as the system console.
Type the number of your choice and press Enter. Choice is indicated by >>>.
88 Help ?
99 Previous Menu
Maintenance
88 Help ?
99 Previous Menu
Warning:
If you choose to access a root volume group, you will not be able to return
to the Base Operating System Installation menus without rebooting.
0 Continue
88 Help ?
>>> 99 Previous Menu
Choice: 2
------------------------------------------------------------------------------
Volume Group ID 0059d6ca00004c00000000fb874a4e3a includes the following
logical volumes:
Choice [99]: 2
Importing Volume Group...
rootvg
Checking the / filesystem.
****************
j2_logredo:end of log 0x44ce2c
j2_logredo:syncpt record at 0x1433c
j2_logredo:syncpt address 0x1433c
j2_logredo:log record count = 34955
j2_logredo:after record count = 19003
j2_logredo:do block count = 455
j2_logredo:nodo block count = 118
/dev/hd4: Superblock is marked dirty (FIXED)
Checking the /usr filesystem.
****************
Exit from this shell to continue the process of accessing the root
volume group.
# logform /dev/hd8
logform: destroy /dev/rhd8 (y)?y
# fsck -p /dev/hd1
****************
# fsck -p /dev/hd2
****************
# fsck -p /dev/hd3
****************
# fsck -p /dev/hd4
****************
# fsck -p /dev/hd9var
****************
# fsck -p /dev/pinutil
****************
# exit
Saving special files and device configuration information.
Checking and mounting the /tmp filesystem.
****************
Checking and mounting the /var filesystem.
****************
Filesystems mounted for maintenance work.
# df -k
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/ram0 65536 53368 19% 1844 14% /
/dev/hd4 65536 53368 19% 1844 14% /
/dev/hd2 3014656 1577468 48% 33097 9% /usr
/dev/hd3 393216 295708 25% 455 1% /tmp
/dev/hd9var 131072 71004 46% 2339 13% /var
# lsvg
rootvg
dbvg
# varyonvg dbvg
0516-082 varyonvg: Unable to access a special device file.
Execute redefinevg and synclvodm to build correct environment.
# lspv
hdisk0 0059d6ca0d8bf584 rootvg active
hdisk1 0059d6ca7793e65c rootvg active
hdisk2 0059d6ca7814ecf6 dbvg
hdisk3 0059d6ca7814ef34 dbvg
hdisk4 0059d6ca7814f184 dbvg
hdisk5 0059d6ca7814f38f dbvg
# synclvodm
Usage: synclvodm [-v] [-P] VGname [LVname...]
# synclvodm dbvg
0516-010 : Volume group must be varied on; use varyonvg command.
0516-544 synclvodm: Unable to access volume group dbvg.
# varyonvg dbvg
# synclvodm dbvg
# lsvg -l dbvg
dbvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
u01 jfs2 200 200 1 closed/syncd /u01
u02 jfs2 200 200 1 closed/syncd /u02
u03 jfs2 200 200 1 closed/syncd /u03
u04 jfs2 200 200 1 closed/syncd /u04
loglv00 jfs2log 1 1 1 closed/syncd N/A
# fsck /u01
****************
The current volume is: /dev/u01
**Phase 1 - Check Blocks, Files/Directories, and Directory Entries
**Phase 2 - Count links
**Phase 3 - Duplicate Block Rescan and Directory Connectedness
**Phase 4 - Report Problems
**Phase 5 - Check Connectivity
**Phase 7 - Verify File/Directory Allocation Maps
**Phase 8 - Verify Disk Allocation Maps
13107200 kilobytes total disk space.
1308 kilobytes in 1808 directories.
6083969 kilobytes in 2978 user files.
7018816 kilobytes are available for use.
File system is clean.
# fsck /u02
****************
The current volume is: /dev/u02
**Phase 1 - Check Blocks, Files/Directories, and Directory Entries
**Phase 2 - Count links
**Phase 3 - Duplicate Block Rescan and Directory Connectedness
**Phase 4 - Report Problems
**Phase 5 - Check Connectivity
**Phase 7 - Verify File/Directory Allocation Maps
**Phase 8 - Verify Disk Allocation Maps
13107200 kilobytes total disk space.
6 kilobytes in 12 directories.
656696 kilobytes in 16 user files.
12448076 kilobytes are available for use.
File system is clean.
# fsck /u03
****************
The current volume is: /dev/u03
**Phase 1 - Check Blocks, Files/Directories, and Directory Entries
**Phase 2 - Count links
**Phase 3 - Duplicate Block Rescan and Directory Connectedness
**Phase 4 - Report Problems
**Phase 5 - Check Connectivity
**Phase 7 - Verify File/Directory Allocation Maps
**Phase 8 - Verify Disk Allocation Maps
13107200 kilobytes total disk space.
6 kilobytes in 12 directories.
2266944 kilobytes in 16 user files.
10837828 kilobytes are available for use.
File system is clean.
# fsck /u04
****************
The current volume is: /dev/u04
**Phase 1 - Check Blocks, Files/Directories, and Directory Entries
**Phase 2 - Count links
**Phase 3 - Duplicate Block Rescan and Directory Connectedness
**Phase 4 - Report Problems
**Phase 5 - Check Connectivity
**Phase 7 - Verify File/Directory Allocation Maps
**Phase 8 - Verify Disk Allocation Maps
13107200 kilobytes total disk space.
1383 kilobytes in 983 directories.
13102635 kilobytes in 7927 user files.
0 kilobytes are available for use.
File system is clean.
# logform /dev/loglv00
logform: destroy /dev/rloglv00 (y)?y
# sync
# sync
# sync
# bootlist -m normal -o
cd0
hdisk0
# bootlist -m normal hdisk0
# reboot
Rebooting . . .
TSM Commands
q vol status=pending
Volume Name Storage Device Estimated Pct Volume
Pool Name Class Name Capacity Util Status
(MB)
------ ----------- ------------ ---------- ----- --------
000001 DR_BKPPOOL 3584CLASS 0.0 0.0 Pending
000092 DR_BKPPOOL 3584CLASS 0.0 0.0 Pending
Manual Checkin:
Manual Checkout:
tsm> checkout libvolume <library_name> <tape no> CHECKLABEL=YES FORCE=NO
REMOVE=YES
Automatic Checkout:
tsm> run drcheckout
Space Reclamation:
To start space reclamation:
tsm> update stgpool <POOL_NAME> reclaim=80
Auditing:
tsm> audit library 3584lib
DRCHECKIN
move drmedia * wherestate=vaultretrieve tostate=onsiteretrieve cmd="&vol"
cmdfilename=/tmp/drcheckin.txt wait=yes
DRBACKUP
disable sessions
select * from sessions where upper(session_type)='NODE'
if (rc_ok) goto reschedule
expire inventory wait=yes
move data /tsmdb/bkp_diskpool.dsm stgpool=3584_bkppool wait=yes
move data /tsmdb/arc_diskpool.dsm stgpool=3584_arcpool wait=yes
backup stgpool 3584_bkppool dr_bkppool wait=yes
backup stgpool 3584_arcpool dr_bkppool wait=yes
backup db devclass=3584class type=full wait=yes
backup volhist filenames=/tsmdb/backup/volhist.bkp
backup devconf filenames=/tsmdb/backup/devconf.bkp
audit license
update schedule drbackup type=admin starttime=16:00:00
enable sessions
exit
reschedule:
update schedule drbackup type=admin starttime=now+00:05
exit
q script
q script DRBACKUP f=d
q stgpool
Ex:-
q actlog -begintime=00:00 begindate=today-1 or=cl node=<hostname>
q vol status=<STATUS>
q vol stgpool 3584_arcpool status=<STATUS>
-> displays the filling tapes in arcpool library with filled in size
Size in default:
DB Volume (db.dsm) – 17 MB
LOG Volume (log.dsm) – 9 MB
Format and define a 500MB DB and 25MB Recoery LOG vol. And extend them by
By default,
Adding Administrators:
Creating a user named mark with password Missouri and adding him to system class
Registering a node Mercedes where u have already installed TSM client with password montana