1752790 Members
6234 Online
108789 Solutions
New Discussion юеВ

Steps to setup Mirroring

 
Scott Clement_2
Advisor

Steps to setup Mirroring

What are the steps to setup mirror between 2 internal drives?
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: Steps to setup Mirroring

HP-UX 11i v1

root mirror. Instructions are different for 11.23

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

Adust the disk paths to your reality.

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
Geoff Wild
Honored Contributor

Re: Steps to setup Mirroring

Is this for HP-UX?

How to mirror the root disk:

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.
Stuart Abramson
Trusted Contributor

Re: Steps to setup Mirroring

the answers above look good to me.

Here's a script I have used. check it out carefully before you use!

##
# mirror_root_disk.ksh SDA 10/23/03
#
# Starting conditions:
# cLEFT is already built correctly.
# cRIGHT is "empty" and unassigned.
#

# Define disks

cLEFT=c0t6d0 # 1/0/0/3/0.6.0
cRIGHT=c4t6d0 # 1/0/1/0/0/1/1.6.0

# Make right disk bootable

pvcreate -B /dev/rdsk/${cRIGHT}
vgextend vg00 /dev/dsk/${cRIGHT}
mkboot -l /dev/rdsk/${cRIGHT} # boot disk only
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/${cRIGHT}

# Mirror the LVs

vgdisplay -v vg00 | grep "LV Name" | awk '{print $3}' | while read LV
do
lvextend -m 1 $LV /dev/dsk/${cRIGHT}
#lvdisplay $LV
done

#

lvlnboot -R # Update BDRAs
lvlnboot -v # Shows boot status

# Verify..

lifcp /dev/dsk/${cLEFT}:AUTO -
lifcp /dev/dsk/${cRIGHT}:AUTO -
lifls /dev/dsk/${cLEFT}
lifls /dev/rdsk/${cRIGHT}

setboot
Joshua Scott
Honored Contributor

Re: Steps to setup Mirroring

Excellent directions, but remember to test the mirror by booting off the 2nd drive.

Stop the bootup process when it gives the 10 second window of opportunity.

bo

Josh
What are the chances...
A. Clay Stephenson
Acclaimed Contributor

Re: Steps to setup Mirroring

The one step that is often omitted is
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/cXtYdZ

on the primary boot device as well as the alternate boot disk. Unless you do this on the primary you actually make the box less likely to boot because both drives have to be available.

If it ain't broke, I can fix that.
noldi
Valued Contributor

Re: Steps to setup Mirroring

Here's the procedure if your current VM is
VxVM (excerpts from my recent track 761217
on this):

1) vxdisksetup -iB cxtydzs2
2) vxrootmir -bv cxtydzs2

did the trick and mirrored my existing system
disk to another under VxVM. Above steps were
for the Integrity server. For the PA-RISC
machine, I had to leave out the partition
designator, everything else was the same:

1) vxdisksetup -iB cxtydz
2) vxrootmir -bv cxtydz

This did work for me on either architecture.

Best Regards,

Arnold
Joshua Scott
Honored Contributor

Re: Steps to setup Mirroring

Arnold, your solution is correct if one is using Veritas Volume Manager instead of LVM.

Josh
What are the chances...
noldi
Valued Contributor

Re: Steps to setup Mirroring

Josh,

> your solution is correct if one is using
> Veritas Volume Manager instead of LVM.

Right. But since Scott did not say which
VM he is using (and I ran into this questions
a few days ago) I thought I might add this
extra info.

Regards,

Arnold
P.S.: . . and with the recent HP-UX "Roadmap
Enhancement", we might see more and more
people using Veritas products in the future.
Joshua Scott
Honored Contributor

Re: Steps to setup Mirroring

Arnold,

It wasn't my intention to discredit your answer, but just to clarify. I know many SysAdmins who swear by VxVM. There is sometimes confusion because HP11i's LVM is also called "LVM using VxVM". Thanks for the Veritas Solution, as I'm not well versed in VxVM.

Josh
What are the chances...