UnixPedia : HPUX / LINUX / SOLARIS: HPUX :How to mirror the root disk

Sunday, January 27, 2013

HPUX :How to mirror the root disk


How to mirror the root disk
The following procedure shows how to mirror the root disk. Let c10t1d0  be the existing primary disk and c2t10d0  the new mirror boot disk:
For LVM
Use idisk(1M) command to partition the disk according to this file:
# idisk -wf /tmp/partitionfile /dev/rdsk/c2t10d0  
idisk version: 1.2
********************** WARNING ***********************
If you continue you may destroy all data on this disk.
Do you wish to continue(yes/no)? yes
...
              1) Setup the disk partitions
At a cold-installed UX 11.23 system the partition sizes are different compared to UX 11.22. Use diskinfo(1M) to check the partition sizes. E.g. for a UX 11.23 system you would get:
# diskinfo /dev/rdsk/c10t1d0s1 | grep size
size: 512000 Kbytes
# diskinfo /dev/rdsk/c10t1d0s3 | grep size
size: 409600 Kbytes
Create a partition description file:
              2) Create the new device files for the new partitions (c2t10d0s1,s2, (s3))
# insf -e -Cdisk
3) Use efi_fsinit(1M) to initialize the FAT filesystem on the EFI partition:
# efi_fsinit -d /dev/rdsk/c2t10d0s1
NOTE: This step is not neccessary if it can be guaranteed that the mirror disk does not contain a valid EFI filesystem. In this case efi_fsinit(1M) will be done automatically by the subsequent mkboot(1M) command. But if you take e.g. an old UX 11.22 boot disk as mirror disk, mkboot will not automatically run efi_fsinit. As a result only 100MB of the 500MB EFI partition (s1) can be used.
4) Use mkboot(1M) to format the EFI partition (s1) and populate it with the EFI files below /usr/lib/efi/ and to format the LIF volume (part ofs2) and populate it with the LIF files (ISL, AUTO, HPUX, LABEL) below /usr/lib/uxbootlf:
# mkboot -e -l /dev/rdsk/c2t10d0  
# efi_ls -d /dev/rdsk/c2t10d0s1 (to check EFI)

UX 11.22
UX 11.23 (cold-installed)
# vi /tmp/partitionfile
2
EFI 100MB
HPUX 100%
# vi /tmp/partitionfile
3
EFI 500MB
HPUX 100%
HPSP 400MB

FileName Last Modified Size
EFI/ 11/ 5/2003 0
STARTUP.NSH 11/ 5/2003 296
total space 523251712 bytes, free space 520073216 bytes
# lifls -l /dev/rdsk/c2t10d0s2 (to check LIF)

5) Check the content of AUTO file on EFI partition:
# efi_cp -d /dev/rdsk/c2t10d0s1 -u /EFI/HPUX/AUTO /tmp/x; cat /tmp/x
NOTE: Specify the -lq option if prefer that your system boots up without interruption in case of a disk failure:
# mkboot -a "boot vmunix -lq" /dev/rdsk/c2t10d0  
# mkboot -a "boot vmunix -lq" /dev/rdsk/c10t1d0  
6) Copy the HP service partition (UX 11.23 only): (skip this, if you don’t have a service partition)
# dd if=/dev/rdsk/c10t1d0s3 of=/dev/rdsk/c2t10d0s3 bs=1024k
7) Initialize the LVM partition (s2) and add it to vg00:
# pvcreate [-f] –B /dev/rdsk/c2t10d0s2 (take care to uses2)
# vgextend vg00 /dev/dsk/c2t10d0s2
8) Mirror the LVs to thes2 partition:
# for i in lvol1 lvol2 ... lvol8 (specify each LV)
> do lvextend -m 1 /dev/vg00/$i /dev/dsk/c2t10d0s2
> done
9) Check if content of LABEL file (i.e. root, boot, swap and dump device definition) has been initialized (done by lvextend) on the mirror disk:
# lvlnboot -v Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c10t1d0s2 (0/1/1/1.2.0) -- Boot Disk
/dev/dsk/c2t10d0s2 (0/1/1/0.1.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c10t1d0s2
/dev/dsk/c2t10d0s2
Root: lvol3 on: /dev/dsk/c10t1d0s2
/dev/dsk/c2t10d0s2
Swap: lvol2 on: /dev/dsk/c10t1d0s2
/dev/dsk/c2t10d0s2
Dump: lvol2 on: /dev/dsk/c10t1d0s2, 0
If not, then set it:
# lvlnboot -r /dev/vg00/lvol3
# lvlnboot -b /dev/vg00/lvol1
# lvlnboot -s /dev/vg00/lvol2
# lvlnboot -d /dev/vg00/lvol2
8) Add a line to /stand/bootconf for the new boot disk (the letter l is for LVM)
# vi /stand/bootconf l /dev/dsk/c2t10d0s2
l /dev/dsk/c10t1d0s2
NOTE: This is not neccessary to be able to boot from the mirror in the first place. But if you omit it then you will run into trouble when installing an EFI boot loader patch (e.g. PHKL_34088). This patch updates the hpux.efi boot loader on all disks listed in the bootconf file.
9) Specify the mirrored disk as alternate bootpath
# setboot –a <HW path of mirror> # setboot –h <HW path of mirror> (for UX 11.23 use the HA alternate) # setboot (to check it) 

No comments:

Post a Comment