Académique Documents
Professionnel Documents
Culture Documents
FS COMMANDS
lsfs Lists all filesystems in the /etc/filesystems entry
lsfs -q List all filesystems with detailed info
lsfs -a To list all filesystems (default)
lsfs -l Specify the output in list format
lsfs -c Specify the output in column format
lsfs -v jfs Lists all jfs filesystems
chfs -a size=24576 /si Change size of FS /si to 24576 x 512 bytes blocks (12 MB)
chfs -a size=+24576 /si Add 24576 x 512 byte blocks to FS /si
chfs -m /si /bi Change the mount point from /si to /bi
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 -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 -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
bootinfo -e Check the machine can boot from tape
bootinfo -T To see the machine type
bootinfo -s hdisk0 To see the size of hdisk0
bootinfo -r To see the size of memory
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
restore –xvf /export/mksysb ./etc/sshd.conf Restores particular file from /export/mksysb image
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 /home Restores /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
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
Licensing commands
oslevel To list the operating system level
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
chuser unsuccessful_login_count=0 ppfsd01 To change the unsuccessful login count
Subsystem Commands
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
HACMP Commands
logs
/tmp/hacmp.out Detailed event script output logged in 7 day rolling history
/var/adm/cluster.log High level view of cluster events (No clean up on this file)
/usr/sbin/cluster/history/cluster.mmdd Day by day view of cluster events. (one file / day of month)
/tmp/cm.log Clstrmgr messages
/tmp/cspoc.log Output from C-SPOC commands (similar to smit.log)
/tmp/emuhacmp.out Output from event emulation
rdist -b -f /etc/disfile1 To distribute the files in disfile1 to all nodes in disfile1 in binary mode
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
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
3) Create server application substart.tcl with a procedure substart_proc with following contents
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
startsrc -s $2
This script execute the command startsrc with the argument passed by the substart command
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
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
11) Try the above command with any other kerberos ticket. Result should be negative
NIM Commands
nimclient
The client version of nim command (User can obtain same results of nim in server )