HP-UX 11.23 – Sustituir un disco de boot del VG00

Hoy me topado con una reliquia. Un HP-UX 11.23 Itanium al que se le había estropeado uno de los discos de boot internos y hemos tenido que sustituirlo por uno nuevo. Además, con mirror por software.

Hacía tiempo que no tocaba HP-UX y, aún menos este tipo de cambios. No se suelen romper tantos discos y, cuando eso ocurre, suele existir mirror por hardware y no por software.

Vamos al grano. El procedimiento para recrear el mirror por software en HP-UX 11.23 ha sido el siguiente:

Escenario

Disco estropeado

[server01] root:/root # ioscan -fnCdisk

Class        I  H/W Path        Driver         S/W State   H/W Type     Description

====================================================================================

disk         3  0/0/2/1.0.16.0.0  sdisk          CLAIMED     DEVICE       TEAC    DVD-ROM DW-224EV

                               /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0

disk         1  0/1/1/0.0.0.0.0   sdisk          NO_HW       DEVICE       HP      DG146BB976

                               /dev/dsk/c1t0d0     /dev/dsk/c1t0d0s1   /dev/dsk/c1t0d0s2   /dev/dsk/c1t0d0s3   /dev/rdsk/c1t0d0    /dev/rdsk/c1t0d0s1  /dev/rdsk/c1t0d0s2  /dev/rdsk/c1t0d0s3

disk         2  0/1/1/0.0.0.1.0   sdisk          CLAIMED     DEVICE       HP      DG146BB976

                               /dev/dsk/c1t1d0     /dev/dsk/c1t1d0s1   /dev/dsk/c1t1d0s2   /dev/dsk/c1t1d0s3   /dev/rdsk/c1t1d0    /dev/rdsk/c1t1d0s1  /dev/rdsk/c1t1d0s2  /dev/rdsk/c1t1d0s3

disk         4  0/1/1/0.0.0.2.0   sdisk          CLAIMED     DEVICE       HP      EG0300FCVBF

[server01] root:/root #

Nuevo disco

[server01] root:/root # ioscan -fnCdisk

Class        I  H/W Path        Driver         S/W State   H/W Type     Description

====================================================================================

disk         3  0/0/2/1.0.16.0.0  sdisk          CLAIMED     DEVICE       TEAC    DVD-ROM DW-224EV

                               /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0

disk         2  0/1/1/0.0.0.1.0   sdisk          CLAIMED     DEVICE       HP      DG146BB976

                               /dev/dsk/c1t1d0     /dev/dsk/c1t1d0s1   /dev/dsk/c1t1d0s2   /dev/dsk/c1t1d0s3   /dev/rdsk/c1t1d0    /dev/rdsk/c1t1d0s1  /dev/rdsk/c1t1d0s2  /dev/rdsk/c1t1d0s3

disk         4  0/1/1/0.0.0.2.0   sdisk          CLAIMED     DEVICE       HP      EG0300FCVBF

                               /dev/dsk/c1t2d0     /dev/dsk/c1t2d0s1   /dev/dsk/c1t2d0s2   /dev/dsk/c1t2d0s3   /dev/rdsk/c1t2d0    /dev/rdsk/c1t2d0s1  /dev/rdsk/c1t2d0s2  /dev/rdsk/c1t2d0s3

[server01] root:/root #

Procedimiento de sustitución de disco

  • Creamos el fichero con las tabla de particiones que tenemos que crear para el nuevo disco. En este caso, tres particiones, igual que el disco original:
[server01] root:/root # cat /tmp/partitionfile
3
EFI 500MB
HPUX 100%
HPSP 400MB
[snagci01] root:/root #
  • Creamos las particiones correspondientes:
[server01] root:/root # idisk -wf /tmp/partitionfile /dev/rdsk/c1t2d0
idisk version: 1.32
********************** WARNING ***********************
If you continue you may destroy all data on this disk.
Do you wish to continue(yes/no)? yes

