Monday, December 31, 2012

Happy new year in unix style :)

#echo "\033[4;32m`banner  happy new year 2013` \033[m";echo "\033[4;33m from Dipak Warade  \033[m"

copy and paste above in your shell :)

Tuesday, August 7, 2012

Sample AIX administrator resume

-->
Xyz yzx                                                                                        
Mobile: 7491739419387                                                                   
Email:  sample@gmail.com   
                                                                                                            Passport No. :       no


Profile Summary

v     5+ years of experience in IT Field, 4 years relevant experience in IBM AIX System
Administration

Professional Certification:  

Ø      AIX Certified P-Series (000-223) AIX Administrator
Ø      Tivoli Storage Manager Certified Administration Ver. 5.5 (000-431)
Ø      HACMP Certified (000-102)

Organisational Experience:

XYZ Pvt Ltd (since xyz)

Client: ZXY

Project Overview:
  1. IBM Maintains 262 AIX servers including Production & DRS.
  2. Hardware details  :
          P520, P550, P570, P590, P_7 , SAN switches, DS8300, DS8800, & XIV  and 3584 Libraries makes the environment truly enterprise and challenging.

 Designation:  AIX System Administrator

Administration Role:

v     Tracking and Co-ordination of server incidents / problems till resolution.
v     MIS Reports / Documentation, Generate and share the reports as defined
v     Updating and approving checklists to ensure latest checklists are followed by team.
v     P-6 to p-7 hardware migration.
v     Storage Migration: DS8100 to Ds8800 & XIV using migrate pv, mklvcopy command.
v     Cluster: Managing the cluster with automated Db2 script zero down time in case failure & fallback in Production Environment.
v     Cluster Files system expansion 
v     Administration of clusters/HACMP ( Total 8 cluster - Active/Passive, Mutual )
v     Daily report generation on Systems.(CPU utilization,Nmon,vmstat,Iostat)
v      AIX OS hardening, File system creation and management, User’s addition and removal.
v     Managing LUNs, VGs, FS, LVs, etc.
v     Taking MKSYSB Backup (Monthly basis)
v     User’s administration and System performance monitoring
v     OS ML/TL up gradation and patch management
v     Managing TSM server and tape library ensuring reliable daily backups of all servers
v     Taking backup when required and restoring, monitoring scheduled backup






Client: XYZ

Project Overview:
It contains 440 AIX boxes comprising – Blade Server, P520, P550, P570, P590, FHA,. SAN switches, DS8300 and 3584 Libraries makes the environment truly enterprise and challenging.

 Designation:  AIX System Administrator

v     Administration Role:
v     Adding/Removing and upgrading resources(Memory, Processor disk and tape) among DLPARs
v     Resource groups movement, Cluster fail over, Cluster fail back, stopping and starting cluster services, analysis of cluster logs, cluster backup and monitoring
v     Administration of clusters/HACMP ( Total 4 cluster - Active/Passive, Mutual )
v     Managing LUNs, VGs, FS, LVs, etc.
v     Users administration and System performance monitoring
v     Hardware firmware,  OS ML/TL up gradation and patch management
v     Migration of Servers from AIX 5.3 to AIX 6.1
v     Managing TSM server and tape library ensuring reliable daily backups of all servers
v     Taking backup when required and restoring, monitoring scheduled backup
v     Taking  Flashcopy for data replication between systems on the DS8300
v     Helping Team Lead and Project Manager in preparation of several reports – weekly and monthly server utilisation and uptime reports, backup reports, ad-hoc reports, etc
v     Administration of Metro Global Mirror (MGM) replication between Primary Site, Near Site and DR site.

Tivoli Storage Manager (TSM Administrator).

v     Installation and Configuration of IBM Tivoli 6.1 on AIX Server.
v     Based of client requirement planning of Backup & Archive policies.
v     Providing solutions on backup and restoration related problems.
v     According to Client requirement set the backup procedures for various servers.
v     Installation & Configuring TSM backup Clients.
v     Installation & Configuration of ISC Console for TSM administration.
v     Troubleshooting with any kind of backup related issues.
v     Taking a cold backup and flash copy in a Daily basis.
v     Troubleshooting with any kind of tape Library related issues.

Previous Employer: XYZ Technologies Limited.
Duration:zyx ’2004 to yzx

Designation:  Systems Engineer.
                                
JOB PROFILE:
v      
v     User management activity and group access in the Active directory environment
v      Administering DNS,  Win2003 DC Active Directory.
v     Installing & Configuring of Network printers.
v     Installation and maintenance of LAN and standalone systems and peripherals.
v     Giving support to all kind of Internet and intranet solutions.

