1834394 Members
1929 Online
110066 Solutions
New Discussion

Mirroring rootvg

 
Greg Bernard
New Member

Mirroring rootvg

I have seem bits and pieces on mirroring the root volume group. I have never done it and I now need to do it. I have my root vg on a 18GB disk and need to mirror it to another 18GB disk. What is the procedure??

Thanks in advance!

Greg
Here we go!
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: Mirroring rootvg

Hi Greg:

The full description of the process is described here:

http://docs.hp.com/hpux/onlinedocs/B2355-90742/B2355-90742.html

In summary form:

# pvcreate -B /dev/rdsk/cXtYdZ
# vgextend /dev/vg00 /dev/dsk/cXtYdZ
# mkboot /dev/rdsk/cXtYdZ #...note raw device...
# mkboot -a "hpux -lq /stand/vmunix" /dev/rdsk/cXtYdZ
# for N in 1 2 3 4 5 6 7 8 #...or more...
> do
> lvextend -m 1 /dev/vg00 /dev/dsk/cXtYdZ
> done
# lvlnboot -v #...a nice check...

Note that the 'lvextend' of the mirror proceeds *in order* of logical volumes. Logical volumes 1-3 of vg00 must be first, in order.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Mirroring rootvg

Hi Greg:

Assuming you use the typical 8 lvols for vg00
here is a script which will do it. If not it is easy to change. You will need to set the RAW and COOKED variables to your mirror disk. The mirror disk should be on a separate SCSI bus from the primary boot.

Once you have mirrored, you should also do a mkboot on the primary boot disk to allow booting without a quorum. The command is the same as in the script but the RAW devive should be that of your primary boot. As a last
step you should change the alternate boot strring to the mirror device so that all you have to do from firmware is "BOOT ALT".

Regards, Clay
If it ain't broke, I can fix that.
Victor_5
Trusted Contributor

Re: Mirroring rootvg

Creating a mirror of the root disc
----------------------------------------

To mirror the root disc a second disc of similar size and speed is requried. It is best if the second disc is on another bus.

Caution: Any data on the second disc will be lost.

1) Prepare the new disc for use with LVM using the pvcreate command with the "-B" option to leave room for a boot area (the "-f" option should also be used if the disc has been use for LVM before).
# pvcreate -B -f /dev/rdsk/cXtYdZ

2) Put a boot area onto the new disc.
# mkboot /dev/rdsk/cXtYdZ

3) Extend the root volume group to include the new disc.
# vgextend /dev/vg00 /dev/dsk/cXtYdZ

4) Extend each logical volume so that it has
a mirror copy. This must be done in order.
# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/cXtYdZ
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/cXtYdZ
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/cXtYdZ
...

5) (Optional) If there are only two discs in the root volume group then the only time that the system would be booted from the mirror copy would be in the event of a failure of the
primary boot disc. So the mirror should be
configured to boot in "no quorum" mode.

# mkboot -a "hpux -lq" /dev/rdsk/cXtYdZ

6) If diagnostics are installed load the offline diagnostics into the boot area of the new disc.

# cd /usr/sbin/diag/lif
# mkboot -b updatediaglif -p ISL -p AUTO -p HPUX -p LABEL /dev/rdsk/cXtYdZ

Notes:
-----
The commands pvcreate and mkboot both use the raw disc device file and the commands vgextend and lvextend both use the block disc device file.
Deshpande Prashant
Honored Contributor

Re: Mirroring rootvg

HI
This is how I did.
## Prepare the disk (c2t6d0 in my case)
pvcreate -Bf /dev/rdsk/c2t6d0
vgextend /dev/vg00 /dev/dsk/c2t6d0

mkboot /dev/rdsk/c2t6d0
mkboot -a "hpux -lq" /dev/rdsk/c2t6d0
lvlnboot -v
lvlnboot -R
## Mirror the logical volumes.
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t6d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t6d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t6d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t6d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t6d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t6d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t6d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t6d0

#Verify
lvlnboot -v

#Verify lvol state (all shoud be current)
for N in 1 2 3 4 5 6 7 8
do
lvdisplay -v /dev/vg00/lvol${N}
done


# Backup th LVM configuration
vgcfgbackup vg00


Thanks.
Prashant.

Take it as it comes.
DIPAK KUMAR ROY
Frequent Advisor

Re: Mirroring rootvg

This is how I do it........ (assuming the new disk as /dev/dsk/c2t13d0)...


pvcreate -B -f /dev/rdsk/c2t13d0
mkboot /dev/dsk/c2t13d0
mkboot -a "hpux (;0)/stand/vmunix" /dev/dsk/c2t13d0
vgextend /dev/vg00 /dev/dsk/c2t13d0
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t13d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t13d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t13d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t13d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t13d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t13d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t13d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t13d0
lvlnboot -r /dev/vg00/lvol3
lvlnboot -s /dev/vg00/lvol2
lvlnboot -d /dev/vg00/lvol2
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R