EFI Primary Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0xfce3ec2c
        MyLbaLo                   = 0x1
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x22ecb25b
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x22
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x22ecb238
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 44691f28-a20f-11e9-8001-d6217b60e588
        PartitionEntryLbaLo       = 0x2
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x23cccbed

  Primary Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 4469207c-a20f-11e9-8002-d6217b60e588
        Starting Lba Lo            = 0x22
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xfa021
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 44692090-a20f-11e9-8003-d6217b60e588
        Starting Lba Lo            = 0xfa022
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x22e03237
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 446920ae-a20f-11e9-8004-d6217b60e588
        Starting Lba Lo            = 0x22e03238
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x22ecb237
        Ending Lba Hi              = 0x0

EFI Alternate Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0xb920d8c9
        MyLbaLo                   = 0x22ecb25b
        MyLbaHi                   = 0x0
        AlternateLbaLo            = 0x1
        AlternateLbaHi            = 0x0
        FirstUsableLbaLo          = 0x22
        FirstUsableLbaHi          = 0x0
        LastUsableLbaLo           = 0x22ecb238
        LastUsableLbaHi           = 0x0
        Disk GUID                 = 44691f28-a20f-11e9-8001-d6217b60e588
        PartitionEntryLbaLo       = 0x22ecb23a
        PartitionEntryLbaHi       = 0x0
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x23cccbed

  Alternate Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = 4469207c-a20f-11e9-8002-d6217b60e588
        Starting Lba Lo            = 0x22
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0xfa021
        Ending Lba Hi              = 0x0
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = 44692090-a20f-11e9-8003-d6217b60e588
        Starting Lba Lo            = 0xfa022
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x22e03237
        Ending Lba Hi              = 0x0
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = 446920ae-a20f-11e9-8004-d6217b60e588
        Starting Lba Lo            = 0x22e03238
        Starting Lba Hi            = 0x0
        Ending Lba Lo              = 0x22ecb237
        Ending Lba Hi              = 0x0

Legacy MBR (MBR Signatures in little endian):
   MBR Signature = 0xb01e6944

Protective MBR
[server01] root:/root #
  • Reescaneamos los discos:
[server01] root:/root # insf -e -C disk
insf: Installing special files for sdisk instance 3 address 0/0/2/1.0.16.0.0
insf: Installing special files for sdisk instance 2 address 0/1/1/0.0.0.1.0
insf: Installing special files for sdisk instance 4 address 0/1/1/0.0.0.2.0
[server01] root:/root #

[server01] root:/root # ioscan -fnCdisk
Class        I  H/W Path        Driver         S/W State   H/W Type     Description
====================================================================================
disk         3  0/0/2/1.0.16.0.0  sdisk          CLAIMED     DEVICE       TEAC    DVD-ROM DW-224EV
                               /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk         2  0/1/1/0.0.0.1.0   sdisk          CLAIMED     DEVICE       HP      DG146BB976
                               /dev/dsk/c1t1d0     /dev/dsk/c1t1d0s1   /dev/dsk/c1t1d0s2   /dev/dsk/c1t1d0s3   /dev/rdsk/c1t1d0    /dev/rdsk/c1t1d0s1  /dev/rdsk/c1t1d0s2  /dev/rdsk/c1t1d0s3
disk         4  0/1/1/0.0.0.2.0   sdisk          CLAIMED     DEVICE       HP      EG0300FCVBF
                               /dev/dsk/c1t2d0     /dev/dsk/c1t2d0s1   /dev/dsk/c1t2d0s2   /dev/dsk/c1t2d0s3   /dev/rdsk/c1t2d0    /dev/rdsk/c1t2d0s1  /dev/rdsk/c1t2d0s2  /dev/rdsk/c1t2d0s3
[server01] root:/root #
  • Escribimos la “cabecera EFI” en la primera partición del disco nuevo:
[server01] root:/root # efi_fsinit -d /dev/rdsk/c1t2d0s1
[server01] root:/root #

[server01] root:/root # lifls -l /dev/rdsk/c1t2d0s2
volume ISL10 data size 7984 directory size 8 06/10/27 14:23:07
filename   type   start   size     implement  created
===============================================================
ISL        -12800 584     242      0          06/10/27 14:23:07
AUTO       -12289 832     1        0          06/10/27 14:23:07
HPUX       -12928 840     1024     0          06/10/27 14:23:07
PAD        -12290 1864    1468     0          06/10/27 14:23:07
LABEL      BIN    3336    8        0          19/07/09 08:05:41
[server01] root:/root #
  • Hacemos bootable la segunda partición, que es la que tiene formato HP-UX. Si queremos hacer una comprobación previa, podemos consultar la tabla de particiones de un disco:
