Archives For EFI

Mirroring the root disk group of an HP-UX server is a very straightforward process that can be performed by simply use the vxrootmir command an use the new mirror’s disk as the argument. This handy utility will create and configure the boot and the VxVM structures and will mirror the volumes.

An example will explain better the whole process. Launch the mirroring operation.

root@robin:~# /etc/vx/bin/vxrootmir -v -b disk22
VxVM vxrootmir INFO V-5-2-2501 11:38: Gathering information on the current VxVM root configuration
VxVM vxrootmir INFO V-5-2-2441 11:38: Checking specified disk(s) for usability
VxVM vxrootmir INFO V-5-2-2566 11:38: Preparing disk disk22_p2 as a VxVM root disk
VxVM vxrootmir INFO V-5-2-3766 11:38: Disk disk22_p2 is now EFI partitioned disk disk22_p2
VxVM vxrootmir INFO V-5-2-2410 11:38: Adding disk disk22_p2 to rootdg as DM rootdisk02
VxVM vxrootmir INFO V-5-2-1646 11:38: Mirroring all volumes on root disk
VxVM vxrootmir INFO V-5-2-1648 11:38: Mirroring volume standvol
VxVM vxrootmir INFO V-5-2-1648 11:39: Mirroring volume swapvol
VxVM vxrootmir INFO V-5-2-1648 11:40: Mirroring volume rootvol
VxVM vxrootmir INFO V-5-2-1648 11:40: Mirroring volume homevol
VxVM vxrootmir INFO V-5-2-1648 11:40: Mirroring volume optvol
VxVM vxrootmir INFO V-5-2-1648 11:43: Mirroring volume tmpvol
VxVM vxrootmir INFO V-5-2-1648 11:43: Mirroring volume usrvol
VxVM vxrootmir INFO V-5-2-1648 11:44: Mirroring volume varvol
VxVM vxrootmir INFO V-5-2-1648 11:45: Mirroring volume crashvol
VxVM vxrootmir INFO V-5-2-2462 11:46: Current setboot values:
VxVM vxrootmir INFO V-5-2-2569 11:46: Primary:  0/0/0/0.0x8.0x0 /dev/rdisk/disk20
VxVM vxrootmir INFO V-5-2-2416 11:46: Alternate:        0/0/0/0.0x0.0x0 /dev/rdisk/disk4
VxVM vxrootmir INFO V-5-2-2551 11:46: Making mirror disk disk22 (/dev/rdisk/disk22) the alternate boot disk
Alternate boot path set to 0/0/0/0.0x9.0x0 (/dev/rdisk/disk22)
VxVM vxrootmir INFO V-5-2-1616 11:46: Disk disk22 is now a mirrored root disk
root@robin:~#

After the mirror operation is finished verify the contents of the rootdg.

root@robin:~# vxprint -htg rootdg
DG NAME         NCONFIG      NLOG     MINORS   GROUP-ID
ST NAME         STATE        DM_CNT   SPARE_CNT         APPVOL_CNT
DM NAME         DEVICE       TYPE     PRIVLEN  PUBLEN   STATE
RV NAME         RLINK_CNT    KSTATE   STATE    PRIMARY  DATAVOLS  SRL
RL NAME         RVG          KSTATE   STATE    REM_HOST REM_DG    REM_RLNK
CO NAME         CACHEVOL     KSTATE   STATE
VT NAME         RVG          KSTATE   STATE    NVOLUME
V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
SR NAME         KSTATE

dg rootdg       default      default  4466000  1276076559.38.robin

dm rootdisk01   disk20_p2    auto     1024     40035232 -
dm rootdisk02   disk22_p2    auto     1024     40035232 -

v  crashvol     -            ENABLED  ACTIVE   4194304  SELECT    -        fsgen
pl crashvol-01  crashvol     ENABLED  ACTIVE   4194304  CONCAT    -        RW
sd rootdisk01-09 crashvol-01 rootdisk01 28778496 4194304 0        c0t8d0s2 ENA
pl crashvol-02  crashvol     ENABLED  ACTIVE   4194304  CONCAT    -        RW
sd rootdisk02-09 crashvol-02 rootdisk02 28778496 4194304 0        c0t9d0s2 ENA

