Il peut arriver que des hdisk autrefois alloués à un VG et à une baie de disques soient conservés avec le vieux PVID, même s'ils apparaissent 'Available' pour le nouveau stockage.

 Si le disque est vide ou au contenu pouvant être écrasé, il est simple de faire un 'chdev  -l hdiskX -a pv=clear' pour effacer le PVID du disque. Lors de sa prochaine utilisation, le PVID sera redéfini.

Les opérations décrites ci-dessous expliquent comment vérifier les PVID et les récupérer.

Personnellement, je préfère utiliser la commande 'chdev -a pv=yes -l hdiskX' pour essayer de récupérer le bon PVID, plutôt que de faire du 'dd'.

Mais si cette méthode ne fonctionne pas, il reste toujours cet essai...

 

Sur le disque hdisk405 par exemple:                                                     

Le PVID devrait être:                                                            

00c4bcc0d4e5f703                                                             

Il peut être lu par la commande :                                

lquerypv -h /dev/hdisk405 80 10



L'information stockée dans la  VGDA peut être:                             

00c4bcc03f0d0d8e                                                             

et contrôlée par la commande                                              

readvgda -v3 hdisk405                                                        

Ci-dessous une solution officielle IBM, mais qui fait peur(dd) ou qui nécessite une fermeture du VG.


The pvid in the                                                              
vgda must be the same as the pvid of the disk, that is why there are 2       
possibilities:                                                               
1. change the PVID on the hdiskxxx to be identical with the one in the       
VGDA or                                                                      
2. change the value stored in the VGDA for that disk to be the PVID          

For option 1.                                                                
Execute the following script in order to change manually the PVID on         
the disk, the value being the one displayed in the VGDA.                     

Chpvid sets the pvid on a disk to a given value. This was useful in buil     
examples for this book and may be of use as a last resort in recovery        
situations.                                                                  
Syntax: chpvid                                                               



You can find more information about this script at the link:                 

AIX Logical Volume Manager from A to Z: Troubleshooting and                  
Commands                                                                     

http://www.redbooks.ibm.com/abstracts/SG245433.html?Open                     

In Appendix E2.                                                              




Flags: none                                                                  

Note: It is most strongly recommended that the chpvid script is not used     
as a production tool in a production environment, as its effects are         
undefined. IBM will not be held responsible if you use this tool.            

Syntax: chpvid (new pvid) (hdisk)                                            

Flags: None                                                                  

#!/usr/bin/ksh                                                               
pvid=$1                                                                      
disk=$2                                                                      
set -A a `echo $pvid|\                                                       
awk ' {                                                                      
for (f=1; f <= length($0); f=f+2) {                                          
print "ibase=16\nobase=8\n"toupper(substr($0,f,2))                           
}                                                                            
}'|\                                                                         
bc 2>/dev/null`                                                              
/usr/bin/echo "\0"${a[0]}"\0"${a[1]}"\0"${a[2]}"\0"${a[3]}"\0"\              
${a[4]}"\0"${a[5]}"\0"${a[6]}"\0"${a[7]}"\0\0\0\0\0\0\0\0\c"|\               
dd bs=1 seek=128 of=/dev/$disk                                               



For option 2.                                                                

recreatevg -y dwhilogvg  -Y NA -L / hdisk405 hdisk406 hdisk407 hdisk408      
hdisk409 hdisk410 hdisk411 hdisk412 hdisk413 hdisk414 hdisk415 hdisk416      
hdisk417 hdisk418

icon phone
Téléphone/Whatsapp : +33 (0)6 83 84 85 74
icon phone