Replacing Boot Mirror Disk			updated 12/17/03    

There are two ways to replace a bad or defective hot-pluggable boot mirror disk. If the boot disk is pretty bad and not responding at all, as with lots of stale PEs on the disk and you are not able to run LVM commands on it. Please use the first method and the vgcfgrestore procedure to replace it.

If the disk is still functional, just logging some defect error, please use the second method of removing it from vg00 volume group first and creating a new boot disk from scratch.

NOTE: Hot Pluggable simply means the disk can be removed without halting the system. However, LVM commands will have to be run in order to complete the disk replacement. So always turn in Vantive ticket and replace it at maintenance window.

METHOD ONE:  If a boot mirror disk is not responding at all, replace it without breaking the mirror first:

NOTE: during maintenance window, after HP CE replace the bad boot disk, and then do these commands to recover LVM information on the replaced disk:

In this example, the bad boot mirror disk to be replaced will be /dev/dsk/c0t5d0.

ioscan –fnC disk	
(NOTE: you may have to run this ioscan twice. Do it until the disk shows up as CLAIMED)
vgcfgrestore -n /dev/vg00 /dev/rdsk/c0t5d0
	mkboot /dev/rdsk/c0t5d0
	mkboot -a "hpux -lq" /dev/rdsk/c0t5d0
	vgchange -a y /dev/vg00  
	vgsync /dev/vg00   
	lvlnboot -R /dev/vg00

METHOD TWO:  If a boot mirror disk is still functional, break mirror and remove it from vg00 first before replacing it

As example on this procedure, the bad boot mirror disk to be replaced will be /dev/dsk/c0t5d0, and the “primary boot disk” means the good boot disk, which will not be replaced.

1. Break all LVM mirrors on c0t5d0:

# lvreduce  -m 0 <lv_path> /dev/dsk/c0t5d0

For example:

#lvreduce -m 0 /dev/vg00/stand /dev/dsk/c0t5d0 
# lvreduce  -m 0 /dev/vg00/swap /dev/dsk/c0t5d0 
# lvreduce -m 0 /dev/vg00/root /dev/dsk/c0t5d0

2. Reduce the bad disk from vg00 Volume Group 
  
      	# vgreduce  /dev/vg00  /dev/dsk/c0t5d0

3. Ask HP CE to replace the disk. Then run ioscan –fnC disk until the disk shows up as CLAIMED.

4. Create the PVRA on new mirror boot disk

    # pvcreate -B /dev/rdsk/c0t5d0

5. Add the physical volume to the existing root volume group with vgextend:

    # vgextend /dev/vg00 /dev/dsk/c0t5d0

6. Use mkboot to place boot utilities in the boot area:

    # mkboot  /dev/rdsk/c0t5d0

7. Use mkboot to add an AUTO file in boot LIF area:

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

NOTE: use “hpux –lq” so that when primary boot disk is bad, the mirror disk can still boot without quorum error (in the case of only two disks on vg00). Because each volume group need to have at least 51% available disks to activate the volume group

8. Check the contents of the AUTO file with

    # lifcp /dev/rdsk/c0t5d0:AUTO  –

	NOTE: it should show “hpux –lq”

9. Use “pvdisplay –v” command to find the order of the logical volumes on the primary boot disk.

    # pvdisplay -v / dev/dsk/<primary-disk>

NOTE: Use pvdisplay and check the order of PE mapping LVs on primary boot disk and mirror them the same order on the replaced boot disk.

10. Mirror the boot, primary swap, root and other logical volumes as needed to the mirror disk in the correct sequence ( In the following, the standard sequence stand, swap, root, and so forth, is assumed. To make disks bootable, the LV order should be: stand first, swap second, and root third.)

    # lvextend -m 1 /dev/vg00/stand /dev/dsk/c0t5d0
    # lvextend -m 1 /dev/vg00/swap /dev/dsk/c0t5d0
    # lvextend -m 1 /dev/vg00/root /dev/dsk/c0t5d0
    # lvextend -m 1 (additional LV)

11. Use pvdisplay -v to verify the order of the logical volumes on the replaced disk to insure they are in the correct order.

    # pvdisplay -v /dev/dsk/c0t5d0

