UnixPedia : HPUX / LINUX / SOLARIS: February 2015

Saturday, February 7, 2015

HPUX : there is no communication with OVO mgmt. server

server an issue with port 383, there is no communication with OVO mgmt. server

[root@tcscar4:/.root]#
#-> /opt/OV/bin/opcagt -status
scopeux     Perf Agent data collector                        (3563)   Running
midaemon    Measurement Interface daemon                     (3584)   Running
ttd         ARM registration daemon                          (3467)   Running
perfalarm   Alarm generator                                           Stopped
perfd       real time server                                 (3696)   Running
(ctrl-111) Ovcd is not yet started.
Could not contact Message Agent to query buffering state.
[root@tcscar4:/.root]#
#->
[root@tcscar4:/.root]#
#-> /opt/OV/bin/opcagt -cleanstart
(ctrl-111) Ovcd is not yet started.
[root@tcscar4:/.root]#
#-> whereis Ovcd
Ovcd:
[root@tcscar4:/.root]#
#-> /opt/OV/bin/opcagt -status
scopeux     Perf Agent data collector                        (13060)  Running
midaemon    Measurement Interface daemon                     (12930)  Running
ttd         ARM registration daemon                          (3467)   Running
perfalarm   Alarm generator                                  (13077)  Running
perfd       real time server                                 (12919)  Running
coda        OV Performance Core                 COREXT       (12939)  Running
opcacta     OVO Action Agent                    AGENT,EA     (12957)  Running
opcle       OVO Logfile Encapsulator            AGENT,EA     (12961)  Running
opcmona     OVO Monitor Agent                   AGENT,EA     (12963)  Running
opcmsga     OVO Message Agent                   AGENT,EA     (12948)  Running
opcmsgi     OVO Message Interceptor             AGENT,EA     (12959)  Running
ovbbccb     OV Communication Broker             CORE         (12933)  Running
ovcd        OV Control                          CORE         (12932)  Running
ovconfd     OV Config and Deploy                COREXT       (12934)  Running
Message Agent is not buffering.
[root@tcscar4:/.root]#

Wednesday, February 4, 2015

How to Create rename a volume group in LVM



#-> vgdisplay -v /dev/vg_test
--- Volume groups ---
VG Name                     /dev/vg_test
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      0     
Open LV                     0     
Max PV                      255   
Cur PV                      4     
Act PV                      4     
Max PE per PV               10000       
VGDA                        8  
PE Size (Mbytes)            128            
Total PE                    1596   
Alloc PE                    0      
Free PE                     1596   
Total PVG                   1       
Total Spare PVs             0             
Total Spare PVs in use      0                    
VG Version                  1.0      
VG Max Size                 318750g   
VG Max Extents              2550000      


   --- Physical volumes ---
   PV Name                     /dev/disk/disk68
   PV Status                   available               
   Total PE                    399    
   Free PE                     399    
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/disk/disk72
   PV Status                   available               
   Total PE                    399    
   Free PE                     399    
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/disk/disk73
   PV Status                   available               
   Total PE                    399    
   Free PE                     399    
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/disk/disk66
   PV Status                   available               
   Total PE                    399    
   Free PE                     399    
   Autoswitch                  On       
   Proactive Polling           On              


   --- Physical volume groups ---
   PVG Name                    PVG001
   PV Name                     /dev/disk/disk68
   PV Name                     /dev/disk/disk72
   PV Name                     /dev/disk/disk73
   PV Name                     /dev/disk/disk66



#-> vgdisplay /dev/vg_test
--- Volume groups ---
VG Name                     /dev/vg_test
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      0     
Open LV                     0     
Max PV                      255   
Cur PV                      4     
Act PV                      4     
Max PE per PV               10000       
VGDA                        8  
PE Size (Mbytes)            128            
Total PE                    1596   
Alloc PE                    0      
Free PE                     1596   
Total PVG                   1       
Total Spare PVs             0             
Total Spare PVs in use      0                    
VG Version                  1.0      
VG Max Size                 318750g   
VG Max Extents              2550000      


