Ajout de Lun/disque dans VxVM (hors cluster)

vendredi 22 avril 2011
par  Jerome ROBERT
popularité : 10%

 Création d’un volume dans un disque groupe :

root@serveur1 # vxassist -g D10_other make racdev00 1g

 

root@serveur1 # vxassist -g D10_other make racdev00rac 3g

VxVM vxassist ERROR V-5-1-435 Cannot allocate space for 6291456 block volume

 

Il manque de la volumétrie….

 

Ajout de disque/LUN dans la configuration VxVM

 

root@serveur1 # vxdisk list

DEVICE TYPE DISK GROUP STATUS
GENESIS0_23 auto - - error
GENESIS0_24 auto - - error
GENESIS0_25 auto - - error

 

### La commande format nous donnes la liste des disques « ajouter » ou « non labéliser » ### 

Il vois falloir les récuperer et ecrire cette liste dans un fichier comme par exemple « /tmp/liste »

 

 

root@serveur1 # format

Searching for disks...done

 

c5t60060E800548E900000048E90000060Ad0 : configured with capacity of 64.63GB
c5t60060E800548E900000048E90000060Bd0 : configured with capacity of 64.63GB
c5t60060E800548E900000048E90000060Cd0 : configured with capacity of 64.63GB
c5t60060E800548E900000048E90000060Dd0 : configured with capacity of 64.63GB
c5t60060E800548E900000048E900000613d0 : configured with capacity of 64.63GB

 

 

AVAILABLE DISK SELECTIONS :
 0. c5t5000C50007A7B647d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
 /scsi_vhci/disk@g5000c50007a7b647
  1. c5t5000C5000732818Fd0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
 /scsi_vhci/disk@g5000c5000732818f
 103. c5t60060E800548E900000048E90000005Cd0 <HITACHI-OPEN-V-SUN-6003 cyl 17474 alt 2 hd 15 sec 512>
 /scsi_vhci/ssd@g60060e800548e900000048e90000005c
Specify disk (enter its number) : ^D -

 

root@serveur1 # vi /tmp/liste

"/tmp/liste" [New file]

c5t60060E800548E900000048E90000060Ad0 : configured with capacity of 64.63GB
c5t60060E800548E900000048E90000060Bd0 : configured with capacity of 64.63GB
c5t60060E800548E900000048E90000060Cd0 : configured with capacity of 64.63GB
c5t60060E800548E900000048E90000060Dd0 : configured with capacity of 64.63GB
c5t60060E800548E900000048E900000613d0 : configured with capacity of 64.63GB
 
 
"/tmp/liste" 25 lines, 913 characters

 

Il faudrait passer sur tout ces disques “/tmp/liste” pour y mettre le label.

 

Voici une solution pour aller plus vite.

 

root@serveur1 # for disk in cat /tmp/liste
root@serveur1 > do
root@serveur1 > format $disk <<EOF
root@serveur1 > label
root@serveur1 > y
root@serveur1 > q
root@serveur1 > EOF
root@serveur1 > done

 

 

c5t60060E800548E900000048E90000060Ad0 : configured with capacity of 64.63GB
selecting c5t60060E800548E900000048E90000060Ad0
[disk formatted]
 

 

FORMAT MENU :
 disk - select a disk
 type - select (define) a disk type
 partition - select (define) a partition table
 current - describe the current disk
 format - format and analyze the disk
 repair - repair a defective sector
 label - write label to the disk
 analyze - surface analysis
 defect - defect list management
 backup - search for backup labels
 verify - read and display labels
 save - save new disk/partition definitions
 inquiry - show vendor, product and revision
 volname - set 8-character volume name
  !<cmd> - execute <cmd>, then return
 quit
format> Ready to label disk, continue ?
format>
c5t60060E800548E900000048E90000060Bd0 : configured with capacity of 64.63GB
selecting c5t60060E800548E900000048E90000060Bd0
[disk formatted]

 

 

 
Idem sur tout les disques du fichier /tmp/liste en « automatique »

 

 

 

root@serveur1 #

 

 

 

root@serveur1 # vxdisk list

