Vous êtes sur la page 1sur 8

Volume Group Commands lsvg Display all VGs lsvg -o Display all active VGs lsvg rootvg Display

info about rootvg lsvg -l rootvg Display info about all LVs in rootvg lsvg -o |lsvg -il Display info about all LVs in all VGs lsvg -p rootvg Display info about all PVs in rootvg mkvg -s 8 hdisk1 Create VG with name vgxx on hdisk1 with partition size 8MB mkvg -s 8 -y sivg hdisk1 Create VG with name sivg on hdisk1 with partition size 8MB mkvg -s 4 -t 2 -y mnkvg hdisk1 Create mnkvg on hdisk1 with PP size 4 and no of partion 2 * 1016 chvg -a y newvg To cuase VG newvg automatically activated at startup chvg -a n newvg To deactivate the automatic activation at startup chvg -t 2 newvg To change maximum no. of PP to 2032 on vg newvg chvg -Q n newvg To disable quorum on VG newvg reorgvg newvg Reorganises PP allocation of VG newvg extendvg newvg hdisk3 hdisk4 Add PV hdisk3 and hdisk4 to VG newvg exportvg newvg Exports the VG newvg importvg -V 44 -y newvg hdisk2 Import the hdisk2 with name newvg, and assign major number 44 redcucevg newvg hdisk3 Remove PV hdisk3 from VG newvg varyoffvg newvg To deactviate VG newvg varyonvg newvg To activate VG newvg syncvg -v sivg To sync the mirrored LV in the VG sivg mirrorvg -S -m sivg hdisk2 To mirror LVs of sivg with hdisk2 (-m for exact mirror, -S forbackground mirror) unmirrorvg sivg hdisk2 To remove the mirrored PV from the set. lsfs lsfs -q lsfs -a lsfs -l lsfs -c lsfs -v jfs chfs -a size=24576 /si chfs -a size=+24576 /si chfs -m /si /bi chfs -A /si chfs -d account /si File System Commands Lists all filesystems in the /etc/filesystems entry List all filesystems with detailed info To list all filesystems (default) Specify the output in list format Specify the output in column format Lists all jfs filesystems Change size of FS /si to 24576 x 512 bytes blocks (12 MB) Add 24576 x 512 byte blocks to FS /si Change the mount point from /si to /bi To auto mount the filesystem 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 rmfs -r /siju Deletes FS /siju and associated LV Deletes FS /siju its mount point and associated LV

defragfs /sifs defragfs -q /sifs fsck -y n /dev/lv00 fsck -p /dev/lv00

To defragment the file system /sifs Display the current defrag status of the file system To fsck the filesystem associated to /dev/lv00 assuming response "yes" To restore superblock from backup superblock Physical Volume Commands

lspv hdisk0 lspv -p hdisk0 lspv -l hdisk0 chpv -v r hdisk1 chpv -v a hdisk1 chpv -c hdisk0 migratepv hdisk1 hdisk2 migratepv -l mnk hdisk1 hdisk2

Display status and characteristics of the PV Display PP usage of hdisk0 To list all logical volumes on PV hdisk0 Close the PV (Used while removing PV without varyon) Open the PV Clear the master boot record on PV hdisk0 To move PPs from PV hdisk1 to hdisk2 To migrate LV mnk from PV hdisk1 to hdisk2 Logical Volume Commands

lslv -l lv00 lslv -p hdisk1 chlv -t copy lv00 chlv -p r lv00 rmlv lvname rmlv -f lvname mklv -s n -c 3 mnk hdisk1 extendlv mnk 5 mklvcopy -s n mnk 2 hdisk1 mklvcopy mnk 3 hdisk1 hdisk2 rmlvcopy mnk 2 hdisk1 mklv -t jfslog -y log00 newvg 2 logform /dev/log00

Display info about LV by PV Display LV allocation map for hdisk1 To change the lv00 to copy type To change the lv00 to readonly mode To remove lvname To remove lvname without user intervention To make LV mnk with three copies on hdisk1 To extend the LV mnk with 5 LPs To mirror LV mnk on same PV with 2 copies To mirror LV mnk on PV hdisk1 and hdisk2 with 3 copies Will remove one copy of LV lsvi from hdisk1 To create a jfslog with name log00 on VG newvg with 2LPs To format jfslog volume log00 Boot Logical Volume 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