v  homevol      -            ENABLED  ACTIVE   155648   SELECT    -        fsgen
pl homevol-01   homevol      ENABLED  ACTIVE   155648   CONCAT    -        RW
sd rootdisk01-04 homevol-01  rootdisk01 7077888 155648  0         c0t8d0s2 ENA
pl homevol-02   homevol      ENABLED  ACTIVE   155648   CONCAT    -        RW
sd rootdisk02-04 homevol-02  rootdisk02 7077888 155648  0         c0t9d0s2 ENA

v  optvol       -            ENABLED  ACTIVE   9560064  SELECT    -        fsgen
pl optvol-01    optvol       ENABLED  ACTIVE   9560064  CONCAT    -        RW
sd rootdisk01-05 optvol-01   rootdisk01 7233536 9560064 0         c0t8d0s2 ENA
pl optvol-02    optvol       ENABLED  ACTIVE   9560064  CONCAT    -        RW
sd rootdisk02-05 optvol-02   rootdisk02 7233536 9560064 0         c0t9d0s2 ENA

v  rootvol      -            ENABLED  ACTIVE   1048576  SELECT    -        root
pl rootvol-01   rootvol      ENABLED  ACTIVE   1048576  CONCAT    -        RW
sd rootdisk01-03 rootvol-01  rootdisk01 6029312 1048576 0         c0t8d0s2 ENA
pl rootvol-02   rootvol      ENABLED  ACTIVE   1048576  CONCAT    -        RW
sd rootdisk02-03 rootvol-02  rootdisk02 6029312 1048576 0         c0t9d0s2 ENA

v  standvol     -            ENABLED  ACTIVE   1835008  SELECT    -        fsgen
pl standvol-01  standvol     ENABLED  ACTIVE   1835008  CONCAT    -        RW
sd rootdisk01-01 standvol-01 rootdisk01 0      1835008  0         c0t8d0s2 ENA
pl standvol-02  standvol     ENABLED  ACTIVE   1835008  CONCAT    -        RW
sd rootdisk02-01 standvol-02 rootdisk02 0      1835008  0         c0t9d0s2 ENA

v  swapvol      -            ENABLED  ACTIVE   4194304  SELECT    -        swap
pl swapvol-01   swapvol      ENABLED  ACTIVE   4194304  CONCAT    -        RW
sd rootdisk01-02 swapvol-01  rootdisk01 1835008 4194304 0         c0t8d0s2 ENA
pl swapvol-02   swapvol      ENABLED  ACTIVE   4194304  CONCAT    -        RW
sd rootdisk02-02 swapvol-02  rootdisk02 1835008 4194304 0         c0t9d0s2 ENA

v  tmpvol       -            ENABLED  ACTIVE   524288   SELECT    -        fsgen
pl tmpvol-01    tmpvol       ENABLED  ACTIVE   524288   CONCAT    -        RW
sd rootdisk01-06 tmpvol-01   rootdisk01 16793600 524288 0         c0t8d0s2 ENA
pl tmpvol-02    tmpvol       ENABLED  ACTIVE   524288   CONCAT    -        RW
sd rootdisk02-06 tmpvol-02   rootdisk02 16793600 524288 0         c0t9d0s2 ENA

v  usrvol       -            ENABLED  ACTIVE   6217728  SELECT    -        fsgen
pl usrvol-01    usrvol       ENABLED  ACTIVE   6217728  CONCAT    -        RW
sd rootdisk01-07 usrvol-01   rootdisk01 17317888 6217728 0        c0t8d0s2 ENA
pl usrvol-02    usrvol       ENABLED  ACTIVE   6217728  CONCAT    -        RW
sd rootdisk02-07 usrvol-02   rootdisk02 17317888 6217728 0        c0t9d0s2 ENA

