1821584 Members
3403 Online
109633 Solutions
New Discussion юеВ

Root disk mirroring

 
Park Phil
New Member

Root disk mirroring

I have in the past had difficulty in setting up a root disk mirror , especially
when creating the boot LIF entry on the disk. Can anyone supply a quick answer
to the required commands to create the boot block on the disk and in what order
I should mirror the root disk LV's ?

Thanks in advance.
10 REPLIES 10
Charles Guiocheau
Occasional Advisor

Re: Root disk mirroring

Hello,

1) pvcreate -B /dev/rdsk/c1t5d0

2) Add a physical Volume
vgextend /dev/vg00 /dev/dsk/c1t5d0

3) mkboot /dev/rdsk/c1t5d0

4) mkboot -a "hpux (52.3.0;0)/stand/vmunix" /dev/rdsk/c1t5d0

5) lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t5d0
for each logical volume
6) lvlnboot -v for verification

7) lvdisplay -v /dev/vg00/lvol1


Hope this can help you.

Refer to your Administrator Task Guide for Hpux system
Tammy Rogers_1
Occasional Advisor

Re: Root disk mirroring

When you mirror your lvols, it is critical to mirror
the swap lvol in the same order as the original disk.
The best bet is to do a pvdisplay -v on your original
root disk, then just mirror the lvols in the same order
on your mirrored disk.
Maragua
New Member

Re: Root disk mirroring

please let me know whether you are setting up the mirror on itanium server or PA RISC servers.
James R. Ferguson
Acclaimed Contributor

Re: Root disk mirroring

Hi:

You don't specify PA-RISC versus Itanium, and the procedure for setting up root disk differs slightly. See appendix-A of this document:

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf

As for the order to mirror the logical volumes within vg00, you must do 'lvol1, lvol2, lvol3' in that order. There is no reason not to mirror in ordinal number sequence everything, though. Mirror everything!

Regards!

...JRF...
Pete Randall
Outstanding Contributor

Re: Root disk mirroring

The steps to mirror your boot volume are (PA-RISC):

1. Create a physical volume with a boot reserved area
"pvcreate -B /dev/rdsk/c1t6d0"

2. Add the physical volume to the root VG
"vgextend /dev/vg00 /dev/dsk/c1t6d0"

3. Use mkboot to place the boot utilities in the boot area and add the AUTO file
"mkboot /dev/rdsk/c1t6d0"
"mkboot -a "hpux -lq" /dev/rdsk/c1t6d0"

4. Use mkboot to update the AUTO file on the primary boot disk
"mkboot -a "hpux -lq" /dev/rdsk/c0t6d0"

5. Mirror the stand, root and swap logical volumes
"lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t6d0"
"lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c1t6d0"
"lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c1t6d0"

6. Modify your alternate boot path
"setboot -a 8/8.6.0 # use the path of your new boot disk"

7. Edit /stand/bootconf and add your new mirrored boot disk.

That's all there is to it. You may notice that I left out any
lvlnboot commands. That is because they are not
necessary - see the man page:

"This command should be run in recovery mode (-R)
whenever the configuration of the root volume group is
affected by one of the following commands: lvextend,
lvmerge, lvreduce, lvsplit, pvmove, lvremove, vgextend,
or vgreduce (see lvextend(1M), lvmerge(1M), lvreduce(1M),
lvsplit(1M), pvmove(1M), lvremove(1M), vgextend(1M), and
vgreduce(1M)). Starting with HP-UX Release 10.0, this is
done automatically."


For Itanium architecture, follow this guide:
http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,5343,00.html
-or-
http://docs.hp.com/en/B2355-90950/ch06s02.html#cchgjafa


Pete

Pete
Steven E. Protter
Exalted Contributor

Re: Root disk mirroring

Shalom,

To have a system that will boot on two disks, all logical volumes required by roomt must be mirrored.

pvcreate -B /dev/rdsk/c1t0d0 #use real disk

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk


# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?

If you are running 64-bit OS:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?


vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk

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
ricky2
Frequent Advisor

Re: Root disk mirroring