Previous Employer: XYZ Technologies Pvt Ltd
Duration: Jan xyz  to Julyxyz
Designation:  Systems Engineer
Job Profile:
Ø      Giving support to customer calls area like OS, Networking etc
Ø      Support on various hardware like HP & IBM Desktops printers .Etc.
Ø      Antivirus Installation and configuration on client side
Ø      Responsible for handling all Desktop level problems
Ø      Responsible for handling all printer related problems

EDUCATION:

ABOUT ME:

Father’s Name                         :       
Date of Birth                                   :          
Contact number                                     :         
Passport Number                      :        
Passport Exp Date                     :        

Regards,
xyz

Monday, August 6, 2012

Shell scripting training in (Thane) Mumbai


As I mentioned that I am collecting information of good training institutes for AIX shell scripting, Perl, HACMP and VIO.
I found below details of shell scripting course in Thane Mumbai.

Bash Shell Scripting

  Shell Scripting Course is specifically designed to develop skills required for   automation on Unix / Linux Environment. This course focuses on the basic and intermediate level of Scripting. It provides training with hands on session to administer the UNIX shell.

Suitable for:

     * Linux Administrators
     * UNIX Administrators/programmers
     * Database (Oracle/Sybase)developers working on UNIX platforms
     * Database (Oracle/Sybase)Administrators

 Prerequisites:

     * Knowledge in Unix / Linux Platform
     * Basic Knowledge in Shell Commands
     * Any Programming language

 

 Course Contents:

     .       Bash and Bash scripts
.       Common shell programs
.       Advantages of the Shell
.       Executing commands
.       Building blocks
.       Developing good scripts


.       Writing and debugging scripts
.       Creating and running a script
.       Script basics
.       Debugging Bash scripts


.       Shell initialization files
.       Variables
.       Quoting characters
.       Shell expansion
.       Aliases
.       More Bash options

.       Regular expression
.       Regular expression
.       Examples using grep
.       Pattern matching using Bash features



.       Important Shell Utilities
.       cut
.       sed, tr
.       find
.       sort
.       grep, egrep, fgrep
.       awk


.       Conditional statements
.       Introduction to .if.
.       More advanced .if. usage
.       Using case statements



.       Writing interactive scripts
.       Displaying user messages
.       Catching user input



.       Repetitive tasks
.       The for loop
.       The while loop
.       The until loop
.       I/O redirection and loops
.       Break and continue

.       Making menus with the select built .in
.       The shift built in
.       More on variables
.       Types of variables
.       Array variables
.       Operation on variables



.       Function
.       Introduction
.       Examples of function in scripts
.       Passing arguments to functions
.       Scope of variable in functions - local & global



.       Catching signals
.       Signals
.       Traps

Please drop a mail to unix4you.com@gmail.com for more information.

Friday, July 27, 2012

Prechecks.sh shell script example for sysadmin

Someone from my team asked me to write something which will create a report before any SAN uplift and one for post checks also.

and I started adding bits to it as below,


# cat prechecks.sh
#!/usr/bin/ksh
clear
echo "\n"
chk(){
if [ $1 -ne 0 ]
then
echo "$clstr cluster is not installed here\n"
else
echo "$clstr cluster is installed here,Please consider"
fi
}

echo " Script to run before going for SAN uplift just to understand all configuration"

echo "\tSERVER NAME :\t`uname -n`\n\n"
echo "\t\t\tTOTAL VG's  :\t\n`lsvg`\n\n"
echo "\t\t\tTATAL ACTIVE VG's:\t\n`lsvg -o`\n\n"
for i in `lsvg -o`
do
echo "\t\t\tDETAILED INFO OF $i:\n `lsvg $i`\n\n"
for j in `lsvg -p $i|grep hdisk|awk '{print $1}'`
do
#echo "\t\t\tDETAILED INFO OF $i:\n `lsvg $i`\n\n"
echo "\t\t\tATTRIBUTES OF $j:\n"
lsattr -El $j|egrep -e 'queue_depth|reserve_policy'|awk '{print $1": " $2}'
echo "\n\n"
done
done
clstr="HACMP"
/usr/es/sbin/cluster/utilities/clRGinfo 2>/dev/null
ar=`echo $?`
chk $ar
#echo "\n"
clstr="GPFS"
/usr/lpp/mmfs/bin/mmlscluster 2>/dev/null
ar=`echo $?`
chk $ar
exit 0

