Operating System - HP-UX
1829737 Members
1872 Online
109992 Solutions
New Discussion

Re: Disk Mirroring Checks

 
SOLVED
Go to solution
Vassilios
Frequent Advisor

Disk Mirroring Checks

Dear HP Experts:

Im interested in building a testing procedure that will tell if a node in a cluster has disk mirroring. [i.e. has duplicate disks where the standby disk has the same information as the active disk].

Here's what i've suggested; but please let me know what you think?

a) check to see disk mirroring software is available:

swlist -l fileset | grep -i mir

b) Identify the primary boot disk
Type: lvlnboot -v

/dev/dsk/c2t0d0 (0/1/1/0.0.0) -- Boot Disk
/dev/dsk/c3t2d0 (0/1/1/1.2.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c2t0d0
Root: lvol3 on: /dev/dsk/c2t0d0
Swap: lvol2 on: /dev/dsk/c2t0d0
Dump: lvol2 on: /dev/dsk/c2t0d0, 0

At this stage, we can assume if the node has TWO boot disks, then it has disk mirroring?!!

Are there any other steps we should include???
13 REPLIES 13
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Disk Mirroring Checks

No. You could have two completely different boot disks for different operating systems, for example. Your methodology is fundamentally flawed in that you assume the mirroring occurs at the disk level when in fact it occurs at the LVOL level. I would check check to see if each LVOL in vg00 is mirrored and then look at the vgdisplay -v data and the lvlnboot data to see if they are all consistant.
If it ain't broke, I can fix that.
DCE
Honored Contributor

Re: Disk Mirroring Checks

The lvln command only tells you that the disk has a had the pvcreate command run against it, making the disk capable of being booted.

In order to truly verify whether mirroring is functioning, use the lvdisplay command.

It tells you how many mirrot copies are confugured, as well as whether they are working (the LV status line will have stale, if it is not working) See output below


lvdisplay /dev/vg00/lvol4
--- Logical volumes ---
LV Name /dev/vg00/lvol4
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 608
Current LE 19
Allocated PE 38
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default
Jeff_Traigle
Honored Contributor

Re: Disk Mirroring Checks

Just because you have two disks that are bootable does not mean you are mirroring.

Check "lvdisplay " to see if the "Mirror copies" is greater than 0.

Also a good idea to be sure there are no stale extents with "lvdisplay -v | grep -c -i stale". If that returns > 0, then you possibly have a failing or failed disk.
--
Jeff Traigle
James R. Ferguson
Acclaimed Contributor

Re: Disk Mirroring Checks

Hi:

HP-UX LVM mirrors at the logical volume level. Thus, to verify mirroring, you need to query the mirror status of every logical volume associated with a volume group.

You could do a 'vgdisplay -v
At a minimum, *every* logical volume should be mirrored for every volume group in question.

Regards!

...JRF...
Vassilios
Frequent Advisor

Re: Disk Mirroring Checks

You're all stars! I'm gonna give each one of you 10 points, and I hope u'll do the same for me one day.
Torsten.
Acclaimed Contributor

Re: Disk Mirroring Checks

The count of mirror copies >0 is one point.

But you have to looking for bootabel devices too.

First, do a "lvlnboot -v":

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c1t15d0 (0/0/1/1.15.0) -- Boot Disk
/dev/dsk/c3t15d0 (0/0/2/1.15.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c1t15d0
/dev/dsk/c3t15d0
Root: lvol3 on: /dev/dsk/c1t15d0
/dev/dsk/c3t15d0
Swap: lvol2 on: /dev/dsk/c1t15d0
/dev/dsk/c3t15d0
Dump: lvol2 on: /dev/dsk/c1t15d0, 0

Check also the LIF content of every disk listed by running:

lifls -v /dev/rdsk/c2t0d0

You should find at least
ISL
AUTO
HPUX
LABEL

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Vassilios
Frequent Advisor

Re: Disk Mirroring Checks

That's another good tip from Torsten. I'm very proud of all of you!

I've given everyone 10 points, but.. be careful, next time i'll be taking off points for spelling mistakes [just kidding!].

Thanks everyone!


Torsten.
Acclaimed Contributor

Re: Disk Mirroring Checks

I found my spelling mistake, but can't correct it. May I get some points now?

;-)
Have fun!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Vassilios
Frequent Advisor

Re: Disk Mirroring Checks

Im assigning you another 10 points. Not for the spelling mistakes, but this is all i have to offer you, and a BIG THANK YOU.
Peyman Javaheri
Frequent Advisor

Re: Disk Mirroring Checks

Just to add a bit to above comments:

1) Do bdf
2) grep for filesystems that you need
3) cut/awk for lvols
4) get lvdisplay for lvols
5) grep for mirrors

I do a more detailed version with one for/loop that goes through bdf line-by-line. You can also pass this to another scrip where it checks which disk the lvol reside(s) on. (In old days, we had vg00 span across multiple disks.)

6) ALSO check lvlnboot: very important!!

regards,
peyman;
Vassilios
Frequent Advisor

Re: Disk Mirroring Checks

Hello. Actually, that's a VERY INTERESTING comment that no one has mentioned. When you do a bdf, surely the "mdsk" symbol present in the output of 'bdf' should tell you if its a mirrored disk or not???

Is there a reason why anyone has not mentioned that? Is there a problem with bdf's output?

Thanks, and I hope all is going well with everyone!
Borislav Perkov
Respected Contributor

Re: Disk Mirroring Checks

Hi Vassilios,

Try with this script.

#!/bin/ksh

admin1=name@company.com
admin2=name@company.com
do_mirrordisk() {
# checking the root disk : checking on vg00

for lvol in 1 2 3 4 5 6 7 8
do
mirror=`lvdisplay -v /dev/vg00/lvol${lvol} | grep stale | wc -l`
if [ $mirror -ge 1 ]
then
echo "Root Mirror disk for lvol${lvol} is down, please check ..."
lvdisplay -v /dev/vg00/lvol${lvol} | grep stale | head > /tmp/MIRRPT 2>&1
mailx -s "ALERT: $host_name Root Mirror Disk for lvol${lvol} is down !" $admin1 < /tmp/MIRRPT
# mailx -s "ALERT: $host_name Root Mirror Disk for lvol${lvol} is down !" $admin2 < /tmp/MIRRPT
else
echo "Root Mirror Disk for lvol${lvol} is Okay !"
fi
done

}
do_mirrordisk

Regards,
Borislav

Peyman Javaheri
Frequent Advisor

Re: Disk Mirroring Checks

bdf is not able to look behind the F/S layer. Therefore, it can't show you the LVM layer info.

The above script is good and similar to what I have except for the for loop, where I look for the lvols through bdf and swapinfo (sorry that I cannot share my scripts). This way, your script will dynamically check for whatever LVOL you add to your system.

regards,
peyman;