#-> #Rename the vg vg_test to vg_original

#-> vgexport -s -v -m vg_test.mapfile vg_test
Beginning the export process on Volume Group "vg_test".
vgexport: Volume group "vg_test" is still active.
vgexport: Couldn't export volume group "vg_test".

#-> ll vg_test.mapfile
vg_test.mapfile not found

#-> vgexport -p -s -v -m vg_test.mapfile vg_test
Beginning the export process on Volume Group "vg_test".
vgexport: Volume group "vg_test" is still active.
/dev/disk/disk68
/dev/disk/disk72
/dev/disk/disk73
/dev/disk/disk66
vgexport: Preview of vgexport on volume group "vg_test" succeeded.

Deactivate the volume group by entering the following command

#-> vgchange -a n vg_test
Volume group "vg_test" has been successfully changed.


If you want to retain the same minor number for the volume group, examine the volume group's
group file as follows

#-> ll /dev/vg_test/group
crw-r--r--   1 root       sys         64 0x280000 Jul  8 08:20 /dev/vg_test/group


Remove the volume group device files and its entry from the LVM configuration files by entering
the following command:
#-> vgexport vg_test
Physical volume "/dev/disk/disk68" has been successfully deleted from
physical volume group "PVG001".
Physical volume "/dev/disk/disk72" has been successfully deleted from
physical volume group "PVG001".
Physical volume "/dev/disk/disk73" has been successfully deleted from
physical volume group "PVG001".
Physical volume "/dev/disk/disk66" has been successfully deleted from
physical volume group "PVG001".
vgexport: Volume group "vg_test" has been successfully removed.

#-> mkdir /dev/vg_original

#-> mknod /dev/vg_original/group c 64 0x280000

#-> vgimport -s -v -m vg_test.mapfile /dev/vg_original
The legacy naming model has been disabled on the system.
Try with the -N option.

Add the volume group entry back to the LVM configuration files using the vgimport command
as follows use new volume group name to import the information:

#-> vgimport -s -v -N -m vg_test.mapfile /dev/vg_original
Beginning the import process on Volume Group "/dev/vg_original".
vgimport: Volume group "/dev/vg_original" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

Activate the newly imported volume group as follows:

#-> vgdisplay /dev/vg_original
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg_original".

#-> vgchange -a y /dev/vg_original
Activated volume group.
Volume group "/dev/vg_original" has been successfully changed.

#-> vgdisplay /dev/vg_original
--- Volume groups ---
VG Name                     /dev/vg_original
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      0     
Open LV                     0     
Max PV                      255   
Cur PV                      4     
Act PV                      4     
Max PE per PV               10000       
VGDA                        8  
PE Size (Mbytes)            128            
Total PE                    1596   
Alloc PE                    0      
Free PE                     1596   
Total PVG                   0       
Total Spare PVs             0             
Total Spare PVs in use      0                    
VG Version                  1.0      
VG Max Size                 318750g   
VG Max Extents              2550000   

Back up the volume group configuration as follows
#-> vgcfgbackup   /dev/vg_original

How to Create a Stripe - logical Volume File System in LVM


1.    Determine the disk's associated device file. To show the disks attached to the system and their
device file names, enter the ioscan command with the -f, -N, and -n options.

#-> cat >ldev
6D:6F
6D:70
6D:71
6D:72

Execute the xpinfo to collect the ldev and array information.
#/usr/contrib/bin/xpinfo    -il   >xpinfo.out

#collect
#-> cat ldev|while read i
> do
> cat xpout.info |grep -i $i |grep -i 66657
> done
/dev/rdisk/disk68            d1  --- 9e  CL6R  6d:6f  OPEN-V           00066657
/dev/rdisk/disk72            d1  --- 9f  CL6R  6d:70  OPEN-V           00066657
/dev/rdisk/disk73            dc  --- a0  CL5R  6d:71  OPEN-V           00066657
/dev/rdisk/disk66            dc  --- a1  CL5R  6d:72  OPEN-V           00066657