Paging Space Commands lsps -a lsps hd6 chps -a y paging00 chps -a n paging00 chps -s4 paging00 mkps -a -n -s4 sivg rmps paging00 swapon -a swapon /dev/paging00 To list out all paging spaces To display the details of the paging space hd6 To turn on the paging space paging00 To turn off the paging space paging00 To increase the size of the paging space in 4 LP blocks To create a paging space on VG sivg of 4 LP size (-s4) and activate it immediately (-n) and activate it at every restarts To remove the paging space paging00 To invoke all entries in /etc/swapspaces file To make available swap space paging00 System Dump Commands sysdumpdev -l sysdumpdev -L sysdumpstart -p sysdumpstart -s sysdumpdev -p /dev/lv00 sysdumpdev -P -p /dev/lv00 sysdumpdev -s /dev/rmt0 sysdumpdev -z To list the current dump destination List the details of the previous dump Starts dump in the primary dump device Starts dump in the secondary dump device To make lv00 as primary dump device To make lv00 as primary dump device permanently To make rmt0 as secondary dump device To determine a new system dump occurred Device Related Commands cfgmgr cfgmgr -l vscsi0 To configure devices and installs device software in system 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 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 -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 lsconn -p scsi0 lvlstmajor mknod /dev/null c 2 2

To see all possible values of the login attribute of tty0 To list all possible connection scsi0 can accept To list the available major numbers Create null device with major (2) and minor (2) nos. (c - char device)

Console Emulation Commands


lscons lscons -b chcons /dev/tty3 chcons -a login=enable /dev/tty3 swcons /dev/tty3 To list the current console To list the console at next boot To change the console to tty3 Redirect console to tty3 and provide login prompt To change system console to tty3 temporarily Installation Specific Commands lslpp -l lslpp -ha bos.net.* packages lslpp -f bos.rte lslpp -w /etc/hosts lslpp -p bos.net.nfs.server installp -L -d /dev/rmt0.1 installp -aX -d /dev/rmt0.1 bos.net installp -u bos.net installp -r installp -c -f <product> installp -C lppchk -c <product> instfix -k IX9999 -d /dev/rmt0.1 instfix -ik IX9999 To see the details of installed file sets To list the installation history of all file set in bos.net To list the files in the bos.rte package To list the file set which contain /etc/hosts file To list the pre requisites for bos.net.nfs.server file set To list the installable products on the device rmt0 To install all filesets within bos.net and expands file system if it requires To remove bos.net To reject the applied software To commit the <product> To cleanup an incomplete installation To check the <product> To install the file set associated with fix IX9999 from rmt0 To verify fix IX9999 installed

Network Related Commands


host 193.9.200.1 host ibm hostname ibm entstat en0 entstat -d en0 no -a no -d thewall no -o ipforwarding=1 traceroute ibm ping ibm ifconfig -a ifconfig en0 ifconfig en0 up Resolves ip to host name (from /etc/hosts file) Resolve ibm to ip address (from /etc/hosts file) To change the host name to ibm To the status of ethernet device en0 To list the detailed status of device en0 To list all net configurable attributes and their values To change thewall parameter to its default value To make the machine as router in tcpip networks To trace the route to ibm To tcp ping to the machine ibm To show the status of all network interfaces To show the status of en0 Turns on network card en0

ifconfig en0 down ifconfig en0 detach

Turns off network card en0 Removes en0 card from the network interface list

ifconfig en0 inet 194.35.52.1 netmask 255.255.255.0 up Configure en0 starts immediately ifconfig en0 alias 195.60.60.1 Create alias ip address for en0 route add 0 192.100.13.7 To make 192.100.13.7 as default gateway for entire network route add 192.100.12.0 192.100.13.7 To make 13.7 as gateway for 12.0 network route -f To clear the gateway table chdev -l inet0 -a hostname=si To change the host name to si permanently netstat -a To show the state of all sockets netstat -c To show the network buffers cache netstat -D To show the net drops of packets netstat -i To display interface statistics netstat -r To show the routing table netstat -rn To show routing table (ip will be given instead of host names) netstat -s To show the statistics of the protocols netstat -s -p < tcp/udp/ipv6> To show the statistics of respective protocols

