[HPADM] Summary MirrorDisk/UX 11.00

From: Thomas Northup (thomaslnorthup@yahoo.com)
Date: Mon Nov 10 2003 - 10:00:54 EST


This list has been great as usual. Thanks for all your help.
I did leave out some lvlnboot commands. I ended up using a script that Jim Langston sent me and it worked great.
Thanks,
Tom

Here was the original question...
Admins,
I have already installed MirrorDisk/UX 11.00 on my HP-UX 11.00 system and now I want to create the mirrors.

I have outlined the steps that I think I need to take below. Have I missed anything? Is there anything in the steps that are not necessary?
Thanks
Tom

# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 0 0/0/1/1.2.0 sdisk CLAIMED DEVICE HP 73.4GMAN3735MC
                         /dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 1 0/0/2/0.2.0 sdisk CLAIMED DEVICE HP 73.4GATLAS10K3_73_SCA
                         /dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
 
Note: c1t2d0 i! s the boot disk and c2t2d0 is the mirrored disk.
      
1) Initialize the disk and make it bootable
        pvcreate -B /dev/rdsk/c2t2d0
            Note: the -B parameter tells pvcreate that this will be a bootable disk.
      
2) Add the physical volume to the volume group
            vgextend /dev/vg00 /dev/dsk/c2t2d0
      
3) Use mkboot to place the boot utilities in the boot area and add the AUTO file.
            mkboot /dev/dsk/c2t2d0
            mkboot -a "hpux -lq" /dev/rdsk/c2t2d0
      
4) Use mkboot to update the AUTO file on the primary boot disk.
            mkboot -a "hpux -lq" /dev/rdsk/c1t2d0
      
5) Mirror the stand, root and swap logical volumes
            lvextend -m 1 /dev/vg00/lvol1
            lvextend -m 1 /dev/vg00/lvol2
            lvextend -m 1 /dev/vg00/lvol3

Note: LVM will resynchronize the new mirror copies.

Repeat the lvextend for all other logical volumes on the boot mirror.
            lvextend -m 1 /dev/vg00/lvol4
            lvextend -m 1 /dev/vg00/lvol5
            lvextend -m 1 /dev/vg00/lvol6
            lvextend -m 1 /dev/vg00/lvol7
            lvextend -m 1 /dev/vg00/lvol8

6) Modify your alternate boot path to point to the mirror copy of the boot disk.
Note: Use the Hardware path for your new boot disk.
            setboot -a 0/0/2/0.2.0

 

 

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

Jim Langston

Here is a script that I use. All you need to do is ftp it to your server, chmod 700 on the file then run the command with the cxtxdx name

( i.e. mirrorboot.ksh c2t2d0)

If you have already added that disk name to a volume group, remove it as this script does everything for you. I've used it upteen number of times and it works great!
 
See script below
---cut---
#.......................................................................
# Check to see if a parameter was passed
#.......................................................................
if test $# -ne 1
then
   echo "A Parameter needs to be passed"
   return 1
fi

#.......................................................................
# Since a parameter was passed, verify it was good, if not make it incremental
#.......................................................................

# Initialize disk
pvcreate -f -B /dev/rdsk/$1

# Add this disk to the current root volume group.
vgextend /dev/vg00 /dev/dsk/$1

# Make the new disk a boot disk.
mkboot /dev/rdsk/$1

# Copy the correct AUTO file into the new LIF area.
mkboot -a "hpux -lq (;0)/vmunix" /dev/rdsk/$1

# 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.
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/$1
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/$1
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/$1
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/$1
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/$1
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/$1
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/$1
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/$1

# NOTE The boot logical volume (/dev/vg00/lvol1 by default) must be done first to
# ensure that it occupies the first contiguous set of extents on the new disk.
# Update the boot information contained in the BDRA for the mirror
# copies of boot, root and primary swap.

/usr/sbin/lvlnboot -b /dev/vg00/lvol1
/usr/sbin/lvlnboot -v -r /dev/vg00/lvol3
/usr/sbin/lvlnboot -s /dev/vg00/lvol2

# Check if the BDRA is correct.
/usr/sbin/lvlnboot -R /dev/vg00

# Verify that the mirrors were properly created.
lvlnboot -v