#-> cat >rdisk
/dev/rdisk/disk68
/dev/rdisk/disk72
/dev/rdisk/disk73
/dev/rdisk/disk66

Once disk are sure that not part of any lvm configuration.
#-> strings /etc/lvmtab|grep -iE "disk68|disk72|disk73|disk66"

#-> cat rdisk |sed  "s/rdisk/disk/" |while read i
> do
> strings /etc/lvmtab |grep -w $i
> done

#-> cat rdisk |sed  "s/rdisk/disk/" |while read i
> do
> pvdisplay $i
> done
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk68" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk68".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk72" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk72".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk73" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk73".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk66" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk66".

#-> cat rdisk |while read i
> do
> pvcreate $i
> done
Physical volume "/dev/rdisk/disk68" has been successfully created.
Physical volume "/dev/rdisk/disk72" has been successfully created.
Physical volume "/dev/rdisk/disk73" has been successfully created.
Physical volume "/dev/rdisk/disk66" has been successfully created.


2.     Create a directory for the volume group. For example:
# mkdir /dev/vgname
#mkdir /dev/vg_testdata

By convention, vgname is vgnn, where nn is a unique number across all volume groups.
However, you can choose any unique name up to 255 characters.   

3.     Create a device file named group in the volume group directory with the mknod command.
For example:

# mknod /dev/vgname/group c major 0xminor

#-> mknod  /dev/vg_test/group c 64  0x280000

The c following the device file name specifies that group is a character device file.
major is the major number for the group device file. For a Version 1.0 volume group, it is
64. For a Version 2.x volume group, it is 128.
  
4.    To create a Version 1.0 volume group, use the vgcreate command, specifying each physical
volume to be included. For example:

#->cp -p /etc/lvmab  /etc/lvmab.mmddyyyy

#-> vgcreate  /dev/vg_test /dev/disk/disk68 /dev/disk/disk72 /dev/disk/disk73 /dev/disk/disk66
Increased the number of physical extents per phy
sical volume to 12800.
Volume group "/dev/vg_test" has been successfully created.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

You can set volume group attributes using the following options:
-V 1.0 Version 1.0 volume group (default)
-s pe_size Size of a physical extent in MB (default 4)
-e max_pe Maximum number of physical extents per physical volume (default 1016)
-l max_lv Maximum number of logical volumes (default 255)
-p max_pv Maximum number of physical volumes (default 255)
The size of a physical volume is limited by pe_size times max_pe. If you plan to assign a disk
larger than approximately 4 GB (1016 * 4 MB) to this volume group, use a larger value of pe_size
or max_pe.

#-> vgcreate -l 255 -p 255 -s 128 -e 10000 /dev/vg_test /dev/disk/disk68
Volume group "/dev/vg_test" has been successfully created.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

Check the attribute of Volume group:
#-> vgdisplay  /dev/vg_test
--- Volume groups ---
VG Name                     /dev/vg_test
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      0
Open LV                     0
Max PV                      16
Cur PV                      4
Act PV                      4
Max PE per PV               12800
VGDA                        8
PE Size (Mbytes)            4
Total PE                    51196
Alloc PE                    0
Free PE                     51196
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 800g
VG Max Extents              204800
   
5.    Add the physical volume to the volume group using the vgextend command and the block
 file for the disk. For example:

#-> vgextend /dev/vg_test /dev/disk/disk72 /dev/disk/disk73 /dev/disk/disk66
Volume group "/dev/vg_test" has been successfully extended.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

#-> vgdisplay -v /dev/vg_test
--- Volume groups ---
VG Name                     /dev/vg_test
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      0
Open LV                     0
Max PV                      16
Cur PV                      4
Act PV                      4
Max PE per PV               12800
VGDA                        8
PE Size (Mbytes)            4
Total PE                    51196
Alloc PE                    0
Free PE                     51196
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 800g
VG Max Extents              204800

   --- Physical volumes ---
   PV Name                     /dev/disk/disk68
   PV Status                   available
   Total PE                    12799
   Free PE                     12799
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk72
   PV Status                   available
   Total PE                    12799
   Free PE                     12799
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk73
   PV Status                   available
   Total PE                    12799
   Free PE                     12799
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk66
   PV Status                   available
   Total PE                    12799
   Free PE                     12799
   Autoswitch                  On
   Proactive Polling           On