Hi Park,
Iam not sure but check if this helps...
To set up a mirrored root config you need to add an additional disk (e.g. c1t6d0) to the root VG mirror all the LVs and make it bootable.
1. Initialize the disk and add it to vg00:
# pvcreate [-f] -B /dev/rdsk/c1t6d0
# vgextend vg00 /dev/dsk/c1t6d0
2. Mirror the LVs using lvextend:
# lvextend ├в m 1 /dev/vg00/lvolX /dev/dsk/c1t6d0
If you want to use a shell loop to extend automatically, use e.g.:
# for lvol in lvol1 lvol2 ... lvol8 (specify any LV you need to mirror)
> do
> lvextend -m 1 /dev/vg00/$lvol /dev/dsk/c1t6d0
> done
3. Specify the mirror disk as alternate boot path in stable storage:
# setboot ├в a
To determine the hardware path use e.g. ioscan:
# ioscan -fnk /dev/dsk/c1t6d0
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 0 0/0/2/0.6.0 sdisk CLAIMED DEVICE SEAGATE ST39102LC
/dev/dsk/c1t6d0 /dev/rdsk/c1t6d0
# setboot ├в a 0/0/2/0.6.0
4. Add the new mirror boot device to /stand/bootconf, e.g.:
l /dev/dsk/c0t6d0 (original boot device)
l /dev/dsk/c1t6d0 (new mirror boot device)
If you like to remove the mirror again, you need to use lvreduce:
# lvreduce -m 0 /dev/vg00/lvolX /dev/dsk/c1t6d0

Regards,
Ricky
Geoff Wild
Honored Contributor

Re: Root disk mirroring

Say /dev/dsk/c0t6d0 is the root disk and /dev/dsk/c3t6d0 is the disk you want to make a mirror of.

1. Create a bootable LVM disk to be used for the mirror.
pvcreate -B /dev/rdsk/c3t6d0
2. Add this disk to the current root volume group.
vgextend /dev/vg00 /dev/dsk/c3t6d0
3. Make the new disk a boot disk.
mkboot -l /dev/rdsk/c3t6d0
4. Copy the correct AUTO file into the new LIF area.
mkboot -a "hpux -lq (;0)/vmunix" /dev/rdsk/c3t6d0
5. Mirror the boot, root and primary swap logical volumes to the new
bootable disk. Ensure that all devices in vg00, such as /usr, /swap,
etc., are mirrored.
The following is an example of mirroring the boot logical volume:
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c3t6d0
The following is an example of mirroring the primary swap logical
volume:
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c3t6d0
The following is an example of mirroring the root logical volume:
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c3t6d0
6. Update the boot information contained in the BDRA for the mirror
copies of boot, primary swap and root.
/usr/sbin/lvlnboot -b /dev/vg00/lvol1
/usr/sbin/lvlnboot -s /dev/vg00/lvol2
/usr/sbin/lvlnboot -r /dev/vg00/lvol3
7. Check if the BDRA is correct.
/usr/sbin/lvlnboot -R /dev/vg00
8. Verify that the mirrors were properly created.
lvlnboot -v /dev/vg00
The output of this command is shown in a display like the following:
Boot Definitions for Volume Group /dev/vg00:
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c0t6d0 (1/0/0/3/0.6.0) -- Boot Disk
/dev/dsk/c3t6d0 (1/0/1/0/0/1/1.6.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c0t6d0
/dev/dsk/c3t6d0
Root: lvol3 on: /dev/dsk/c0t6d0
/dev/dsk/c3t6d0
Swap: lvol2 on: /dev/dsk/c0t6d0
/dev/dsk/c3t6d0
Dump: lvol2 on: /dev/dsk/c0t6d0, 0

vgdisplay -v vg00

Then lvextend for all other lvols:

lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol9 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol10 /dev/dsk/c3t6d0
lvextend -m 1 /dev/vg00/lvol11 /dev/dsk/c3t6d0


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.
A. Clay Stephenson
Acclaimed Contributor

Re: Root disk mirroring

The most common mistake is failing to use the -B option of pvcreate. The next most common error is failing to do the 1st 3 LVOL's in strict order; these must be contigiously allocated.

This script should do it for you (assuming standard LVOL's in vg00):

#!/usr/bin/sh

typeset RAW=/dev/rdsk/c1t5d0 # the mirror
typeset COOKED=/dev/dsk/c1t5d0 # ditto but block device

pvcreate -f -B ${RAW}
vgextend /dev/vg00 ${COOKED}
mkboot ${RAW}
mkboot -a "hpux -lq (;0)/stand/vmunix" ${RAW}

typeset LVOLS="lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 lvol8" # alter to match your actual vg00
typeset LVOL=""

for LVOL in ${LVOLS}
do
lvextend -m 1 /dev/vg00/${LVOL} ${COOKED}
done

Now, I would also do
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/whatever_your_primary_boot_device_is

because unless you do this, your machine is actually less likely to boot unattended that if you were not mirrored
If it ain't broke, I can fix that.