msgbartop
Tips and Tricks site for advanced HP-UX Engineers
msgbarbottom

06 Apr 11 setboot hardware path to legacy hardware path. A converter.

HP-UX 11.23

setboot provides output only including the hardware path (ioscan -H).

When calculating DRD clone targets and such you need the regular legacy device path.

Here is a converter, built with a little help from JRF on the ITRC forums.

First get the setboot path. Might want to use the full path of the setboot command in practice.

pboot=$(setboot | grep ^Primary | awk ‘{ print $NF }’);
aboot=$(setboot | grep ^Alternate |awk ‘{ print $NF}’);

abootdisk=$(ioscan -kfnCdisk | awk -v aboot=${aboot} ‘/aboot/ $0~aboot {getline;print aboot,$2}’ | awk ‘{ print $2 }’);

pbootdisk=$(ioscan -kfnCdisk | awk -v aboot=${pboot} ‘/pboot/ $0~pboot {getline;print pboot,$2}’ | awk ‘{ print $2 }’);

The slick part is getting the variable in and out of awk.

Uses ioscan.

Tags: , , ,

20 Oct 09 HP-UX Integrity Software mirror procedure

This was written by a former colleague. It is better than anything else I have seen. SEP

Mirroring a Boot Disk with LVM on HP-UX 11i for HP Integrity

Servers

The following diagram shows the disk layout of a boot disk. The disk

contains a Master Boot Record (MBR) and Extensible Firmware

Interface (EFI) partition tables that point to each of the partitions. The

idisk

command is used to create the partitions (see idisk (1M)).

Figure 6-5 Example LVM Disk Layout on HP Integrity Server

Before starting the procedure, make sure that add-on product HP

MirrorDisk/UX (B5403BA) is installed. This product is an extra-cost

product available on the HP-UX 11i application release media. For

example:

swlist -l fileset | grep -i mirror

LVM.LVM-MIRROR-RUN B.11.22 LVM Mirror

Step 1.

file.

Partition the disk using the idisk command and a partition description

a.

Create a partition description file. For example:

vi /tmp/idf

In this example the partition description file contains:

3

EFI 500MB

HPUX 100%

HPSP 400MB

NOTE

an EFI partition, an HP-UX partition, and an HP Service partition.

Boot disks of earlier HP Integrity Servers may have an EFI partition

of only 100MB and may not contain the HPSP partition.

The values in the example represent a boot disk with three partitions:

b.

Partition the disk using idisk and your partition description file:

idisk -f /tmp/idf -w /dev/rdsk/c3t1d0

c.

To verify you can run:

idisk /dev/rdsk/c3t1d0

Step 2.

the partitions. For example:

Use the insf command with the -e option to create the device files for all

insf -e -H 0/18/1/2/0.0.1.0

You should now have eight device files for this disk:

/dev/[r]dsk/c?t?d?

(This refers to the entire disk)

/dev/[r]dsk/c?t?d?s1

(This refers to the EFI partition)

/dev/[r]dsk/c?t?d?s2

(This will be the HP-UX partition)

/dev/[r]dsk/c?t?d?s3

(This refers to the Service partition)

Step 3.

disk:

Use pvcreate to make the HP-UX partition of the disk an LVMmanaged

pvcreate -B /dev/rdsk/c3t1d0s2

Step 4.

Add the disk to vg00:

vgextend vg00 /dev/dsk/c3t1d0s2

Step 5.

Place the boot files on the disk using mkboot:

mkboot -e -l /dev/rdsk/c3t1d0

Step 6.

Copy any autoboot file from the original boot disk to this one.

a.

partition to the current directory. Make sure to use the device file

with the

Use efi_cp to copy the AUTO file from the original boot disk’s EFIs1 suffix, as it refers to the EFI partition:

efi_cp -d /dev/rdsk/cntndns1 -u /efi/hpux/auto ./AUTO

b.

partition:

Copy the file from the current directory into the new disk’s EFI

efi_cp -d /dev/rdsk/c3t1d0s1 ./AUTO /efi/hpux/auto

Step 7.

volume group onto the desired physical volume. The logical volumes

must be extended in the same order that they are configured on the

original boot disk. Use the

determine the list of logical volumes and their order. For example:

Use the lvextend command to mirror each logical volume in the rootpvdisplay command with the -v option to

pvdisplay -v /dev/dsk/c0t0d0s2 | grep ’current.*0000$’

00000 current /dev/vg00/lvol1 00000

00038 current /dev/vg00/lvol2 00000

00550 current /dev/vg00/lvol3 00000

00583 current /dev/vg00/lvol4 00000

00608 current /dev/vg00/lvol5 00000

00611 current /dev/vg00/lvol6 00000

00923 current /dev/vg00/lvol7 00000

01252 current /dev/vg00/lvol8 00000

In this example, mirror the logical volumes as follows:

lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c3t1d0s2

lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c3t1d0s2

lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c3t1d0s2

lvextend -m 1 /dev/vg00/lv0l4 /dev/dsk/c3t1d0s2

lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c3t1d0s2

lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c3t1d0s2

lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c3t1d0s2

lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c3t1d0s2

If

lvextend fails with following message:

“m”: Illegal option

then HP MirrorDisk/UX is not installed.

Step 8.

Update the root volume group information:

lvlnboot -R /dev/vg00

Step 9.

disk and that the boot, root, and swap logical volumes appear to be on

both disks:

Display the BDRA. Verify that the mirrored disk is displayed as a boot

lvlnboot –v

Step 10.

Specify the mirror disk as the alternate boot path in nonvolatile memory:

setboot -a path_to_disk

Step 11.

text editor:

Add a line to /stand/bootconf for the new boot disk using vi or another

vi /stand/bootconf

l /dev/dsk/c3t1d0s2

where

l denotes LVM.

Tags: , , , , , , , ,

sidebarbottom
sidebartop
sidebarbottom
WhatsApp chat