6.    To create a logical volume, follow these steps:
6.1    Decide how much disk space the logical volume needs. Calculate the size of the LV and decide the name of  LV : example:

#->  lvcreate -i 4 -I  128 -n Lv_test /dev/vg_test
Logical volume "/dev/vg_test/Lv_test" has been successfully created with
character device "/dev/vg_test/rLv_test".
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

6.2    Allocate 1GB to   the logical volume

#-> lvextend -L 1024M /dev/vg_test/Lv_test
Logical volume "/dev/vg_test/Lv_test" has been successfully extended.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

#-> lvdisplay /dev/vg_test/Lv_test
--- Logical volumes ---
LV Name                     /dev/vg_test/Lv_test
VG Name                     /dev/vg_test
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               0
Consistency Recovery        MWC
Schedule                    striped
LV Size (Mbytes)            1024
Current LE                  8
Allocated PE                8
Stripes                     4
Stripe Size (Kbytes)        128
Bad block                   on
Allocation                  strict
IO Timeout (Seconds)        default


7.    To create a logical volume run newfs to raw lv

#-> newfs -F vxfs -o largefiles -b 8192 /dev/vg_test/rLv_test
   version 7 layout
   1048576 sectors, 131072 blocks of size 8192, log size 2048 blocks
   largefiles supported
8.    Check the type of file system. For example:
#-> /usr/sbin/fstyp  /dev/vg_test/rLv_test
             Vxfs
      #-> /usr/sbin/fstyp -v /dev/vg_test/rLv_test
vxfs
version: 7
f_bsize: 8192
f_frsize: 8192
f_blocks: 131072
    f_bfree: 128863
    f_bavail: 127857
    f_files: 32224
    f_ffree: 32192
    f_favail: 32192
    f_fsid: 1076363265
    f_basetype: vxfs
    f_namemax: 254
    f_magic: a501fcf5
    f_featurebits: 0
    f_flag: 16
    f_fsindex: 10
    f_size: 131072

9.    Create a mount point for mouting of Logical Volume.
#mkdir /oracle/Test

10.    Mount /dev/vg_test/Lv_test on /oracle/Test with correct option as per performance guidelines.
#-> mount  /dev/vg_test/Lv_test /test

#-> bdf /test
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg_test/Lv_test
                   1048576   17672 1022864    2% /test
11.    Check the mount option from mnttab.
#-> mount -v |grep -i test
/dev/vg_test/Lv_test on /test type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40280001 on Tue Jul  8 08:57:31 2014

12.    Check the load balancing for the disk

For 11iv3 systems make sure the load balance policy is also set on the newly added disk:
Verify LB policy: scsimgr -p get_attr all_lun -a device_file -a load_bal_policy
Set LB policy on all disks: scsimgr save_attr -N "/escsi/esdisk" -a load_bal_policy=<LB policy>
Set LB policy on one disk :  scsimgr save_attr -D /dev/rdisk/disk530 -a load_bal_policy=<LB policy>

How to Create a Strict-Distributed- logical Volume File System in LVM


1.    Determine the disk's associated device file. To show the disks attached to the system and their
device file names, enter the ioscan command with the -f, -N, and -n options.
#-> cat >ldev
6D:6F
6D:70
6D:71
6D:72

Execute the xpinfo to collect the ldev and array information.
#/usr/contrib/bin/xpinfo    -il   >xpinfo.out