v  varvol       -            ENABLED  ACTIVE   5242880  SELECT    -        fsgen
pl varvol-01    varvol       ENABLED  ACTIVE   5242880  CONCAT    -        RW
sd rootdisk01-08 varvol-01   rootdisk01 23535616 5242880 0        c0t8d0s2 ENA
pl varvol-02    varvol       ENABLED  ACTIVE   5242880  CONCAT    -        RW
sd rootdisk02-08 varvol-02   rootdisk02 23535616 5242880 0        c0t9d0s2 ENA
root@robin:~#

Then check the contents of the EFI partition and the LABEL file of the mirror disk.

root@robin:~# efi_ls -d /dev/rdisk/disk22_p1 /efi/hpux
FileName                             Last Modified             Size
.                                      6/ 9/2010                  0
..                                     6/ 9/2010                  0
hpux.efi                               6/ 9/2010             698356
nbp.efi                                6/ 9/2010              31232
AUTO                                   6/ 9/2010                 12

total space 523218944 bytes, free space 520163328 bytes

root@robin:~# vxvmboot -v /dev/rdisk/disk22_p2

LIF Label File @ (1k) block # 834 on VxVM Disk /dev/rdsk/c0t9d0s2:
Label Entry: 0, Boot Volume start:     3168; length: 1792 MB
Label Entry: 1, Root Volume start:  6032480; length: 1024 MB
Label Entry: 2, Swap Volume start:  1838176; length: 4096 MB
Label Entry: 3, Dump Volume start:  1838176; length: 4096 MB
root@robin:~#

Verify that the new disk has been set as the alternate boot device.

root@robin:~# setboot -v
Primary bootpath : 0/0/0/0.0x8.0x0 (/dev/rdisk/disk20)
HA Alternate bootpath :
Alternate bootpath : 0/0/0/0.0x9.0x0 (/dev/rdisk/disk22)

Autoboot is ON (enabled)
setboot: error accessing firmware - Function is not available
The firmware of your system does not support querying or changing the SpeedyBoot
settings.
root@robin:~#

Finally reboot the server and from the EFI boot manager force the boot from the mirrored disk.

Juanma.

Creating a Veritas Volume Manager boot disk using the LVM boot disks as its source probably looks to many as a very complicated process, nothing so far from the reality. In fact the whole conversion can be done with one command, vxcp_lvmroot.  In this post I will try to clarify the process and explain some of the underlying mechanisms.

I’m going to take for granted that all of you understand the basic structure of boot disks on Itanium servers. If you have read my post about boot disk structure on Integrity servers you will remember that the disks are composed by three partitions:

  • EFI
  • OS Partition.
  • HPSP – HP Service Partition.

For the purpose of this post the only relevant partition is the OS Partition, also named as HPUX in HP-UX hosts.

Unlike LVM, where the volumes are named with numbers (lvol1, lvol2…), in VxVM the volumes follow a specific naming convention that reflects the usage of each one of them:

  • standvol
  • swapvol
  • rootvol
  • usrvol
  • varvol
  • tmpvol
  • optvol

Veritas volumes support also a usetype field used to provide additional information about the volume to VxVM itself. The three most common usetypes on HP-UX are:

  • fsgen – File systems and general purpose volumes
  • swap – Swap volumes
  • root – Used for the volume that contains the root file system

The following restrictions must be taken into account for any VxVM boot disk:

  • As in LVM the volumes involved in the boot process (standvol, swapvol and rootvol) must be contiguous.
  • The above volumes can have only one subdisk and can’t span to additional disks.
  • The volumes within the root disk can not use dirty region logging (DRL).
  • The private region size is 1MB rather than the default value of 32MB.
  • The /stand file system can only be configured with VxFS data layout version 5 or the system will not boot.
  • In PA-RISC systems the /stand file system must be HFS, this is necessary because the PA-RISC HP-UX kernel loader is not VxFS-aware.

Following is an example to illustrate the process.

