반응형
Mirrored Boot Disk on PA-RISC Systems - Cookbook
How to create a Mirrored Boot Disk on PA-RISC Systems - Cookbook
DocId:
LVMKBRC00005103
Updated:
5/6/04 10:09:00 AM
PROBLEM
By using mirror copies of the root or primary swap logical volumes on another disk, I will be able to use the copies to keep my system in operation, if either of these logical volumes fail.
How can I create a mirrored boot disk?
CONFIGURATION
HP-UX 10.x, 11.x on PA-RISC
LVM
MirrorDisk-UX
RESOLUTION
NOTE: This cookbook describes the necessary steps to create a mirrored boot disk on PA-RISC systems. This procedure is not applicable to Itanium systems. Refer to KBRC00011156 (Mirroring LVM Root Disk On Itanium Systems).
NOTE: The HP MirrorDisk-UX product is a prerequisite for the following procedure. You can check that MirrorDisk-UX is installed in the following way
# swlist -l fileset | grep -i mir
which should return the LVM-MIRROR- RUN fileset:
LVM.LVM-MIRROR-RUN B.11.11 LVM-MIRROR-RUN
A WORD TO PATCHES:
Do not use LVM commands patches PHCO_24809 (HP-UX 11.11) or PHCO_24645 (HP-UX 11.0). These patches introduced behavior that can result in potential corruption of the Boot Data Reserved Area (BDRA) of a bootable volume group configured with alternate links.
Do not use HP-UX 11.0 mkboot patch PHCO_20869, because it delivers a dynamically linked version of /sbin/mkboot, instead of a statically linked version of the file. Remove this patch and install the previous mkboot patch, PHCO_19656.
In this example, the disk to be used as an additional mirror copy will be /dev/dsk/c0t5d0, which will include the boot, root, and the swap logical volumes. The primary mirror copy will be on /dev/dsk/c0t6d0.
1. Add a bootable LVM disk. Create a physical volume using pvcreate with the -B option.
# pvcreate -B /dev/rdsk/c0t5d0
Refer to LVMKBRC00006255 if pvcreate errors with "The physical volume already belongs to a volume group."
2. Add the physical volume to the existing root volume group with vgextend:
# vgextend /dev/vg00 /dev/dsk/c0t5d0
3. Use mkboot to place boot utilities in the boot area:
# mkboot -l /dev/rdsk/c0t5d0
Use mkboot to add an AUTO file in boot LIF area:
# mkboot -a "hpux" /dev/rdsk/c0t5d0
Or, use the -lq option to allow the system to boot in the event that one of the disks is unavailable, resulting in a loss of quorum.
# mkboot -a "hpux -lq" /dev/rdsk/c0t5d0
NOTE: Use the -lq option when the root volume group contains only 2 disks. If more than 2 disks are in the root volume group, the -lq option is not needed as quorum will be maintained even if 1 disk fails.
Check the contents of the AUTO file with
# lifcp /dev/rdsk/c0t5d0:AUTO -
Alternatively, one could set the alternate boot path variable according to for example
# setboot -a 8/0/19/0.5.0
The hardware address of the disk that will become the mirror disk can be determined with 'ioscan -fnC disk'. To check, use setboot without any arguments.
If desired, activate autosearch and autoboot by
# setboot -s on -b on
4. Use pvdisplay -v to note the sequence of the logical volumes on the primary disk.
# pvdisplay -v /dev/dsk/c0t6d0
NOTE: In the following, the standard sequence lvol1, lvol2, lvol3, and so forth, is assumed.
Create mirror copies of the boot logical volume, primary swap logical volume, root logical volume, and other logical volumes as needed, in the correct sequence
# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t5d0
# lvextend -m 1 (additional LV)
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t5d0
# lvextend -m 1 (additional LV)
Use pvdisplay -v to check the correct sequence of the logical volumes on the mirror disk.
# pvdisplay -v /dev/dsk/c0t5d0
5. Update all physical volumes in the volume group so that the logical volume become the root, boot, primary swap, or a dump volume when the system is next booted:
For HP-UX 10.20 (not updated to) and 11.X only:
# lvlnboot -r /dev/vg00/lvol3 /dev/vg00
# lvlnboot -b /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00
# lvlnboot -b /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00
With LVM commands cumulative patches newer than PHCO_24809 (11.11) or PHCO_24645 (11.0) and configured alternate links (check with /usr/sbin/lvlnboot -v | grep "alternate link") use additionally
# lvlnboot -R
to recover missing links immediately.
For HP-UX 10.01, 10.10, and updates to 10.20 only:
# lvlnboot -r /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00
Check with
# lvlnboot -v
Both disks must be listed for root, boot and swap definitions.
NOTE: Without the lvlnboot sequence the system will not be able to boot automatically if the primary disk fails.
In order to correct it then, the system will have to be booted into LVM maintenance mode.
6. In order to test the mirror configuration, shut down the system and boot from the mirror disk.
# 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 boot_admin> prompt type:
bo Mirror_disk_hardware_address or
bo alt
bo alt
if the alternate boot device has been configured. The system will prompt to interact with IPL, answer 'no', and the system will boot from the mirror root disk.
NOTE: This example includes creating a mirror copy of the primary swap logical volume. The primary swap mirror does not need to be on a specific disk or at a specific location, but it does need to be allocated on contiguous disk space. The recommended mirror policy for primary swap is to have the Mirror Write Cache and the Mirror Consistency Recovery mechanisms disabled.
When primary swap is mirrored and your primary swap device also serves as a dump area, you must make sure that Mirror Write Cache and Mirror Consistency Recovery is set to off at boot time to avoid loss of your dump. To reset these options, you will need to reboot your system in maintenance mode. Typically, you will have to interrupt the boot process, affirm the interaction with IPL, and boot by typing hpux -lm. If you need to know how to boot any system in LVM maintenance mode or other mode, please refer to document OZBEKBRC00000607. Then activate the Root Volume Group manually i.e. vgchange -a y vg00. Then use the lvchange(1M) command with the -M n and -c n options. reboot the system.
NOTE: To mirror 2 root disks to another 2 disks:
# pvcreate -B /dev/rdsk/disk1
# pvcreate /deav/rdsk/disk2
# vgextend /dev/vg00 /dev/dsk/disk1 /dev/dsk/disk2
# mkboot -l /dev/rdsk/disk1
# mkboot -a "hpux -lq" /dev/rdsk/disk1
# lifcp /dev/rdsk/disk1:AUTO -
# setboot -a 8/0/19/0.5.0 (disk1 here)
# setboot -s on -b on
# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/disk1
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/disk1
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/disk1
# lvextend -m 1 (additional LV) /dev/dsk/disk1 /dev/dsk/disk2
# lvlnboot -R
# pvdisplay -v /dev/dsk/disk1 ---> to check the correct sequence of the logical volumes on the mirror disk.
# pvdisplay -v /dev/dsk/disk2 ---> to check the correct sequence of the logical volumes on the mirror disk.
Make sure disk1 shows up as a boot disk and shows lvol1, lvol2 and lvol3. Then test booting from the mirror disk.
Installation of Offline Diagnostics (ODE) on Mirrored Boot Disks
The following hardware support tools are distributed on the Support Plus Media in the OnlineDiag swinstall bundle:
- Support Tools Manager (STM)
- EMS Hardware Monitors
- HP Predictive Support tools (Series 800 only)
- LIF-resident offline diagnostics (ODE)
There is an easy way to install the ODE to the mirror if you have already installed the OnlineDiag bundle.
First, check if your system is a pure 64 bit system:
# getconf HW_CPU_SUPP_BITS
The result is either 32, 32/64 or 64. If the system is a pure 64 bit systems (e.g. N-Class) the result is 64.
Check the existence of the updatediaglif and updatediaglif2 files:
# ll /usr/sbin/diag/lif/updatediaglif*
-r--r--r-- 1 bin bin 848896 May 7 17:29 /usr/sbin/diag/lif/updatediaglif
-r--r--r-- 1 bin bin 865280 May 7 17:29 /usr/sbin/diag/lif/updatediaglif2
-r--r--r-- 1 bin bin 848896 May 7 17:29 /usr/sbin/diag/lif/updatediaglif
-r--r--r-- 1 bin bin 865280 May 7 17:29 /usr/sbin/diag/lif/updatediaglif2
We will use the updatediaglif2 file 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) we use the updatediaglif file.
List the contents of the LIF directory of the mirror:
# 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
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
Install the ODE LIF files with mkboot and protect (-p) the existing LIF files which you detected with lifls as described above.
For 32 bit and systems that support both 32 and 64 bit:
# mkboot -b /usr/sbin/diag/lif/updatediaglif
-p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c0t5d0
-p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c0t5d0
For pure 64 bit systems:
# mkboot -b /usr/sbin/diag/lif/updatediaglif2
-p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c0t5d0
-p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c0t5d0
Check with
# lifls /dev/rdsk/c0t5d0
One will find additional LIF files.
volume ISL10 data size 7984 directory size 8 96/05/28 04:10:13
filename type start size implement created
===============================================================
ODE -12960 584 880 0 03/05/06 20:27:48
MAPFILE -12277 1464 128 0 03/05/06 20:27:48
SYSLIB -12280 1592 353 0 03/05/06 20:27:48
CONFIGDATA -12278 1952 249 0 03/05/06 20:27:48
SLMOD -12276 2208 133 0 03/05/06 20:27:48
SLDEV -12276 2344 204 0 03/05/06 20:27:48
SLDRIVERS -12276 2552 496 0 03/05/06 20:27:48
SLSCSI -12276 3048 117 0 03/05/06 20:27:48
MAPPER -12279 3168 234 0 03/05/06 20:27:48
IOTEST -12279 3408 208 0 03/05/06 20:27:48
PERFVER -12279 3616 198 0 03/05/06 20:27:48
PVCU -12801 3816 64 0 03/05/06 20:27:48
SSINFO -12286 3880 2 0 03/05/06 20:27:48
...
filename type start size implement created
===============================================================
ODE -12960 584 880 0 03/05/06 20:27:48
MAPFILE -12277 1464 128 0 03/05/06 20:27:48
SYSLIB -12280 1592 353 0 03/05/06 20:27:48
CONFIGDATA -12278 1952 249 0 03/05/06 20:27:48
SLMOD -12276 2208 133 0 03/05/06 20:27:48
SLDEV -12276 2344 204 0 03/05/06 20:27:48
SLDRIVERS -12276 2552 496 0 03/05/06 20:27:48
SLSCSI -12276 3048 117 0 03/05/06 20:27:48
MAPPER -12279 3168 234 0 03/05/06 20:27:48
IOTEST -12279 3408 208 0 03/05/06 20:27:48
PERFVER -12279 3616 198 0 03/05/06 20:27:48
PVCU -12801 3816 64 0 03/05/06 20:27:48
SSINFO -12286 3880 2 0 03/05/06 20:27:48
...
반응형