viernes, 8 de enero de 2010

Cambio de parámetros de un VG en HP-UX 11.23

Algunas veces al crear un vg los parámetros iniciales se quedan cortos con futuros crecimientos. Éstos parámetros se pueden modificar en HP-UX 11.23 (instalando un parche) y de forma nativa en 11.31 con el comando vgmodify.

El procedimiento es el siguiente:

Se tiene el vg inicial (de prueba), compuesto por 7 discos y con un único lvol con todo el espacio asignado:

[HPUX1123][/]#vgdisplay -v vg14
--- Volume groups ---
VG Name                     /dev/vg14
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      1     
Open LV                     1     
Max PV                      100   
Cur PV                      7     
Act PV                      7     
Max PE per PV               12800       
VGDA                        14 
PE Size (Mbytes)            16             
Total PE                    6069   
Alloc PE                    6069   
Free PE                     0      
Total PVG                   1       
Total Spare PVs             0             
Total Spare PVs in use      0                    

   --- Logical volumes ---
   LV Name                     /dev/vg14/lvol1
   LV Status                   available/syncd          
   LV Size (Mbytes)            97104          
   Current LE                  6069     
   Allocated PE                6069       
   Used PV                     7      

   --- Physical volumes ---
   PV Name                     /dev/dsk/c26t13d6
   PV Name                     /dev/dsk/c25t13d6        Alternate Link
   PV Status                   available               
   Total PE                    867    
   Free PE                     0      
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/dsk/c26t13d7
   PV Name                     /dev/dsk/c25t13d7        Alternate Link
   PV Status                   available               
   Total PE                    867    
   Free PE                     0      
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/dsk/c26t14d0
   PV Name                     /dev/dsk/c25t14d0        Alternate Link
   PV Status                   available               
   Total PE                    867    
   Free PE                     0      
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/dsk/c26t14d1
   PV Name                     /dev/dsk/c25t14d1        Alternate Link
   PV Status                   available               
   Total PE                    867    
   Free PE                     0      
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/dsk/c26t14d2
   PV Name                     /dev/dsk/c25t14d2        Alternate Link
   PV Status                   available               
   Total PE                    867    
   Free PE                     0      
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/dsk/c26t14d3
   PV Name                     /dev/dsk/c25t14d3        Alternate Link
   PV Status                   available               
   Total PE                    867    
   Free PE                     0      
   Autoswitch                  On       
   Proactive Polling           On              

   PV Name                     /dev/dsk/c26t14d4
   PV Name                     /dev/dsk/c25t14d4        Alternate Link
   PV Status                   available               
   Total PE                    867    
   Free PE                     0      
   Autoswitch                  On       
   Proactive Polling           On              

   --- Physical volume groups ---
   PVG Name                    PVG14                     
   PV Name                     /dev/dsk/c26t13d6         
   PV Name                     /dev/dsk/c26t13d7         
   PV Name                     /dev/dsk/c26t14d0         
   PV Name                     /dev/dsk/c26t14d1         
   PV Name                     /dev/dsk/c26t14d2         
   PV Name                     /dev/dsk/c26t14d3         
   PV Name                     /dev/dsk/c26t14d4         

[
HPUX1123][/]#

Se necesita tener el PE 0 de cada disco libre para poder usar vgmodify, por lo que se hace una reducción del espacio del filesystem (/prueba) y posteriormente del lvol (como el lvol está distribuido, se libera espacio en todos los discos):

[HPUX1123][/]#fsadm -F vxfs -b 96092m /prueba
vxfs fsadm: /dev/vg14/rlvol1 is currently 99336192 sectors - size will be reduced
[HPUX1123][/]#lvreduce -L 96092 /dev/vg14/lvol1
Warning: rounding up logical volume size to extent boundary at size "96096" MB.
When a logical volume is reduced useful data might get lost;
do you really want the command to proceed (y/n) : y
Logical volume "/dev/vg14/lvol1" has been successfully reduced.
Volume Group configuration for /dev/vg14 has been saved in /etc/lvmconf/vg14.conf
[
HPUX1123][/]#

Ahora, con pvmove se mueve el PE 0 a cualquier espacio libre en el mismo disco:


