Juin 152011
 
attention, cette méthode comporte des risques, c’est à utiliser à vos risques et périls.

j’ai été obligé d’agrandir le système racine aujourd’hui … à chaud … ce qui n’est pas recommandé.

voici le détail de la méthode utilisée.

je casse le miroir pour pouvoir disposer d’un disque supplémentaire temporaire:

$ find /dev/vg00 -type b |while read i; do lvreduce -m 0 $i ; done
Logical volume "/dev/vg00/lvol1" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Logical volume "/dev/vg00/lvol2" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Logical volume "/dev/vg00/lvol3" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Logical volume "/dev/vg00/lvol4" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Logical volume "/dev/vg00/lvol5" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Logical volume "/dev/vg00/lvol6" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Logical volume "/dev/vg00/lvol7" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
Logical volume "/dev/vg00/lvol8" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

la difficulté vient du fait que le filesystème racine doit être contigu, c-a-d que tout ses extends doivent être dans la même lignée, la racine êtant /dev/vg00/lvol3, on va déplacer lvol4

$ vgdisplay -v vg00 |tail -n 20
   LV Size (Mbytes)            4596            
   Current LE                  1149      
   Allocated PE                1149        
   Used PV                     1       
 
 
   --- Physical volumes ---
   PV Name                     /dev/dsk/c1t2d0
   PV Status                   available                
   Total PE                    4340    
   Free PE                     784     
   Autoswitch                  On        
 
   PV Name                     /dev/dsk/c2t2d0
   PV Status                   available                
   Total PE                    4340    
   Free PE                     4340    
   Autoswitch                  On

on va faire un pvmove, pendant la commande, on peut voir sa progression en tapant:

lvdisplay -v /dev/vg00/lvol4 |awk '/dsk.*stale/,/^$/' |wc -l
$ pvmove -n /dev/vg00/lvol4 /dev/dsk/c1t2d0 /dev/dsk/c2t2d0
Transferring logical extents of logical volume "/dev/vg00/lvol4"...
Physical volume "/dev/dsk/c1t2d0" has been successfully moved.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
 
$ vgdisplay -v vg00 |tail -n 20
   LV Size (Mbytes)            4596           
   Current LE                  1149     
   Allocated PE                1149       
   Used PV                     1      
 
 
   --- Physical volumes ---
   PV Name                     /dev/dsk/c1t2d0
   PV Status                   available               
   Total PE                    4340   
   Free PE                     2145   
   Autoswitch                  On       
 
   PV Name                     /dev/dsk/c2t2d0
   PV Status                   available               
   Total PE                    4340   
   Free PE                     2979   
   Autoswitch                  On

une fois tout cela fait, on peut étendre / à 2Go

$ lvextend -L 2048 /dev/vg00/lvol3
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
$ fsadm -F vxfs -v -b 2097152 /
vxfs fsadm: using device /dev/vg00/rlvol3
vxfs fsadm: /dev/vg00/rlvol3 is currently 204800 sectors - size will be increased

on re-move lvol4 sur le disque d’origine

$ pvmove -n /dev/vg00/lvol4 /dev/dsk/c2t2d0 /dev/dsk/c1t2d0                             
Transferring logical extents of logical volume "/dev/vg00/lvol4"...
Physical volume "/dev/dsk/c2t2d0" has been successfully moved.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

on refait le miroir.
pour voir la progression du miroir lancer cette commande pendant le lvextend:

# find /dev/vg00 -type b |while read i ; do t=$(lvdisplay -v $i |awk '/dsk.*stale/,/^$/'|wc -l) ; echo ${i##*/} Stale: $t ; done
$ find /dev/vg00 -type b |while read i ; do lvextend -m 1 $i ; done
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol2" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol4" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol5" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol6" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol7" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol8" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

j’aurais pu éviter certaines étapes, ne pas faire sauter le miroir de tout les lvols par exemple, j’aurais aussi certainement pu éviter le dernier pvmove, les extends se seraient de toute façon synchronisés avec la recréation du miroir.

 Publié par à 11 h 28 min  Taggué avec : ,

 Laisser un commentaire

Vous pouvez utiliser ces tags et attributs HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(requis)

(requis)

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.