Space Usage Commands


du -k du -l du -s df -i df -k To list number of bytes in 1k blocks To list number of bytes in 512 bytes blocks To list only the total disk usage in the current directory To display no of free and used inodes To display diskspace in 1024 bytes format

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 cpio -ivt < /dev/rmt0 Restores cpio archive from 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

Print Commands
qchk -q qchk -P lp0 qchk -# 123 qchk -A qcan -x 123 qcan -X -P lp0 qpri -#570 -a 25 qhld # 569 qhld -r -#569 qmov -m lpa -#11 enable psq disable psq cancel -#111 lpstat lpstat -p lp0 lpstat -u root lpq -P lp0 last last |grep shutdown uptime (w -u ) To display the default q To display the status of the printer lp0 To display the status of job number 123 To display the status of all queues To cancel the print job 123 To cancel all jobs submitted to lp0 To change the priority of the job to 25 To hold the job 569 To remove holding from 569 To move the job 11 to queue lpa To enable queue psq To disable queue psq To cancel job 111 To display the status all queues To display the status of print queue lp0 To display the jobs submitted by user root To display the status of queue lp0 To list all the records in the /var/adm/wtmp file To show the shutdown sessions To show how long the system has been up

Licensing Commands
oslevel lslicense chlicense -u30 chlicense -f on To list the operating system level To see the number of license To change the fixed user license to 30 To enable floating user license

User Commands
id id -gn id -Gn lsuser root lsuser ALL lsuser -a HOME ALL lsuser -a ALL lsuser -a auth1 auth2 ALL lsuser -a expires ALL lsuser -a account_locked ALL chuser -a login=true san chuser -a rlogin=true san mkuser si To list all system identifications for current user To list the default group for current user To list all system groups for current user To list the attribute of user root To list the attributes of all users To list the home directory of all users To list all usernames To list the authentication method for all users To list expiry date To check account lock status of all users

To enable the user san Enable san to login remotely 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

Subsystem Commands
lssrc a lssrc -h node1 -a lssrc -s kadmind lssrc -g tcpip mkssys rmssys -s kerberos chssys -s kerb -s kad startsrc -s kadmin startsrc -g tcpip stopsrc -s kadmin stopsrc -g tcpip refresh -s nfsd refresh -g tcpip To list the status of all subsystems To list the status of all subsystems on foreign host node1 To list the status of the subsystem kadmind To get the status of the subsystem group tcpip To add a subsystem To remove the subsystem kerberos To rename the subsystem kerb to kad To start the subsystem kadmin To start the subsystem group tcpip To stop the subsystem kadmin To stop the subsystem group tcpip To refresh nfsd subsystem To refresh tcpip subsystem group

Scheduling Commands
crontab -l crontab -e crontab -l > /si crontab -r crontab -v /var/adm/cron/cron.allow /var/adm/cron/cron.deny at -l at -r root.dfjdhjdh.21 /var/adm/cron/at.allow /var/adm/cron/at.deny batch atq joe To list the crontab entries To edit the crontab entries To copies the entries of crontab to /si file To remove all crontab entries To list the submission time File containing users who allowed cron service File containing users denied cron service To list the jobs scheduled via at command To remove the scheduled job root.dfjdhjdh.21 File containing users who allowed at service File containing users denied at service To run the command when the system load permits 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 odmdrop -o sm_menu_opt To show the object class definition To drop sm_menu_opt object class

odmchange -o sm_menu_opt -q "id=licenses" file1 To change the attributes from file1 errpt errpt -a errpt -d H errpt -d S errpt -a -j 34564423 To display complete summary of report To list complete detailed report To list all hardware related errors To list all software related errors To list detailed error report of error id 34564423

chitab tty002:23:respawn:/usr/sbin/getty /dev/tty To enter the entry tty002:23:respawn:/usr/sbin/getty /dev/tty in inittab lssrc -g portmap To start tcpip

Vous aimerez peut-être aussi