Operating System - HP-UX
1831043 Members
2405 Online
110019 Solutions
New Discussion

how to tell if disks are mirrored?

 
SOLVED
Go to solution
Carol Yu
Frequent Advisor

how to tell if disks are mirrored?

Hi, I have rp5470 server running HP-UX 11.0. I checked swlist, it does have mirrordisk/ux installed. But I am not sure how to check if the disks are mirrored. I am new to HP-UX and the people who setup those systems are gone.

Also when I lvdisplay a logical volume, the mirror copies info showed 1, does that mean the logical volume is mirrored?

Could you also refer some good guides on this? Thanks a lot.

9 REPLIES 9
RAC_1
Honored Contributor

Re: how to tell if disks are mirrored?

pvdisplay -v /dev/dsk/cxtxdx.

To which Logical Volume this disk belongs??

lvdisplay -v /dev/vgxx/lvolxx

Check for mirror copies details.

Anil
There is no substitute to HARDWORK
Marvin Strong
Honored Contributor

Re: how to tell if disks are mirrored?

yes mirrored copies from lvdisplay tells you how many mirrored copies there is. 0 = none, 1 = 1 etc..

so you have 1 mirrored copy of that logical volume.

if you do lvdisplay -v /dev/vg??/lvol??
you can see the disks, it is mirrored on.



G. Vrijhoeven
Honored Contributor
Jeff Schussele
Honored Contributor
Solution

Re: how to tell if disks are mirrored?

Hi,

Disks aren't mirrored, LVs are.
As stated
lvdisplay /dev/vg_name/lv_name
will tell you in the mirror copies field
0 = no mirrors
1 = 1 mirror (two copies)
2 = 2 mirrors (three copies & the max)

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Patrick Wallek
Honored Contributor

Re: how to tell if disks are mirrored?

If you do an 'lvdisplay -v' you 2 main clues that an LV is mirrored are:

1) Mirror Copies is greater than 0.

2) You will see output like this when doing an 'lvdisplay -v /dev/vg??/lvol?'

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c1t2d0 00000 current /dev/dsk/c2t2d0 00000 current
00001 /dev/dsk/c1t2d0 00001 current /dev/dsk/c2t2d0 00001 current
00002 /dev/dsk/c1t2d0 00002 current /dev/dsk/c2t2d0 00002 current
00003 /dev/dsk/c1t2d0 00003 current /dev/dsk/c2t2d0 00003 current
00004 /dev/dsk/c1t2d0 00004 current /dev/dsk/c2t2d0 00004 current
00005 /dev/dsk/c1t2d0 00005 current /dev/dsk/c2t2d0 00005 current
00006 /dev/dsk/c1t2d0 00006 current /dev/dsk/c2t2d0 00006 current


When you see 2 (or more) logical extents for each Physical extent then the LV is mirrored.
Jeff_Traigle
Honored Contributor

Re: how to tell if disks are mirrored?


I included the following segment of code in a POSIX shell script that generates a report of lots of system information that I wanted to have handy. Basically, yes, the Mirror info reported in lvdisplay indicates whether an LV is mirrored or not.


for VOLGRP in $(vgdisplay | grep "VG Name" | awk '{print $3}')
do
echo "${VOLGRP}\t"

for LOGVOL in $(vgdisplay -v ${VOLGRP} | grep "LV Name" | awk '{print $3}')
do
echo "${LOGVOL} \t\c"
echo $(lvdisplay -v ${LOGVOL} | grep /dev/dsk | awk '{print $2 " " $5}' | sort -u | grep /dev/dsk) "\c"

if [ $(lvdisplay ${LOGVOL} | grep Mirror | awk '{print $3}') -eq 1 ];
then
echo "Mirrored";
else
echo "\n";
fi;

done

echo "\n";
done
--
Jeff Traigle
Mel Burslan
Honored Contributor

Re: how to tell if disks are mirrored?

yes, if lvdisplay output is showing the mirror copies as 1, it means that your logical volume is mirrored, but this does not necessarily mean your disks are mirrored.

when you run the command, something like

lvdisplay -v /dev/vg00/lvol4

on the output, the section which should tip you if the volume is mirrored on 2 separate disks is:

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t2d0 16 16
/dev/dsk/c2t2d0 16 16

and a little below this block you will see the logical extents' status similar to :

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c1t2d0 00542 current /dev/dsk/c2t2d0 00542 current
00001 /dev/dsk/c1t2d0 00543 current /dev/dsk/c2t2d0 00543 current
00002 /dev/dsk/c1t2d0 00544 current /dev/dsk/c2t2d0 00544 current
00003 /dev/dsk/c1t2d0 00545 current /dev/dsk/c2t2d0 00545 current
00004 /dev/dsk/c1t2d0 00546 current /dev/dsk/c2t2d0 00546 current
00005 /dev/dsk/c1t2d0 00547 current /dev/dsk/c2t2d0 00547 current

which is another point that you can see PE1 and PE2 are on two separate disks
________________________________
UNIX because I majored in cryptology...
Geoff Wild
Honored Contributor

Re: how to tell if disks are mirrored?

Here's a little script I have to check mirrors - output like:

# ./mirror-check
------------------------------------------------
checking the root disk vg00 on pc0003
------------------------------------------------
Root Mirror Disk for /dev/vg00/lvol1 is Okay !
Root Mirror Disk for /dev/vg00/lvol2 is Okay !
Root Mirror Disk for /dev/vg00/lvol3 is Okay !
Root Mirror Disk for /dev/vg00/lvol4 is Okay !
Root Mirror Disk for /dev/vg00/lvol5 is Okay !
Root Mirror Disk for /dev/vg00/lvol6 is Okay !
Root Mirror Disk for /dev/vg00/lvol7 is Okay !
Root Mirror Disk for /dev/vg00/lvol8 is Okay !
Root Mirror Disk for /dev/vg00/lvol9 is Okay !
Root Mirror Disk for /dev/vg00/lvol10 is Okay !
Root Mirror Disk for /dev/vg00/lvol11 is Okay !
Root Mirror Disk for /dev/vg00/lvol12 is Okay !
Root Mirror Disk for /dev/vg00/lvol13 is Okay !
Root Mirror Disk for /dev/vg00/lvol14 is Okay !
Root Mirror Disk for /dev/vg00/lvoraclebase is Okay !

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.