#collect
#-> cat ldev|while read i
> do
> cat xpout.info |grep -i $i |grep -i 66657
> done
/dev/rdisk/disk68            d1  --- 9e  CL6R  6d:6f  OPEN-V           00066657
/dev/rdisk/disk72            d1  --- 9f  CL6R  6d:70  OPEN-V           00066657
/dev/rdisk/disk73            dc  --- a0  CL5R  6d:71  OPEN-V           00066657
/dev/rdisk/disk66            dc  --- a1  CL5R  6d:72  OPEN-V           00066657

#-> cat >rdisk
/dev/rdisk/disk68
/dev/rdisk/disk72
/dev/rdisk/disk73
/dev/rdisk/disk66

Once disk are sure that not part of any lvm configuration.
#-> strings /etc/lvmtab|grep -iE "disk68|disk72|disk73|disk66"

#-> cat rdisk |sed  "s/rdisk/disk/" |while read i
> do
> strings /etc/lvmtab |grep -w $i
> done

#-> cat rdisk |sed  "s/rdisk/disk/" |while read i
> do
> pvdisplay $i
> done
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk68" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk68".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk72" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk72".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk73" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk73".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk66" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk66".

#-> cat rdisk |while read i
> do
> pvcreate $i
> done
Physical volume "/dev/rdisk/disk68" has been successfully created.
Physical volume "/dev/rdisk/disk72" has been successfully created.
Physical volume "/dev/rdisk/disk73" has been successfully created.
Physical volume "/dev/rdisk/disk66" has been successfully created.


2.     Create a directory for the volume group. For example:
# mkdir /dev/vgname
#mkdir /dev/vg_testdata

By convention, vgname is vgnn, where nn is a unique number across all volume groups.
However, you can choose any unique name up to 255 characters.   

3.     Create a device file named group in the volume group directory with the mknod command.
For example:

# mknod /dev/vgname/group c major 0xminor

#-> mknod  /dev/vg_test/group c 64  0x280000

The c following the device file name specifies that group is a character device file.
major is the major number for the group device file. For a Version 1.0 volume group, it is
64. For a Version 2.x volume group, it is 128.
  
4.    To create a Version 1.0 volume group, use the vgcreate command, specifying each physical
volume to be included. For example:

#->cp -p /etc/lvmpvg /etc/lvmpvg.mmddyyyy
#->cp –p /etc/lvmab  /etc/lvmab.mmddyyyy

#-> vgcreate  /dev/vg_test /dev/disk/disk68 /dev/disk/disk72 /dev/disk/disk73 /dev/disk/disk66
Increased the number of physical extents per phy
sical volume to 12800.
Volume group "/dev/vg_test" has been successfully created.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

You can set volume group attributes using the following options:
-V 1.0 Version 1.0 volume group (default)
-s pe_size Size of a physical extent in MB (default 4)
-e max_pe Maximum number of physical extents per physical volume (default 1016)
-l max_lv Maximum number of logical volumes (default 255)
-p max_pv Maximum number of physical volumes (default 255)
The size of a physical volume is limited by pe_size times max_pe. If you plan to assign a disk
larger than approximately 4 GB (1016 * 4 MB) to this volume group, use a larger value of pe_size
or max_pe.

#-> vgcreate -l 255 -p 255 -s 128 -e 10000 /dev/vg_test /dev/disk/disk68
Volume group "/dev/vg_test" has been successfully created.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

Check the attribute of Volume group:
#-> vgdisplay  /dev/vg_test
--- Volume groups ---
VG Name                     /dev/vg_test
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      0
Open LV                     0
Max PV                      16
Cur PV                      4
Act PV                      4
Max PE per PV               12800
VGDA                        8
PE Size (Mbytes)            4
Total PE                    51196
Alloc PE                    0
Free PE                     51196
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 800g
VG Max Extents              204800
   
5.    Add the physical volume to the volume group using the vgextend command and the block
 file for the disk. For example:

#-> vgextend /dev/vg_test /dev/disk/disk72 /dev/disk/disk73 /dev/disk/disk66
Volume group "/dev/vg_test" has been successfully extended.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

To create a PVG :