Comando de sólo lectura:

idisk /dev/rdsk/c1t2d0
[server01] root:/root # pvcreate -Bf /dev/rdsk/c1t2d0s2
Physical volume "/dev/rdsk/c1t2d0s2" has been successfully created.
[server01] root:/root #

[server01] root:/root # mkboot -e -l /dev/rdsk/c1t2d0
[server01] root:/root # mkboot -a "boot vmunix" /dev/rdsk/c1t2d0
[server01] root:/root # setboot -h  0/1/1/0.0.0.2.0
[server01] root:/root # setboot -v
Primary bootpath : 0/1/1/0.0.0.1.0
HA Alternate bootpath : 0/1/1/0.0.0.2.0
Alternate bootpath : <none>

Autoboot is ON (enabled)
TEST            CURRENT        DEFAULT
----            -------        -------
all             on             on
  SELFTESTS     on             on
    early_cpu   on             on
    late_cpu    on             on
  FASTBOOT      on             on
    Platform    on             on
    Full_memory on             on
  Memory_init   on             on
  IO_HW         on             on
  Chipset       on             on
[server01] root:/root #
  • Permitimos que el servidor pueda bootar desde cualquiera de los discos:
[server01] root:/root # efi_cp -d /dev/rdsk/c1t1d0s1 /tmp/AUTO /EFI/HPUX/AUTO
[server01] root:/root # efi_cp -d /dev/rdsk/c1t2d0s1 /tmp/AUTO /EFI/HPUX/AUTO
[server01] root:/root #
  • Añadimos el nuevo disco al vg00:
[server01] root:/root # vgdisplay -v vg00
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c1t0d0s2":
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                      13
Open LV                     13
Max PV                      16
Cur PV                      2
Act PV                      1
Max PE per PV               4384
VGDA                        2
PE Size (Mbytes)            32
Total PE                    4346
Alloc PE                    2352
Free PE                     1994
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c1t0d0s2":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/stale
   LV Size (Mbytes)            1792
   Current LE                  56
   Allocated PE                112
   Used PV                     1


[server01] root:/root # vgextend vg00 /dev/dsk/c1t2d0s2
vgextend: Warning: Max_PE_per_PV for the volume group (4384) too small for this PV (8912).
         Using only 4384 PEs from this physical volume.
Couldn't open physical volume "/dev/rdsk/c1t0d0s2":
Verification of unique LVM disk id on each disk in the volume group
vg00 failed.
[server01] root:/root #

Este problema se debe a que el VG todavía tiene constancia del disco antiguo. Para solucionarlo, tenemos que deshacer los mirrors de cada lvol:

lvreduce -m 0 /dev/vg00/lvolXXX
  • Una vez eliminados todos los mirrors, ya podemos asignar el disco nuevo al VG00:
[server01] root:/root # cp -p /etc/lvmtab /tmp/lvmtab.old
[server01] root:/root # rm /etc/lvmtab
[server01] root:/root # vgscan -v
Creating "/etc/lvmtab".
vgscan: Couldn't access the list of physical volumes for volume group "/dev/vg00".
Couldn't stat physical volume "/dev/dsk/c0t0d0":
Invalid argument
Physical Volume "/dev/dsk/c1t2d0s2" is not part of a Volume Group

vgscan:  has no correspoding valid raw device file under /dev/rdsk.
Verification of unique LVM disk id on each disk in the volume group /dev/vg00 failed

Scan of Physical Volumes Complete.
*** LVMTAB has been created successfully.
*** Do the following to resync the information on the disk.
*** #1.  vgchange -a y
*** #2.  lvlnboot -R
[server01] root:/root #

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

[server01] root:/root # vgextend vg00 /dev/dsk/c1t2d0s2
vgextend: Warning: Max_PE_per_PV for the volume group (4384) too small for this PV (8912).
         Using only 4384 PEs from this physical volume.