First, with diskinfo, verify the size of the current boot disk and the new disk to check that they are the same.

root@robin:/# diskinfo /dev/rdsk/c0t0d0
SCSI describe of /dev/rdsk/c0t0d0:
             vendor: HP      
         product id: Virtual LvDisk  
               type: direct access
               size: 40960000 Kbytes
   bytes per sector: 512
root@robin:/#
root@robin:/# diskinfo /dev/rdsk/c0t8d0
SCSI describe of /dev/rdsk/c0t8d0:
             vendor: HP      
         product id: Virtual LvDisk  
               type: direct access
               size: 40960000 Kbytes
   bytes per sector: 512
root@robin:/#

After that scrub the new disk, this will prevent possible problems during the creation process because if  vxcp_lvmroot encounter LVM structures on the disk it will fail.

root@robin:~# dd if=/dev/zero of=/dev/rdsk/c0t8d0 bs=1048576 count=1024  
1024+0 records in
1024+0 records out
root@robin:~#

Finally launch the vxcp_lvmroot command. Before commencing the copy, vxcp_lvmroot will determine how many disks are required and will ensure that enough disks have been specified.

Each one of the given disks for the conversion will be checked to make sure that aren’t in use as LVM, VxVM or raw disks. Once the appropriate checks have been issued the disks will be given VxVM media names, the disk or disks containing the root will be given rootdisk## names and the other disks that are part of the rootdg will be given rootaux## names, ## is a number starting on 01.

root@robin:~# /etc/vx/bin/vxcp_lvmroot -v -b c0t8d0
VxVM vxcp_lvmroot INFO V-5-2-4668 10:42: Bootdisk is configured with new-style DSF
VxVM vxcp_lvmroot INFO V-5-2-2499 10:42: Gathering information on LVM root volume group vg00
VxVM vxcp_lvmroot INFO V-5-2-2441 10:42: Checking specified disk(s) for usability
VxVM vxcp_lvmroot INFO V-5-2-4679 10:42: Using legacy-style DSF names
VxVM vxcp_lvmroot INFO V-5-2-2566 10:42: Preparing disk c0t8d0 as a VxVM root disk
VxVM vxcp_lvmroot INFO V-5-2-3767 10:42: Disk c0t8d0 is now EFI partitioned disk c0t8d0s2
VxVM vxcp_lvmroot INFO V-5-2-2537 10:42: Initializing DG rootdg with disk c0t8d0s2 as DM rootdisk01
VxVM vxcp_lvmroot INFO V-5-2-1606 10:42: Copying /dev/vg00/lvol1 (vxfs) to /dev/vx/dsk/rootdg/standvol
VxVM vxcp_lvmroot INFO V-5-2-1604 10:42: Cloning /dev/vg00/lvol2 (swap) to /dev/vx/dsk/rootdg/swapvol
VxVM vxcp_lvmroot INFO V-5-2-1606 10:42: Copying /dev/vg00/lvol3 (vxfs) to /dev/vx/dsk/rootdg/rootvol
VxVM vxcp_lvmroot INFO V-5-2-1606 10:43: Copying /dev/vg00/lvol4 (vxfs) to /dev/vx/dsk/rootdg/homevol
VxVM vxcp_lvmroot INFO V-5-2-1606 10:43: Copying /dev/vg00/lvol5 (vxfs) to /dev/vx/dsk/rootdg/optvol
VxVM vxcp_lvmroot INFO V-5-2-1606 10:50: Copying /dev/vg00/lvol6 (vxfs) to /dev/vx/dsk/rootdg/tmpvol
VxVM vxcp_lvmroot INFO V-5-2-1606 10:50: Copying /dev/vg00/lvol7 (vxfs) to /dev/vx/dsk/rootdg/usrvol
VxVM vxcp_lvmroot INFO V-5-2-1606 10:55: Copying /dev/vg00/lvol8 (vxfs) to /dev/vx/dsk/rootdg/varvol
VxVM vxcp_lvmroot INFO V-5-2-1606 10:58: Copying /dev/vg00/lv_crash (vxfs) to /dev/vx/dsk/rootdg/crashvol
VxVM vxcp_lvmroot INFO V-5-2-4678 10:58: Setting up disk c0t8d0s2 as a boot disk
VxVM vxcp_lvmroot INFO V-5-2-1638 10:59: Installing fstab and fixing dev nodes on new root FS
VxVM vxcp_lvmroot INFO V-5-2-2538 10:59: Installing bootconf & rootconf files in new stand FS
VxVM vxcp_lvmroot INFO V-5-2-2462 10:59: Current setboot values:
VxVM vxcp_lvmroot INFO V-5-2-2569 10:59: Primary:       0/0/0/0.0x0.0x0 /dev/rdisk/disk4
VxVM vxcp_lvmroot INFO V-5-2-2416 10:59: Alternate:      
VxVM vxcp_lvmroot INFO V-5-2-4676 10:59: Making disk /dev/rdisk/disk20_p2 the primary boot disk
VxVM vxcp_lvmroot INFO V-5-2-4663 10:59: Making disk /dev/rdisk/disk4_p2 the alternate boot disk
VxVM vxcp_lvmroot INFO V-5-2-4671 10:59: Disk c0t8d0s2 is now a VxVM rootable boot disk
root@robin:~#