# The output of this command is shown in a display like the following:#
# Boot Definitions for Volume Group /dev/vg00:
# Physical Volumes belonging in Root Volume Group:
# /dev/dsk/c4t5d0 (10/0.5.0) Boot Disk
# /dev/dsk/c4t6d0 (10/0.6.0) Boot Disk
# Boot: lvol1 on: /dev/dsk/c4t5d0
# /dev/dsk/c4t6d0
# Root: lvol3 on: /dev/dsk/c4t5d0
# /dev/dsk/c4t6d0
# Swap: lvol2 on: /dev/dsk/c4t5d0
# /dev/dsk/c4t6d0
# Dump: lvol2 on: /dev/dsk/c4t6d0, 0
---cut---

----------------------------------------------------------------------
Bob Vance

A couple additional things that I do:
 
at step 3:
   NOTE that 'mkboot' ONLY copies the DEFAULT set of boot LIF files.
   I also include the following command to copy ALL the LIF files, in case any other
   utilities (like ODE) were installed on the original boot disk:
           for f in `lifls /dev/rdsk/c1t2d0` ;
           do lifcp /dev/rdsk/c1t2d0:$f /dev/rdsk/c2t2d0:$f ;
           done
   NOTE the $f at the end of BOTH device: names !!!
 
step 3.5 :>) (before the actual mirroring)
Set MWC **OFF** on the swap lvols:
       First, do primary system swap lvol:
            reboot -- interrupt boot process
            hpux -lm -lq #from the ISL prompt
            vgchange -a y vg00
            lvchange -M n -c n /dev/vg00/lvol2
 
       Once the system is back up, you may notice, while using bdf,
       that / is not the
            /dev/vg00/lvol1
       filesystem, but is labeled as /dev/root.
       To correct this, do a:
            rm /etc/mnttab
       and then do a:
            mount -a # make sure that there are no entries in /etc/fstab
                          # that you do not want mounted at this point.
 
       The other lvols can be done in single-user mode
            reboot -- interrupt boot process
            hpux -is -lq #from the ISL prompt
            lvchange -M n -c n /dev/vg00/lvoln # on other swap lvols
            init 3
 
at step 4:
Verify that the correct string has been installed on BOTH disks:
        lifcp /dev/dsk/c1t2d0:AUTO - | head -1
        lifcp /dev/dsk/c2t2d0:AUTO - | head -1

 
step 4.5:
Consider using PVG (it's sorta required if you ever want to use distributed allocation and mirroring -- not an issue, though, unless you are striping and mirroring over 4 drives. The idea, though, is useful to keep in mind, especially for "external" VGs where you may have 4 or more drives being used):
 
create /etc/lvmpvg (e.g., use vi editor)
zeus ## cat /etc/lvmpvg | sed 's/^/ /'
  VG /dev/vg00
  PVG vg00_a
  /dev/dsk/c1t2d0
  PVG vg00_b
  /dev/dsk/c2t2d0
 
Then, change the mirroring policy to PVG-strict:
            lvchange -s g /dev/vg00/lvol1
            lvchange -s g /dev/vg00/lvol2
                   . . .

step 7:
Now, update the boot information contained in the BDRA (Boot Data
       Reserved Area) of the boot disks in the root volume group with
       the locations of the mirror copies of root and primary swap.
 
            lvlnboot -R #recovers any BDRAs
            lvlnboot -r /dev/vg00/lvol3 #specifies the root LV
            lvlnboot -b /dev/vg00/lvol1 #specifies the boot LV
            lvlnboot -s /dev/vg00/lvol2 #specifies the swap LV
 
       Also, you can use -v option to have LVM report its activities.

----------------------------------------------------------------------
Angelo Collazo

I would use SAM for this. Hope this helps.
   
----------------------------------------------------------------------
Aoratos

Here is a list of commands I have used successfully several times. The
list is from a "cookbook" given me by HP field personnel.

#pvcreate -B /dev/rdsk/c2t2d0
#mkboot /dev/rdsk/c2t2d0
#mkboot -a "hpux –lq (;0)/stand/vmunix" /dev/rdsk/c2t2d0
#mkboot -b /usr/sbin/diag/lif/updatediaglif (NOTE: updatediaglif2 for
64
bit) –p ISL –p AUTO –p HPUX –p LABEL /dev/rdsk/c2t2d0
#vgextend /dev/vg00 /dev/dsk/c2t2d0
#lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0 (mirror /stand)
#lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t2d0 (mirror swap)
#lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t2d0 (mirror /)
#lvlnboot -b /dev/vg00/lvol1
#lvlnboot -r /dev/vg00/lvol3
#lvlnboot -s /dev/vg00/lvol2
#lvlnboot -d /dev/vg00/lvol2
#lvlnboot -R /dev/vg00
#lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t2d0 (mirror /home)
#lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t2d0 (mirror /opt)
#lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t2d0 (mirror /tmp)
#lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t2d0 (mirror /usr)
#lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t2d0 (mirror /var)