Volume group "vg00" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
[server01] root:/root #
  • Volvemos a crear los mirrors de todos los lvols:
[server01] root:/root # lvextend -m 1 /dev/vg00/lvol1
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
[server01] root:/root # lvextend -m 1 /dev/vg00/lvol2
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol2" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
[server01] root:/root # 

Repetimos la misma operación con el resto de lvols…

Validaciones finales

Antes de dar por finalizado el cambio, siempre es bueno repasar que está todo bien:

  • Comprobamos que tenemos dos discos bootables:
[server01] root:/root # setboot -v
Primary bootpath : 0/1/1/0.0.0.1.0
HA Alternate bootpath : 0/1/1/0.0.0.2.0
Alternate bootpath : <none>

Autoboot is ON (enabled)
TEST            CURRENT        DEFAULT
----            -------        -------
all             on             on
  SELFTESTS     on             on
    early_cpu   on             on
    late_cpu    on             on
  FASTBOOT      on             on
    Platform    on             on
    Full_memory on             on
  Memory_init   on             on
  IO_HW         on             on
  Chipset       on             on
[server01] root:/root #


[server01] root:/root # lvlnboot -v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
        /dev/dsk/c1t1d0s2 (0/1/1/0.0.0.1.0) -- Boot Disk
        /dev/dsk/c1t2d0s2 (0/1/1/0.0.0.2.0) -- Boot Disk
Boot: lvol1     on:     /dev/dsk/c1t1d0s2
                        /dev/dsk/c1t2d0s2
Root: lvol3     on:     /dev/dsk/c1t1d0s2
                        /dev/dsk/c1t2d0s2
Swap: lvol2     on:     /dev/dsk/c1t1d0s2
                        /dev/dsk/c1t2d0s2
Dump: lvol2     on:     /dev/dsk/c1t1d0s2, 0

[server01] root:/root #
  • Ambos discos tienen la información correspondiente de la EFI:
[server01] root:/root # lifls -l /dev/rdsk/c1t2d0s2
volume ISL10 data size 7984 directory size 8 06/10/27 14:23:07
filename   type   start   size     implement  created
===============================================================
ISL        -12800 584     242      0          06/10/27 14:23:07
AUTO       -12289 832     1        0          06/10/27 14:23:07
HPUX       -12928 840     1024     0          06/10/27 14:23:07
PAD        -12290 1864    1468     0          06/10/27 14:23:07
LABEL      BIN    3336    8        0          19/07/09 09:08:55
[server01] root:/root #

[server01] root:/root # lifls -l /dev/rdsk/c1t1d0s2
volume ISL10 data size 7984 directory size 8 06/10/27 14:23:07
filename   type   start   size     implement  created
===============================================================
ISL        -12800 584     242      0          06/10/27 14:23:07
AUTO       -12289 832     1        0          06/10/27 14:23:07
HPUX       -12928 840     1024     0          06/10/27 14:23:07
PAD        -12290 1864    1468     0          06/10/27 14:23:07
LABEL      BIN    3336    8        0          08/11/17 05:22:16
[server01] root:/root #

[server01] root:/root # efi_ls -d /dev/rdsk/c1t1d0s1
FileName                             Last Modified             Size
EFI/                                  11/17/2008                  0
STARTUP.NSH                           11/17/2008                296

total space 523251712 bytes, free space 519856128 bytes

[server01] root:/root #


[server01] root:/root # efi_ls -d /dev/rdsk/c1t1d0s1
FileName                             Last Modified             Size
EFI/                                  11/17/2008                  0
STARTUP.NSH                           11/17/2008                296

total space 523251712 bytes, free space 519856128 bytes

[server01] root:/root # efi_ls -d /dev/rdsk/c1t2d0s1
FileName                             Last Modified             Size
EFI/                                   7/ 9/2019                  0
STARTUP.NSH                            7/ 9/2019                296

total space 523251712 bytes, free space 519856128 bytes

[server01] root:/root #
  • Validamos la estructura del VG00:
vgdisplay -v vg00

Valoración

Deja un comentario