Now to verify the new VxVM boot disk, first check the newly created rootdg diskgroup.

root@robin:~# vxprint -htg rootdg
DG NAME         NCONFIG      NLOG     MINORS   GROUP-ID
ST NAME         STATE        DM_CNT   SPARE_CNT         APPVOL_CNT
DM NAME         DEVICE       TYPE     PRIVLEN  PUBLEN   STATE
RV NAME         RLINK_CNT    KSTATE   STATE    PRIMARY  DATAVOLS  SRL
RL NAME         RVG          KSTATE   STATE    REM_HOST REM_DG    REM_RLNK
CO NAME         CACHEVOL     KSTATE   STATE
VT NAME         RVG          KSTATE   STATE    NVOLUME
V  NAME         RVG/VSET/CO  KSTATE   STATE    LENGTH   READPOL   PREFPLEX UTYPE
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE
SC NAME         PLEX         CACHE    DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
DC NAME         PARENTVOL    LOGVOL
SP NAME         SNAPVOL      DCO
EX NAME         ASSOC        VC                       PERMS    MODE     STATE
SR NAME         KSTATE

dg rootdg       default      default  4466000  1276076559.38.robin

dm rootdisk01   c0t8d0s2     auto     1024     40035232 -

v  crashvol     -            ENABLED  ACTIVE   4194304  SELECT    -        fsgen
pl crashvol-01  crashvol     ENABLED  ACTIVE   4194304  CONCAT    -        RW
sd rootdisk01-09 crashvol-01 rootdisk01 28778496 4194304 0        c0t8d0s2 ENA

v  homevol      -            ENABLED  ACTIVE   155648   SELECT    -        fsgen
pl homevol-01   homevol      ENABLED  ACTIVE   155648   CONCAT    -        RW
sd rootdisk01-04 homevol-01  rootdisk01 7077888 155648  0         c0t8d0s2 ENA

v  optvol       -            ENABLED  ACTIVE   9560064  SELECT    -        fsgen
pl optvol-01    optvol       ENABLED  ACTIVE   9560064  CONCAT    -        RW
sd rootdisk01-05 optvol-01   rootdisk01 7233536 9560064 0         c0t8d0s2 ENA

v  rootvol      -            ENABLED  ACTIVE   1048576  SELECT    -        root
pl rootvol-01   rootvol      ENABLED  ACTIVE   1048576  CONCAT    -        RW
sd rootdisk01-03 rootvol-01  rootdisk01 6029312 1048576 0         c0t8d0s2 ENA