#vgextend -g PVG001 /dev/vg_test /dev/disk/disk68 /dev/disk/disk72 /dev/disk/disk73 /dev/disk/disk66
#-> vgdisplay -v /dev/vg_test
--- Volume groups ---
VG Name                     /dev/vg_test
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      0
Open LV                     0
Max PV                      255
Cur PV                      4
Act PV                      4
Max PE per PV               10000
VGDA                        8
PE Size (Mbytes)            128
Total PE                    1596
Alloc PE                    0
Free PE                     1596
Total PVG                   1
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 318750g
VG Max Extents              2550000


   --- Physical volumes ---
   PV Name                     /dev/disk/disk68
   PV Status                   available
   Total PE                    399
   Free PE                     399
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk72
   PV Status                   available
   Total PE                    399
   Free PE                     399
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk73
   PV Status                   available
   Total PE                    399
   Free PE                     399
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk66
   PV Status                   available
   Total PE                    399
   Free PE                     399
   Autoswitch                  On
   Proactive Polling           On


   --- Physical volume groups ---
   PVG Name                    PVG001
   PV Name                     /dev/disk/disk68
   PV Name                     /dev/disk/disk72
   PV Name                     /dev/disk/disk73
   PV Name                     /dev/disk/disk66

6.    To create a logical volume, follow these steps:
6.1    Decide how much disk space the logical volume needs. Calculate the size of the LV and decide the name of  LV : example:

#-> lvcreate -D y -s g -n Lv_test /dev/vg_test
Logical volume "/dev/vg_test/Lv_test" has been successfully created with
character device "/dev/vg_test/rLv_test".
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf


6.2    Allocate 1GB to   the logical volume

#-> lvextend -L 1024M /dev/vg_test/Lv_test PVG001
Logical volume "/dev/vg_test/Lv_test" has been successfully extended.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf


#-> lvdisplay /dev/vg_test/Lv_test
--- Logical volumes ---
LV Name                     /dev/vg_test/Lv_test
VG Name                     /dev/vg_test
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               0
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            1024
Current LE                  8
Allocated PE                8
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  PVG-strict/distributed
IO Timeout (Seconds)        default



7.    To create a logical volume run newfs to raw lv

#-> newfs -F vxfs -o largefiles -b 8192 /dev/vg_test/rLv_test
   version 7 layout
   1048576 sectors, 131072 blocks of size 8192, log size 2048 blocks
   largefiles supported
8.    Check the type of file system. For example:
#-> /usr/sbin/fstyp  /dev/vg_test/rLv_test
             Vxfs
      #-> /usr/sbin/fstyp -v /dev/vg_test/rLv_test
vxfs
version: 7
f_bsize: 8192
f_frsize: 8192
f_blocks: 131072
    f_bfree: 128863
    f_bavail: 127857
    f_files: 32224
    f_ffree: 32192
    f_favail: 32192
    f_fsid: 1076363265
    f_basetype: vxfs
    f_namemax: 254
    f_magic: a501fcf5
    f_featurebits: 0
    f_flag: 16
    f_fsindex: 10
    f_size: 131072

9.    Create a mount point for mouting of Logical Volume.
#mkdir /oracle/Test

10.    Mount /dev/vg_test/Lv_test on /oracle/Test with correct option as per performance guidelines.
#-> mount  /dev/vg_test/Lv_test /test

#-> bdf /test
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg_test/Lv_test
                   1048576   17672 1022864    2% /test
11.    Check the mount option from mnttab.
#-> mount -v |grep -i test
/dev/vg_test/Lv_test on /test type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40280001 on Tue Jul  8 08:57:31 2014

12.    Check the load balancing for the disk

For 11iv3 systems make sure the load balance policy is also set on the newly added disk:
Verify LB policy: scsimgr -p get_attr all_lun -a device_file -a load_bal_policy
Set LB policy on all disks: scsimgr save_attr -N "/escsi/esdisk" -a load_bal_policy=<LB policy>
Set LB policy on one disk :  scsimgr save_attr -D /dev/rdisk/disk530 -a load_bal_policy=<LB policy>

