Operating System - HP-UX
1753863 Members
7237 Online
108809 Solutions
New Discussion юеВ

Testing and Cnfirming Mirroring of disks under vg00

 
Venkat_11
Regular Advisor

Testing and Cnfirming Mirroring of disks under vg00

Can any one let me know the series of steps we have to run to test and make sure the mirroring was done in a proper way on HPUX 11.x servers so that when one of the root disks fails the other one will take over.

Thanks and Regards
Venkat

10 REPLIES 10
Jeeshan
Honored Contributor

Re: Testing and Cnfirming Mirroring of disks under vg00

an easy way is, reboot the server and booting the OS from alternate or mirrored disk.
a warrior never quits
Aashique
Honored Contributor

Re: Testing and Cnfirming Mirroring of disks under vg00

Hi,
if assumes your second disk is c2t1d0

then follow this steps:

#pvcreate -fB /dev/rdsk/c2t1d0
#vgextend /dev/vg00 /dev/dsk/c2t1d0
#mkboot /dev/dsk/c2t1d0
#mkboot -a "hpux -lq (0/1/1/0.1.0;0)/stand/vmunix" /dev/rdsk/c2t1d0
#lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t1d0

Synchronize all the logical volume.

After vgdisplay output will be:

Cur PV will be 2

# lvlnboot -b /dev/vg00/lvol1
# lvlnboot -r /dev/vg00/lvol3
# lvlnboot -s /dev/vg00/lvol2
# lvlnboot -Rv

After all the activity reboot the server and boot from alternate mirror disks.

Thanks & Regards
Venkat_11
Regular Advisor

Re: Testing and Cnfirming Mirroring of disks under vg00

Thanks for the responses but i want to test the mirroring with out rebooting the server i mean are there any commands which can confirm that the mirroring was done in a proper way.

I dont want to reboot the server to test the mirroring.

Thanks and Regards
Venkat
James R. Ferguson
Acclaimed Contributor

Re: Testing and Cnfirming Mirroring of disks under vg00

Hi:

Probably the best assay, other than a reboot, is:

# lvlnboot -v

You should see something like:

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c2t6d0 (10/0.6.0) -- Boot Disk
/dev/dsk/c0t6d0 (8/8.6.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c2t6d0
/dev/dsk/c0t6d0
Root: lvol3 on: /dev/dsk/c2t6d0
/dev/dsk/c0t6d0
Swap: lvol2 on: /dev/dsk/c2t6d0
/dev/dsk/c0t6d0
Dump: lvol2 on: /dev/dsk/c2t6d0, 0

...you also want to make sure that you have a low-quorum set for both disks:

# lifcp /dev/rdsk/c2t6d0:AUTO -
hpux -lq
# lifcp /dev/rdsk/c0t6d0:AUTO -
hpux -lq

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: Testing and Cnfirming Mirroring of disks under vg00

Shalom,

Only one sure way.

Shut the system down and boot with one disk not present.

All other methods are theoretical.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tim Nelson
Honored Contributor

Re: Testing and Cnfirming Mirroring of disks under vg00

I agree with SEP.

One mandatory step during my system builds and OS mirroring is to reboot from the mirror copy before I turn things over.

(assuming PA-RISC here)
Typically what happens is the admin forgets to pvcreate -B and then move the LIF/Boot headers (mkboot).

Without rebooting you can only check (lifcp) and cross your fingers when that day your primary fails.

Geoff Wild
Honored Contributor

Re: Testing and Cnfirming Mirroring of disks under vg00

You can not be 100% sure until you test it.

The following will check if lvols are mirrored:

Rgds...Geoff

-------------------------------

# cat chkdisks
#! /bin/sh

# Check the status of HP disks. i

# Currently this just checks for mirrored disks. Even this is not complete;
# while the script does verify that logical volumes are mirrored to different
# disks, it does not verify that logical volumes are mirrored across
# controllers.

VERBOSE=0
while getopts g:v flag
do
case $flag in
v)
VERBOSE=1
;;
*)
print "Usage: `basename $0` [-v] [vgs]"
print "\tIf no VGs are listed all will be checked."
exit 1
;;
esac
done

shift $((OPTIND -1))
VGs="$*"

TMPF=/tmp/lv.out.$$
trap "rm -f $TMPF; exit 1" 1 2 3 15

# First, print the headers. I should have a flag to suppress this.

printf "%-30s\t%-35s %-10s\n" "Logical Volume" Filesystem "Mirrored?"
printf "%-30s\t%-35s %-10s\n" "--------------" ---------- ---------

# First, generate the list of volume groups.
ALLVGs=`/usr/sbin/vgdisplay 2>/dev/null | grep 'VG Name' |\
awk '{print $3}' | sed 's,/dev/,,'`

VGs=${VGs:-$ALLVGs}

for vg in $VGs
do
LVs=`/usr/sbin/vgdisplay -v $vg | grep 'LV Name' | awk '{print $3}'`

for lv in $LVs
do
# Yuck, there has got to be a better way to do an
# anchored search. Yet I don't want to use perl.
str=`echo $lv | sed 's,/,.,g'`
fs=`awk '$1 ~ /^'$str'$/ {print $2}' /etc/mnttab`

# Check for mirrored disks. This is more complicated than
# I thought. There are cases where the LEs are mirrored to
# PEs on the same disks.
ismirr="no" # assume not mirrored
reason="" # but no reason

/usr/sbin/lvdisplay -v $lv > $TMPF
nummirr=`grep 'Mirror copies' $TMPF | awk '{print $3}'`
if [ $nummirr -gt 0 ]
then

# Check for volumes mirrored on the same disk,
# that is, where the number of PEs is more than
# the number of LEs.
badLEs=`grep '^ */dev/' $TMPF | awk '$2!=$3 {print $0}'`
if [ "x$badLEs" = "x" ]
then
ismirr="yes"
else
ismirr="no"
reason="$lv is mirrored on same disk."
fi
else
reason="$lv mirrored copies is 0."
fi

# Anything else to check for? Controller!
printf "%-30s\t%-35s %s\n" "$lv" "$fs" "$ismirr"

# If requested, explain why this disk is not mirrored
if [ $VERBOSE -gt 0 -a "$ismirr" = "no" ]
then
print "\t$reason"
fi
done
done

# Cleanup
/bin/rm -f $TMPF
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.
Torsten.
Acclaimed Contributor

Re: Testing and Cnfirming Mirroring of disks under vg00

Some basics:

You can have hardware or software mirrored disks.

For hardware mirrors you need to look for devices like /dev/ciss (for smartarray controllers) or /dev/sasd (for integrated SAS controllers) in "ioscan" and disk descriptions like "HP IR Volume" or "HP LOGICAL VOLUME".

For software based mirrors (LVM) you can check the mirror status with "lvdisplay ...", check for an existing boot area with "lvlnboot -v" and (important!) for the contents of the boot area with
"lifls -v /dev/rdsk/cxtydz".

For software based mirrors you should boot from the alternate as a final test.

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!   
Sagar Sirdesai
Trusted Contributor

Re: Testing and Cnfirming Mirroring of disks under vg00

Hi Venkat,

If these disks are hot pluggable internal disk.
Just plug out the primary disk.
And the secondary mirrored disk will take control.

Use the lvdisplay -v command to confirm..
Sagar