v  standvol     -            ENABLED  ACTIVE   1835008  SELECT    -        fsgen
pl standvol-01  standvol     ENABLED  ACTIVE   1835008  CONCAT    -        RW
sd rootdisk01-01 standvol-01 rootdisk01 0      1835008  0         c0t8d0s2 ENA

v  swapvol      -            ENABLED  ACTIVE   4194304  SELECT    -        swap
pl swapvol-01   swapvol      ENABLED  ACTIVE   4194304  CONCAT    -        RW
sd rootdisk01-02 swapvol-01  rootdisk01 1835008 4194304 0         c0t8d0s2 ENA

v  tmpvol       -            ENABLED  ACTIVE   524288   SELECT    -        fsgen
pl tmpvol-01    tmpvol       ENABLED  ACTIVE   524288   CONCAT    -        RW
sd rootdisk01-06 tmpvol-01   rootdisk01 16793600 524288 0         c0t8d0s2 ENA

v  usrvol       -            ENABLED  ACTIVE   6217728  SELECT    -        fsgen
pl usrvol-01    usrvol       ENABLED  ACTIVE   6217728  CONCAT    -        RW
sd rootdisk01-07 usrvol-01   rootdisk01 17317888 6217728 0        c0t8d0s2 ENA

v  varvol       -            ENABLED  ACTIVE   5242880  SELECT    -        fsgen
pl varvol-01    varvol       ENABLED  ACTIVE   5242880  CONCAT    -        RW
sd rootdisk01-08 varvol-01   rootdisk01 23535616 5242880 0        c0t8d0s2 ENA
root@robin:~#

Verify the contents of the LABEL file.

root@robin:~# vxvmboot -v /dev/rdsk/c0t8d0s2

LIF Label File @ (1k) block # 834 on VxVM Disk /dev/rdsk/c0t8d0s2:
Label Entry: 0, Boot Volume start:     3168; length: 1792 MB
Label Entry: 1, Root Volume start:  6032480; length: 1024 MB
Label Entry: 2, Swap Volume start:  1838176; length: 4096 MB
Label Entry: 3, Dump Volume start:  1838176; length: 4096 MB
root@robin:~#

Check the new boot paths and if everything is OK reboot the server.

root@robin:~# setboot -v
Primary bootpath : 0/0/0/0.0x8.0x0 (/dev/rdisk/disk20)
HA Alternate bootpath :
Alternate bootpath : 0/0/0/0.0x0.0x0 (/dev/rdisk/disk4)

Autoboot is ON (enabled)
setboot: error accessing firmware - Function is not available
The firmware of your system does not support querying or changing the SpeedyBoot
settings.
root@robin:~#
root@robin:~# shutdown -ry 0 

SHUTDOWN PROGRAM
06/09/10 11:11:37 WETDST

Broadcast Message from root (console) Wed Jun  9 11:11:37...
SYSTEM BEING BROUGHT DOWN NOW ! ! !

...

If everything went as expected the server will boot from the new disk and the migration process wil be finished.

Juanma.

The boot disk/disks of every Integrity server are divided into three partitions:

  1. EFI Partition: Contains the necessary tools and files to find and load the appropriate kernel. Here resides for example the hpux.efi utility.
  2. OS Partition: In the case of HP-UX contains the LVM or VxVM structure, the kernel and any filesystem that play a role during the boot process.
  3. HP Service Partition (HPSP).

EFI Partition

The Extensible Firmware Interface (EFI) partition is subdivided into three main areas:

  • MBR: The Master Boot Record, located at the top of the disk, a legacy Intel structure ignored by EFI.
  • GPT: Every EFI partition is assigned a unique identifier known as GUID (Globally Unique Identifier). The locations of the GUID s are stored in the EFI GUID Partition Table or GPT. This very critical structure is replicated at the top and the bottom of the disk.
  • EFI System Partition: This partition contains the OS loader responsible of loading the operative system during the boot process. On HP-UX disks the OS loader is the famous \efi\hpux\hpux.efi file. Here is contained also the \efi\hpux\auto file which stores the system boot string and some utilities as well.

OS Partition