How to Create a Strict - logical Volume File System in LVM


1.    Determine the disk's associated device file. To show the disks attached to the system and their
device file names, enter the ioscan command with the -f, -N, and -n options.


#-> cat >ldev
6D:6F
6D:70
6D:71
6D:72

Execute the xpinfo to collect the ldev and array information.
#/usr/contrib/bin/xpinfo    -il   >xpinfo.out

#collect
#-> cat ldev|while read i
> do
> cat xpout.info |grep -i $i |grep -i 66657
> done
/dev/rdisk/disk68            d1  --- 9e  CL6R  6d:6f  OPEN-V           00066657
/dev/rdisk/disk72            d1  --- 9f  CL6R  6d:70  OPEN-V           00066657
/dev/rdisk/disk73            dc  --- a0  CL5R  6d:71  OPEN-V           00066657
/dev/rdisk/disk66            dc  --- a1  CL5R  6d:72  OPEN-V           00066657

#-> cat >rdisk
/dev/rdisk/disk68
/dev/rdisk/disk72
/dev/rdisk/disk73
/dev/rdisk/disk66

Once disk are sure that not part of any lvm configuration.
#-> strings /etc/lvmtab|grep -iE "disk68|disk72|disk73|disk66"

#-> cat rdisk |sed  "s/rdisk/disk/" |while read i
> do
> strings /etc/lvmtab |grep -w $i
> done

#-> cat rdisk |sed  "s/rdisk/disk/" |while read i
> do
> pvdisplay $i
> done
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk68" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk68".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk72" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk72".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk73" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk73".
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/disk/disk66" belongs.
pvdisplay: Cannot display physical volume "/dev/disk/disk66".

#-> cat rdisk |while read i
> do
> pvcreate $i
> done
Physical volume "/dev/rdisk/disk68" has been successfully created.
Physical volume "/dev/rdisk/disk72" has been successfully created.
Physical volume "/dev/rdisk/disk73" has been successfully created.
Physical volume "/dev/rdisk/disk66" has been successfully created.


2.     Create a directory for the volume group. For example:
# mkdir /dev/vgname
#mkdir /dev/vg_testdata

By convention, vgname is vgnn, where nn is a unique number across all volume groups.
However, you can choose any unique name up to 255 characters.   

3.     Create a device file named group in the volume group directory with the mknod command.
For example:

# mknod /dev/vgname/group c major 0xminor

#-> mknod  /dev/vg_test/group c 64  0x280000

The c following the device file name specifies that group is a character device file.
major is the major number for the group device file. For a Version 1.0 volume group, it is
64. For a Version 2.x volume group, it is 128.
  
4.    To create a Version 1.0 volume group, use the vgcreate command, specifying each physical
volume to be included. For example:

#-> vgcreate  /dev/vg_test /dev/disk/disk68 /dev/disk/disk72 /dev/disk/disk73 /dev/disk/disk66
Increased the number of physical extents per phy
sical volume to 12800.
Volume group "/dev/vg_test" has been successfully created.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

You can set volume group attributes using the following options:
-V 1.0 Version 1.0 volume group (default)
-s pe_size Size of a physical extent in MB (default 4)
-e max_pe Maximum number of physical extents per physical volume (default 1016)
-l max_lv Maximum number of logical volumes (default 255)
-p max_pv Maximum number of physical volumes (default 255)
The size of a physical volume is limited by pe_size times max_pe. If you plan to assign a disk
larger than approximately 4 GB (1016 * 4 MB) to this volume group, use a larger value of pe_size
or max_pe.

#-> vgcreate -l 255 -p 255 -s 128 -e 10000 /dev/vg_test /dev/disk/disk68
Volume group "/dev/vg_test" has been successfully created.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