[HPUX1123][/]#pvmove /dev/dsk/c26t13d6:0 /dev/dsk/c26t13d6
Transferring logical extents of logical volume "/dev/vg14/lvol1"...
Physical volume "/dev/dsk/c26t13d6" has been successfully moved.
Volume Group configuration for /dev/vg14 has been saved in /etc/lvmconf/vg14.conf
[
HPUX1123][/]#pvmove /dev/dsk/c26t13d7:0 /dev/dsk/c26t13d7
Transferring logical extents of logical volume "/dev/vg14/lvol1"...
Physical volume "/dev/dsk/c26t13d7" has been successfully moved.
Volume Group configuration for /dev/vg14 has been saved in /etc/lvmconf/vg14.conf
[
HPUX1123][/]##pvmove /dev/dsk/c26t14d0:0 /dev/dsk/c26t14d0
[
HPUX1123][/]#pvmove /dev/dsk/c26t14d1:0 /dev/dsk/c26t14d1
Transferring logical extents of logical volume "/dev/vg14/lvol1"...
Physical volume "/dev/dsk/c26t14d1" has been successfully moved.
Volume Group configuration for /dev/vg14 has been saved in /etc/lvmconf/vg14.conf
[
HPUX1123][/]#pvmove /dev/dsk/c26t14d2:0 /dev/dsk/c26t14d2
Transferring logical extents of logical volume "/dev/vg14/lvol1"...
Physical volume "/dev/dsk/c26t14d2" has been successfully moved.
Volume Group configuration for /dev/vg14 has been saved in /etc/lvmconf/vg14.conf
[
HPUX1123][/]#pvmove /dev/dsk/c26t14d3:0 /dev/dsk/c26t14d3
Transferring logical extents of logical volume "/dev/vg14/lvol1"...
Physical volume "/dev/dsk/c26t14d3" has been successfully moved.
Volume Group configuration for /dev/vg14 has been saved in /etc/lvmconf/vg14.conf
[
HPUX1123][/]#pvmove /dev/dsk/c26t14d4:0 /dev/dsk/c26t14d4
Transferring logical extents of logical volume "/dev/vg14/lvol1"...
Physical volume "/dev/dsk/c26t14d4" has been successfully moved.
Volume Group configuration for /dev/vg14 has been saved in /etc/lvmconf/vg14.conf
[
HPUX1123][/]#

Se desmonta el filesystem y se desactiva el vg:

[HPUX1123][/]#umount /prueba
[
HPUX1123][/]#vgchange -a n vg14
Volume group "vg14" has been successfully changed.
[
HPUX1123][/]#

Ahora el comando de modificación en si, se va a cambiar el número máximo de PV (de 100 a 101) y el tamaño de los PE (de 12800 a 13000):


[HPUX1123][/]#vgmodify -n -p 101 -e 13000 vg14

Current Volume Group settings:
                                          Max LV      255
                                          Max PV      100
                                   Max PE per PV    12800
                                PE Size (Mbytes)       16
                              VGRA Size (Kbytes)    10544
The current and new Volume Group parameters differ.
An update to the Volume Group IS required

New Volume Group settings:
                                          Max LV      255
                                          Max PV      101
                                   Max PE per PV    13000
                                PE Size (Mbytes)       16
                              VGRA Size (Kbytes)    10656
New Volume Group configuration for "vg14" has been saved in "/etc/lvmconf/vg14.conf"
Old Volume Group configuration for "vg14" has been saved in "/etc/lvmconf/vg14.conf.old"
Starting the modification by writing to all Physical Volumes
Applying the configuration to all Physical Volumes from "/etc/lvmconf/vg14.conf"
Completed the modification process.
New Volume Group configuration for "vg14" has been saved in "/etc/lvmconf/vg14.conf.old"
Volume group "vg14" has been successfully changed.
[
HPUX1123][/]#

Finalmente se vuelve a activar el vg y se verifica, notándose que el cambio quedó satisfactoriamente hecho:


[HPUX1123][/]#vgchange -a y vg14
Activated volume group
Volume group "vg14" has been successfully changed.
[
HPUX1123][/]#vgdisplay vg14
--- Volume groups ---
VG Name                     /dev/vg14
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      1     
Open LV                     1     
Max PV                      101   
Cur PV                      7     
Act PV                      7     
Max PE per PV               13000       
VGDA                        14 
PE Size (Mbytes)            16             
Total PE                    6062   
Alloc PE                    6006   
Free PE                     56     
Total PVG                   1       
Total Spare PVs             0             
Total Spare PVs in use      0                    

[
HPUX1123][/]#

No hay comentarios:

Publicar un comentario