DEVICE TYPE DISK GROUP STATUS
GENESIS0_23 auto - - error
GENESIS0_24 auto - - error
GENESIS0_25 auto - - error

 

 

Pour prendre en compte les modifications :

 

root@serveur1 # vxdctl enable

 

root@serveur1 # vxdisk list

DEVICE TYPE DISK GROUP STATUS
GENESIS0_23 auto:none - - online invalid
GENESIS0_24 auto:none  - - online invalid
GENESIS0_25 auto:none - - online invalid

 

 

Pour initialiser ces disques (les mettre dans VXVM)

 

Il faut créer un fichier par exemple « /tmp/liste1 » en mettant uniquement la liste des DEVICE (via la commande vxdisk list) que l’ont souhaite initialiser.

 

 

 

 

root@serveur1 # vi /tmp/liste1

"/tmp/liste1" [New file]

GENESIS0_23
GENESIS0_24
GENESIS0_25

 

 

 

"/tmp/liste1" [New file] 25 lines, 289 characters

 

Le script « /tmp/disk_setup » va nous permettre d’aller plus vite.

 

root@serveur1 # vi /tmp/disk_setup

"/tmp/disk_setup" [New file]

# !/bin/sh
LST=cat /tmp/liste1
for i in $LST
do
 vxdisk list | grep $i | grep invalid > /dev/null 2>&1
 rc=$ ?
 if [ $rc = 0 ]
 then
 echo $i non initialise
 j=echo $i | sed -e 's/s2$//'
 echo /etc/vx/bin/vxdisksetup -i $j
 /etc/vx/bin/vxdisksetup -i $j
 echo vxdisk -f init $j
 vxdisk -f init $j
 else
 echo $i initialise
 fi
done

 

 

"/tmp/disk_setup" 19 lines, 362 characters

 

root@serveur1 # bash ./tmp/disk_setup

GENESIS0_23 non initialise
/etc/vx/bin/vxdisksetup -i GENESIS0_23
 
vxdisk -f init GENESIS0_23
GENESIS0_24 non initialise
/etc/vx/bin/vxdisksetup -i GENESIS0_24
vxdisk -f init GENESIS0_24
GENESIS0_25 non initialise
/etc/vx/bin/vxdisksetup -i GENESIS0_25
vxdisk -f init GENESIS0_25
GENESIS0_26 non initialise

root@serveur1 #

root@serveur1 # vxdisk list

DEVICE TYPE DISK GROUP STATUS
GENESIS0_23 auto:sliced - -  online
GENESIS0_24 auto:sliced - - online
GENESIS0_25 auto:sliced - - online

 

root@serveur1 #

root@serveur1 # vxdg -g D10_other free

DISK DEVICE TAG OFFSET LENGTH FLAGS
D10_other00 GENESIS0_17 GENESIS0_17 6291456 2097152 -
D10_other01 GENESIS0_16 GENESIS0_16 132914176 2607104 -

 

root@serveur1 # vxdg -g D10_other adddisk D10_other02=GENESIS0_23

 

root@serveur1 # vxdisk list

DEVICE TYPE DISK GROUP STATUS
GENESIS0_23 auto:sliced D10_other02 D10_other online
GENESIS0_24 auto:sliced - - online
GENESIS0_25 auto:sliced - - online

 

 

root@serveur1 # vxdg -g D10_other free

DISK DEVICE TAG OFFSET LENGTH FLAGS
D10_other00 GENESIS0_17 GENESIS0_17 6291456 2097152 -
D10_other01 GENESIS0_16 GENESIS0_16 132914176 2607104 -
D10_other02 GENESIS0_23 GENESIS0_23 0 135521280 –

 

 

root@serveur1 # vxassist -g D10_other make racdev00rac 3g

root@serveur1 # vxassist -g D10_other make vftp 3g

 

 

Ensuite il faut ajouter ces FS dans le fichier « /etc/vfstab »


Statistiques

Dernière mise à jour

mercredi 4 octobre 2023

Publication

273 Articles
Aucun album photo
Aucune brève
6 Sites Web
2 Auteurs

Visites

32 aujourd’hui
105 hier
827522 depuis le début
3 visiteurs actuellement connectés