Check the attribute of Volume group:
#-> vgdisplay  /dev/vg_test
--- Volume groups ---
VG Name                     /dev/vg_test
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      0
Open LV                     0
Max PV                      16
Cur PV                      4
Act PV                      4
Max PE per PV               12800
VGDA                        8
PE Size (Mbytes)            4
Total PE                    51196
Alloc PE                    0
Free PE                     51196
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 800g
VG Max Extents              204800
   
5.    Add the physical volume to the volume group using the vgextend command and the block
 file for the disk. For example:

#-> vgextend /dev/vg_test /dev/disk/disk72 /dev/disk/disk73 /dev/disk/disk66
Volume group "/dev/vg_test" has been successfully extended.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

#-> vgdisplay -v /dev/vg_test
--- Volume groups ---
VG Name                     /dev/vg_test
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      0
Open LV                     0
Max PV                      16
Cur PV                      4
Act PV                      4
Max PE per PV               12800
VGDA                        8
PE Size (Mbytes)            4
Total PE                    51196
Alloc PE                    0
Free PE                     51196
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  1.0
VG Max Size                 800g
VG Max Extents              204800

   --- Physical volumes ---
   PV Name                     /dev/disk/disk68
   PV Status                   available
   Total PE                    12799
   Free PE                     12799
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk72
   PV Status                   available
   Total PE                    12799
   Free PE                     12799
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk73
   PV Status                   available
   Total PE                    12799
   Free PE                     12799
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk66
   PV Status                   available
   Total PE                    12799
   Free PE                     12799
   Autoswitch                  On
   Proactive Polling           On

6.    To create a logical volume, follow these steps:
6.1    Decide how much disk space the logical volume needs. Calculate the size of the LV and decide the name of  LV : example:
#-> lvcreate -n Lv_test /dev/vg_test
Logical volume "/dev/vg_test/Lv_test" has been successfully created with
character device "/dev/vg_test/rLv_test".
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

6.2    Allocate 1GB to   the logical volume

#-> lvextend -L 1024M /dev/vg_test/Lv_test
Logical volume "/dev/vg_test/Lv_test" has been successfully extended.
Volume Group configuration for /dev/vg_test has been saved in /etc/lvmconf/vg_test.conf

7.    To create a logical volume run newfs to raw lv

#-> newfs -F vxfs -o largefiles -b 8192 /dev/vg_test/rLv_test
   version 7 layout
   1048576 sectors, 131072 blocks of size 8192, log size 2048 blocks
   largefiles supported
8.    Check the type of file system. For example:
#-> /usr/sbin/fstyp  /dev/vg_test/rLv_test
             Vxfs
      #-> /usr/sbin/fstyp -v /dev/vg_test/rLv_test
vxfs
version: 7
f_bsize: 8192
f_frsize: 8192
f_blocks: 131072
    f_bfree: 128863
    f_bavail: 127857
    f_files: 32224
    f_ffree: 32192
    f_favail: 32192
    f_fsid: 1076363265
    f_basetype: vxfs
    f_namemax: 254
    f_magic: a501fcf5
    f_featurebits: 0
    f_flag: 16
    f_fsindex: 10
    f_size: 131072

9.    Create a mount point for mouting of Logical Volume.
#mkdir /oracle/Test

10.    Mount /dev/vg_test/Lv_test on /oracle/Test with correct option as per performance guidelines.
#-> mount  /dev/vg_test/Lv_test /test

#-> bdf /test
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg_test/Lv_test
                   1048576   17672 1022864    2% /test
11.    Check the mount option from mnttab.
#-> mount -v |grep -i test
/dev/vg_test/Lv_test on /test type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40280001 on Tue Jul  8 08:57:31 2014

12.    Check the load balancing for the disk

For 11iv3 systems make sure the load balance policy is also set on the newly added disk:
Verify LB policy: scsimgr -p get_attr all_lun -a device_file -a load_bal_policy
    Set LB policy on all disks: scsimgr save_attr -N "/escsi/esdisk" -a load_bal_policy=<LB policy>
Set LB policy on one disk:  scsimgr save_attr -D /dev/rdisk/disk530 -a load_bal_policy=<LB policy>