12. List the contents of the LIF directory of the replaced disk, it needs to contain at least ISL, AUTO, HPUX, and LABEL:

    # lifls -l /dev/rdsk/c0t5d0

    volume ISL10 data size 7984 directory size 8 96/05/28 04:10:13
    filename   type   start   size     implement  created
    ===============================================================
    ISL        -12800 584     240      0          96/05/28 04:10:13
    AUTO       -12289 824     1        0          96/05/28 04:10:13
    HPUX       -12928 832     848      0          96/05/28 04:10:13
    PAD        -12290 1680    1652     0          96/05/28 04:10:14
    LABEL      BIN    3336    8        0          99/01/25 06:00:41

13. Check if you have ODE (Offline Diagnostics) LIF files installed on the primary boot disk:

# lifls -l /dev/rdsk/<primary-disk> 

This will list content of LIF directory on primary boot disk, if it only contains ISL, HPUX, AUTO, PAD, and LABEL, then you can go to step 17 directly without going through steps 14-16. But If there are more files than above on LIF directory, you need these additional steps below to install ODE on replaced boot disk. 

14. Check the existence of  updatediaglif file:

# ll /usr/sbin/diag/lif/update*

-r--r--r--   1 bin        bin         832512 Jan 22  2002 updatediaglif
-r--r--r--   1 bin        bin         756736 Jan 22  2002 updatediaglif2

15. Install the ODE LIF files with mkboot and protect (-p) the existing LIF files which you detected with lifls as described above, e.g.:

Warning: Do not do this to boot disk on the V Class servers.  No ODE is stored on V Class boot disks.  The data is stored on the V Class Workstations.

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

or

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c0t5d0

NOTE: the file updatediaglif2 is only for pure 64-bit systems (e.g N-Class). For 32-bit systems or systems that support both CPU types (e.g K-Class) use the file updatediaglif. 

Use getconf HW_CPU_SUPP_BITS in order to check your system type:

# getconf HW_CPU_SUPP_BITS
The result is either 32, 32/64 or 64.

16. Check the LIF directory again:

# lifls /dev/rdsk/c0t5d0

You will find additional LIF files on replaced boot disk, just like the primary boot disk, e.g.

   ODE          MAPFILE      SYSLIB       CONFIGDATA   SLMOD
   SLDEV        SLDRIVERS    SLSCSI       MAPPER       IOTEST
   PERFVER      PVCU         SSINFO       ISL          HPUX
   AUTO         PAD          LABEL

17. Re-write the contents of the BDRA to the boot disks(Boot Data Reserved Area)

   #lvlnboot -R /dev/vg00

18. Verify boot, root, swap and dump settings

  #lvlnboot –v

Both boot disks must be listed for root, boot and swap definitions.

Example: 
# lvlnboot -v /dev/vg00 
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/c5t5d0 (10/8.5.0) -- Boot Disk 
Boot: stand     on:     /dev/dsk/c4t5d0 
                      	  /dev/dsk/c5t5d0 
Root: root      on:     /dev/dsk/c4t5d0 
                        	/dev/dsk/c5t5d0 
Swap: swap     on:     /dev/dsk/c4t5d0 
                        	/dev/dsk/c5t5d0 

19. Check the Primary and alternate boot paths that are currently set

   # setboot

20. In order to test the replace boot disk bootable, you can shut down the system, interrupt reboot, and boot from this disk. You do not need to reboot back off of the primary disk after you test the boot ability of the drive that you replaced. Once the system is booted, it does not care which disk that it booted off of. 

 Or if this replaced disk is primary boot disk, just reboot box to test. If it is alternate boot disk, you can use setboot command to change primary to alternate, and alternate to primary, then reboot box to test.

To use interrupt boot sequence method to test boot disk like this:

    # shutdown -ry 0

The system will shut down and reboot. As the system starts to come back up, look for the message (system's output may vary):

    TO INTERRUPT THE BOOT SEQUENCE, PRESS ...

Interrupt the boot sequence. This will display the Boot Admin display, at the prompt, type:

    bo hardware path of replaced boot disk  

or type bo pri or bo alt if you know this replaced disk is primary boot or alternate boot disk.

.