Hope this will help you!

Wednesday, July 18, 2012

Script to list permission of all directories in given path

I got a task to list all permissions of all directories in the give path , there were arround ( very long )80 paths.
wrote below for loop and it's become very easy :)

Script to list permission of all directories in given path.

# cat perm.sh
cd /
for i in `echo $1|sed "s/\// /g"`
do
ls -ld $i
cd $i
done

# ./perm.sh /opt/Tivoli/DM/slam
drwxr-xr-x   26 root     system         4096 Aug 18 2011  opt
drwxr-xr-x    9 root     system          256 Mar 19 2010  Tivoli
drwxr-xr-x   11 root     system         4096 Aug  5 2010  DM
drwxr-xr-x    2 root     system          256 Nov 24 2009  slam
#
 

Thursday, July 5, 2012

Transform into IT - Jobs for MCA,BE and BPO guys!


Does my Degree and Marks matters?

Best way to reduce all extra effort to the get job is college campus placement but if you missed it then it will be the biggest pain to get a good job in market even if you hold good degree and marks.

Very few (Indian) companies will ask you about your marks others want there work done, so in simple word if you know how to work they will take you in even if you are a graduates of any stream they don’t care (why should they?).
Very practical approach towards hiring they don’t want very intelligent guys too as intelligent guys will not obey instructions from (sometimes foolish) Managers and they may not stay longer in the same organization with small salaries so they want someone who don’t have capability to fly but just to do the same work again and again.

Entering into IT is not big thing if one knows how to do it?

Unfortunately all guys who have completed their BE/MCA/BCS or any computer course they want to become developer (either a java or .net).
Where as IT does not mean development only there are many roles and positions in support functions too.
And it’s easy to enter in support function if you compare with development.
Industry is still looking for 1000s of expert support guys to support huge infrastructure.
Now what are the titles of support jobs?
It’s nothing but infra analyst OR system engineer, sound  general position but roles may vary like DBA, System administrator, Storage administrator, etc.
You must be having a question in your mind - How to enter in to support functions?

It’s pretty easy just learn something like UNIX, Linux, Oracle, Storage, Shell scripting, Perl scripting and you will get a good consideration and response from IT industry.

There are thousands of guys who are working with BPO’s with degree in computer science

Yes I have seen guys they will hide their education (master degree) to get job in BPO as they don’t hire PG / BE guys.

BPO is good to support initially just for survival in a metro cities so at least you can search for good job in IT.
Unfortunately more than 70% of BPO joiners would not succeed to transform them in to IT once they have joined BPO (as BPO can pay your bills and gives you comfort).
BPO guys can communicate well as this is what they do whole day.
So if one try to acquire any support skill there are hug chances of getting job in IT definitely they would need someone to guide them.
But this comfort zone becomes a weakness and they start accepting things.

I am sure I can help if you want to transform your life and role! Please send a mail to unix4you.com@gmail.com and I will try to help you in all possible ways.

Thanks,
Dipak
(This article is about how to switch job from BPO to IT? and Jobs for MCA? jobs for BE?)
(I love teaching I am thinking of starting shell scripting , basic unix classes for free. soon I will update once I have server and other setup  )

Wednesday, July 4, 2012

How to become master in HACMP ?


When I asked this question to the most senior guy in my organization, he simply said it’s not something which not written somewhere we have everything given we don’t use it and just try to find out the shortcut to become a master.
Mastery will never come using shortcuts.
You may get an offer or pass an interview but you would not be able to get the satisfaction of doing it truly.
If you want to become a master of any technology just read all given publication by them so here I would suggest you to go through below all guides to become HACMP guy and after that you will never come to me asking for something for HACMP (in this case).
And he gave all below references

HACMP for AIX: Administration Guide, SC23-4862
HACMP for AIX: Concepts and Facilities Guide, SC23-4864
HACMP for AIX: Installation Guide, SC23-5209
HACMP for AIX: Master Glossary, SC23-4867
HACMP for AIX: Planning Guide, SC23-4861
HACMP for AIX: Programming Client Applications, SC23-4865
HACMP for AIX: Troubleshooting Guide, SC23-5177
HACMP on Linux: Installation and Administration Guide, SC23-5211
HACMP for AIX: Smart Assist Developer's Guide, SC23-5210

It’s guilt in my heart that I am not at all using the power I have. Do you think so?
Just start doing what you understand now, I too started it! 
                                                                  - Dipak Warade

Thursday, June 28, 2012

Important things you should not miss!



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

Popular Posts

Is this site helping you ?