Now, edit the /stand/bootconf file and add a line for the new disk
l /dev/dsk/c2t2d0

I don't believe that your "mkboot -a" on the primary disk is necessary,
but I am not sure on that.

Don't forget to manually test and verify that you can boot from the
secondary disk.

----------------------------------------------------------------------
Rick Starr

pvcreate -B /dev/rdsk/c2t2d0

 

mkboot -l /dev/rdsk/ c2t2d0

mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/ c2t2d0

# (NO SPace between disk section ;0) and /stand/vmunix)

 

lifls /dev/rdsk/c1t2d0

This list ultilities installed on current boot disk

You'll want to preserve each of these utilites in the next steps

cd /usr/sbin/diag/lif

mkboot -b updatediaglif2 -p ISL -p AUTO -p HPUX -p LABEL -p PAD /dev/rdsk/c2t2d0

   #lifcp /dev/rdsk/cxtxdx:FILE /dev/rdsk/cytydy:FILE

   #This has to be done for each utility, some utilities like

   #ode have multiple parts for example just copying ode

   #will not allow boot from isl without syslib.

 

#Manually run setboot -a command to set alternate boot path

vgextend vg00 /dev/dsk/$disk

#mirror logical volumes

for x in 1 2 3 4 5 6 7 8

do

lvextend -m 1 /dev/vg00/lvol"$x" /dev/dsk/c2t2d0

done

----------------------------------------------------------------------
Wolf-Dietrich Schmook

you seem to omit step 7:

lvlnboot -b /dev/vg00/lvol1 # /stand
lvlnboot -s /dev/vg00/lvol2 # primary swap
lvlnboot -r /dev/vg00/lvol3 # /
lvlnboot -d /dev/vg00/lvol2 # primary swap used for dump

----------------------------------------------------------------------
Tom Myers

There are a couple more things to do, specifically the lvlnboot
updates.
This is our process (obviously culled from a script ;-):

1) pvcreate -fB /dev/rdsk/c2t2d0
2) mkboot /dev/rdsk/c2t2d0
3) mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c2t2d0
4) mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t2d0
5) vgextend /dev/vg00 /dev/dsk/c2t2d0
6) for Volume in `ls /dev/vg00/lvol*`
   do
     echo ">>Mirroring $Volume<<"
     lvextend -m 1 $Volume /dev/dsk/c2t2d0
   done
7) echo "Defining the root logical volume"
   lvlnboot -r /dev/vg00/lvol3
8) echo "Defining swap logical volume"
   lvlnboot -s /dev/vg00/lvol2
9) echo "Defining dump logical volume"
   lvlnboot -d /dev/vg00/lvol2
10) echo "Defining the boot logical volume"
    lvlnboot -b /dev/vg00/lvol1
11) echo "Recovering any BDRA info"
    lvlnboot -R
12) echo "Configuring alternate bootpath"
    setboot -a 0/0/2/0.2.0

----------------------------------------------------------------------
Erik Platzbecker
looks 'perfect' to me ...; except for device names and hardware
paths
    this is 'identical' to my own recipe

----------------------------------------------------------------------
Thomas Leber

Copy all of the stuff from the LIF area to the mirror as well:

for f in `lifls /dev/rdsk/c1t2d0` ;
do lifcp /dev/rdsk/c1t2d0:$f /dev/rdsk/c2t2d0:$f ;
done

----------------------------------------------------------------------
Craig Johnson

I think you are missing some lvlnboot commands at the end, but I could be wrong. It's been awhile since I did this.
 
----------------------------------------------------------------------

---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:36 EDT