Création du volume LVM en mirroir sous HPUX

lundi 9 septembre 2013
par  Jerome ROBERT
popularité : 6%

Création du volume LVM en mirroir

Il faut connaître la place disponible sur chaque disque.

#vgdisplay -v


—  - Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 9
Open LV 9
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4350
VGDA 4
PE Size (Mbytes) 8
Total PE 8680
Alloc PE 3788
Free PE 4892
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
...

 --- Physical volumes ---
 PV Name /dev/dsk/c3t15d0
 PV Status available
 Total PE 4340
  Free PE 2446
 Autoswitch On

 PV Name /dev/dsk/c1t15d0
 PV Status available
 Total PE 4340
 Free PE 2446
 Autoswitch On
 

La place disponible sur chaque disque est de 2446 PE de 8Mo.

 

Création d’un volume logique :

#lvcreate -L 2000 /dev/vg00
Logical volume "/dev/vg00/lvol10" has been successfully created with
character device "/dev/vg00/rlvol10".
Logical volume "/dev/vg00/lvol10" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
 

 

Il faut connaître sur quel disque le volume logique a été créer

#lvdisplay -v /dev/vg00/lvol10

--- Logical volumes ---
LV Name /dev/vg00/lvol10
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 2000
Current LE 250
Allocated PE 250
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

 --- Distribution of logical volume ---
 PV Name LE on PV PE on PV
 /dev/dsk/c3t15d0 250 250

 --- Logical extents ---
 LE PV1 PE1 Status 1
 00000 /dev/dsk/c3t15d0 01894 current
 00001 /dev/dsk/c3t15d0 01895 current
 00002 /dev/dsk/c3t15d0 01896 current
 00003 /dev/dsk/c3t15d0 01897 current
...

Le LV est créer sur /dev/dsk/c3t15d0.

Pour rappel, il y a deux disques dans le VG.

--- Physical volumes ---
 PV Name /dev/dsk/c3t15d0
 PV Status available
 Total PE 4340
  Free PE 2446
 Autoswitch On

 PV Name /dev/dsk/c1t15d0
 PV Status available
 Total PE 4340
 Free PE 2446
 Autoswitch On
 

On va donc faire un miroir via le disque c1t15d0.

 

Création du miroir :

#lvextend -m 1 /dev/vg00/lvol10 /dev/dsk/c1t15d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol10" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
 

Création du FS en vxfs :

#mkfs -F vxfs /dev/vg00/lvol10
version 4 layout
 2048000 sectors, 2048000 blocks of size 1024, log size 1024 blocks
 unlimited inodes, largefiles not supported
 2048000 data blocks, 2046392 free data blocks
 63 allocation units of 32768 blocks, 32768 data blocks
 last allocation unit has 16384 data blocks
 

Création d’un point de montage et montage

# mkdir /u01

# mount -F vxfs /dev/vg00/lvol10 /u01

 

Modifier le fichier /etc/fstab, ajout de la ligne suivant :

/dev/vg00/lvol10 /u01 vxfs rw,suid,nolargefiles,delaylog,datainlog 0 2
 

 

 

 

Vérification de la mise en miroir :

 

#lvdisplay -v /dev/vg00/lvol10


—  - Logical volumes ---
LV Name /dev/vg00/lvol10
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 2000
Current LE 250
Allocated PE 500
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

 --- Distribution of logical volume ---
 PV Name LE on PV PE on PV
 /dev/dsk/c3t15d0 250 250
 /dev/dsk/c1t15d0 250 250

 --- Logical extents ---
 LE PV1 PE1 Status 1 PV2 PE2 Status 2
 00000 /dev/dsk/c3t15d0 01894 current /dev/dsk/c1t15d0 01894 current
 00001 /dev/dsk/c3t15d0 01895 current /dev/dsk/c1t15d0 01895 current
 00002 /dev/dsk/c3t15d0 01896 current /dev/dsk/c1t15d0 01896 current
 00003 /dev/dsk/c3t15d0 01897 current /dev/dsk/c1t15d0 01897 current
 00004 /dev/dsk/c3t15d0 01898 current /dev/dsk/c1t15d0 01898 current
 00005 /dev/dsk/c3t15d0 01899 current /dev/dsk/c1t15d0 01899 current
 00006 /dev/dsk/c3t15d0 01900 current /dev/dsk/c1t15d0 01900 current
 00007 /dev/dsk/c3t15d0 01901 current /dev/dsk/c1t15d0 01901 current
 00008 /dev/dsk/c3t15d0 01902 current /dev/dsk/c1t15d0 01902 current
 00009 /dev/dsk/c3t15d0 01903 current /dev/dsk/c1t15d0 01903 current
 

 


Navigation

Statistiques

Dernière mise à jour

mercredi 4 octobre 2023

Publication

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

Visites

0 aujourd’hui
105 hier
827490 depuis le début
7 visiteurs actuellement connectés