The OS Partition obviously contains the Operative System that runs on the server. An HP-UX partition contains a LIF area, private region and public region.

The Logical Interchange Format (LIF) boot area stores the following files:

  • ISL. Not used on Integrity.
  • AUTO. Not used on Integrity.
  • HPUX. Not used on Integrity.
  • LABEL. A binary file that contains the records of the locations of /stand and the primary swap.

The private region contains LVM and VxVM configuration information.

And the public region contains the corresponding volumes for:

  • stand: /stand filesystem including the HP-UX kernel.
  • swap: Primary swap space.
  • root: The root filesystem that includes /, /etc, /dev and /sbin.

HP Service Partition

The HP Service Partition, or HPSP, is a FAT-32 filesystem that contains several offline diagnostic utilities to be used on unbootable systems.

Juanma.

Welcome again to “HPVM World!” my dear readers :-D

Have to say that even with the initial disappointment about hpvmclone, cloning IVMs was a very funny task but I believe that the after cloning tasks weren’t very clear, at least for me, so I decided to write this follow up post to clarify that part.

Let’s assume we already have a cloned virtual machine, in this particular case I used dd to clone the virtual disk and later I created the IVM and added the storage device and the other resources but it also applied to the other method with minor changes.

[root@hpvmhost] ~ # hpvmstatus -P vmnode2 -d
[Virtual Machine Devices]

[Storage Interface Details]
disk:scsi:0,0,0:lv:/dev/vg_vmtest/rvmnode2disk
dvd:scsi:0,0,1:disk:/dev/rdsk/c1t4d0

[Network Interface Details]
network:lan:0,1,0xB20EBA14E76C:vswitch:localnet
network:lan:0,2,0x3E9492C9F615:vswitch:vlan02

[Misc Interface Details]
serial:com1::tty:console
[root@hpvmhost] ~ #

We start the virtual machine an access its console.Now we are going to follow some of the final steps of the third method described in my previous post. From the main EFI Boot Manager select the Boot option maintenance menu option.

EFI Boot Manager ver 1.10 [14.62] [Build: Mon Oct  1 09:27:26 2007]

Please select a boot option

     EFI Shell [Built-in]                                           
     Boot option maintenance menu                                    

     Use ^ and v to change option(s). Use Enter to select an option

Select Boot from a file and the select the first partition:

EFI Boot Maintenance Manager ver 1.10 [14.62]

Boot From a File.  Select a Volume

    IA64_EFI [Acpi(PNP0A03,0)/Pci(0|0)/Scsi(Pun0,Lun0)/HD(Part1,Sig
    IA64_EFI [Acpi(PNP0A03,0)/Pci(0|0)/Scsi(Pun0,Lun0)/HD(Part3,Sig7
    Removable Media Boot [Acpi(PNP0A03,0)/Pci(0|0)/Scsi(Pun1,Lun0)]
    Load File [Acpi(PNP0A03,0)/Pci(1|0)/Mac(B20EBA14E76C)]          
    Load File [Acpi(PNP0A03,0)/Pci(2|0)/Mac(3E9492C9F615)]        
    Load File [EFI Shell [Built-in]]                                
    Legacy Boot
    Exit

Enter the EFI directory then the HPUX directory and finally select hpux.file. Like I said before this part is very similar to the final steps of Method 3.

EFI Boot Maintenance Manager ver 1.10 [14.62]

Select file or change to new directory:

       03/09/10  03:45p <DIR>       4,096 .                         
       03/09/10  03:45p <DIR>       4,096 ..                        
       03/10/10  04:21p           657,609 hpux.efi                  
       03/09/10  03:45p            24,576 nbp.efi                   
       Exit

After this the machine will boot.

   Filename: \EFI\HPUX\hpux.efi
 DevicePath: [Acpi(PNP0A03,0)/Pci(0|0)/Scsi(Pun0,Lun0)/HD(Part1,Sig71252358-2BCD-11DF-8000-D6217B60E588)/\EFI\HPUX\hpux.efi]
   IA-64 EFI Application 03/10/10  04:21p     657,609 bytes

(C) Copyright 1999-2008 Hewlett-Packard Development Company, L.P.
All rights reserved

HP-UX Boot Loader for IPF  --  Revision 2.036

Press Any Key to interrupt Autoboot
\EFI\HPUX\AUTO ==> boot vmunix
Seconds left till autoboot -   0
AUTOBOOTING...> System Memory = 2042 MB
loading section 0
..................................................................................... (complete)
loading section 1
............... (complete)
loading symbol table
loading System Directory (boot.sys) to MFS
.....
loading MFSFILES directory (bootfs) to MFS
..................
Launching /stand/vmunix
SIZE: Text:43425K + Data:7551K + BSS:22118K = Total:73096K
...

When the VM is up login as root. The first tasks as always are to change hostname and network configuration to avoid conflicts.

Next we are going recreate lvmtab since the current one contains the LVM configuration of the source virtual machine. Performing a simple vgdisplay will show it.

root@vmnode2:/# vgdisplay
vgdisplay: Warning: couldn't query physical volume "/dev/disk/disk15_p2":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write     
VG Status                   available                 
Max LV                      255    
Cur LV                      8      
Open LV                     8      
Max PV                      16     
Cur PV                      1      
Act PV                      0      
Max PE per PV               3085         
VGDA                        0   
PE Size (Mbytes)            8               
Total PE                    0       
Alloc PE                    0       
Free PE                     0       
Total PVG                   0        
Total Spare PVs             0              
Total Spare PVs in use      0

root@vmnode2:/#

To correct this remove the /etc/lvmtab file and launch a vgscan.

root@vmnode2:/# rm /etc/lvmtab
/etc/lvmtab: ? (y/n) y
root@vmnode2:/var/tmp/software# vgscan
Creating "/etc/lvmtab".
vgscan: Couldn't access the list of physical volumes for volume group "/dev/vg00".
Physical Volume "/dev/dsk/c1t1d0" contains no LVM information

*** LVMTAB has been created successfully.
*** Do the following to resync the information on the disk.
*** #1.  vgchange -a y
*** #2.  lvlnboot -R
root@vmnode2:/#

Follow the recommended steps in vgscan output, the first step only applies if there are any other VGs in the system, if there is only vg00 it is already active so this step is not necesary.

Running lvnlboot -R is mandatory since we need to recover and update the links to the lvols in the Boot Data Reserved Area of the booting disk.

root@vmnode2:/# lvlnboot -R
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
root@vmnode2:/#

Now the LVM configuration is fixed, try again the vgdisplay command.

root@vmnode2:/# vgdisplay
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      8
Open LV                     8
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               3085
VGDA                        2
PE Size (Mbytes)            8
Total PE                    3075
Alloc PE                    2866
Free PE                     209
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

root@vmnode2:/#

With the LVM configuration fixed the next step is to indicate the booting disk to the system.

root@vmnode2:/# setboot -p /dev/disk/disk21_p2
Primary boot path set to 0/0/0/0.0x0.0x0 (/dev/disk/disk21_p2)
root@vmnode2:/#
root@vmnode2:/# setboot
Primary bootpath : 0/0/0/0.0x0.0x0 (/dev/rdisk/disk21)
HA Alternate bootpath :
Alternate bootpath :

Autoboot is ON (enabled)
root@vmnode2:/#

Finally reboot the virtual machine and if we did everything correctly a new boot option will be available in the EFI Boot Manager.

EFI Boot Manager ver 1.10 [14.62] [Build: Mon Oct  1 09:27:26 2007]

Please select a boot option

    HP-UX Primary Boot: 0/0/0/0.0x0.0x0                             
    EFI Shell [Built-in]                                            
    Boot option maintenance menu                                    

    Use ^ and v to change option(s). Use Enter to select an option

Let the system boot by itself through the new default option (HP-UX Primary Boot) and we are done.

Any feedback would be welcome.

Juanma.