Archives For VxVM

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.

By default Veritas Volume Manager uses HP-UX legacy naming scheme instead of the agile view one, of course for any HP-UX Sysadim this is completely unacceptable ;-) below is a small procedure to change this behavior.

Display VxVM disk information  and get the current naming scheme.

root@robin:~# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
c0t0d0s2     auto:LVM        -            -            LVM
c0t1d0       auto:LVM        -            -            LVM
c0t2d0       auto:cdsdisk    labdg01      labdg        online
c0t3d0       auto:cdsdisk    labdg02      labdg        online
c0t4d0       auto:cdsdisk    labdg03      labdg        online
c0t5d0       auto:none       -            -            online invalid
c0t6d0       auto:none       -            -            online invalid
c0t7d0       auto:none       -            -            online invalid
c0t8d0s2     auto:hpdisk     rootdisk01   rootdg       online
c0t9d0s2     auto:hpdisk     rootdisk02   rootdg       online
root@robin:~#
root@robin:~# vxddladm get namingscheme
NAMING_SCHEME       PERSISTENCE         MODE                
===============================================
OS Native           Yes                 Legacy              
root@robin:~#

As you can see the mode is se tot legacy and the disks are shown with their legacy device names. To change this use again the vxddladm command.

root@robin:~# vxddladm set namingscheme=osn mode=new

The parameter used are namingscheme and mode. The available option for the first are:

  • ebn – Enclosure based names.
  • osn – Operative system names.

If ebn is used neither legacy mode nor new mode can be set since hardware names provided by the disk array will be used so use osn as namingscheme.

The second parameter is mode and of course defines which naming model will be used in the osn naming scheme. The following three values can be set:

  • default
  • legacy
  • new

Now check the chancge by executing vxdisk and vxddladm commands.

root@robin:~# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
disk4_p2     auto:LVM        -            -            LVM
disk6        auto:LVM        -            -            LVM
disk8        auto:cdsdisk    labdg01      labdg        online
disk10       auto:cdsdisk    labdg02      labdg        online
disk12       auto:cdsdisk    labdg03      labdg        online
disk14       auto:none       -            -            online invalid
disk16       auto:none       -            -            online invalid
disk18       auto:none       -            -            online invalid
disk20_p2    auto:hpdisk     rootdisk01   rootdg       online
disk22_p2    auto:hpdisk     rootdisk02   rootdg       online
root@robin:~#
root@robin:~# vxddladm get namingscheme
NAMING_SCHEME       PERSISTENCE         MODE                
===============================================
OS Native           Yes                 New                 
root@robin:~#

Of course the naming scheme can be set back to the legacy scheme using the same procedure.

Juanma.

If you need to get the licensing information from the Veritas products installed on an HP-UX just execute the vxlicrep command..

Additionally if you want to see what feature of Veritas Volume Manager are available you can do it with vxdctl license.

Juanma.

If you need to determine the version of a Veritas diskgroup it can be done by two ways:

  • vxdg command:

Execute vxdg list <diskgroup> and look for the version field in the output.

root@vmnode1:~# vxdg list dg_sap
Group:     dg_sap
dgid:      1273503890.14.vmnode1
import-id: 1024.10
flags:     cds
version:   140 <--- VERSION!
alignment: 8192 (bytes)
local-activation: read-write
ssb:            on
detach-policy: global
dg-fail-policy: dgdisable
copies:    nconfig=default nlog=default
config:    seqno=0.1076 permlen=24072 free=24068 templen=2 loglen=3648
config disk disk27 copy 1 len=24072 state=clean online
config disk disk28 copy 1 len=24072 state=clean online
log disk disk27 copy 1 len=3648
log disk disk28 copy 1 len=3648
root@vmnode1:~#
  • vxprint command:

Run vxprint -l <diskgroup> and again look for the versión field as shown in the example.

root@vmnode1:~# vxprint -l dg_sap
Disk group: dg_sap

Group:    dg_sap
info:     dgid=1273503890.14.vmnode1
version:  140 <--- VERSION!
alignment: 8192 (bytes)
activation: read-write
detach-policy: global
dg-fail-policy: dgdisable
copies:   nconfig=default nlog=default
devices:  max=32767 cur=1
minors:   >= 4000
cds=on

root@vmnode1:~#

And as Nelson Muntz like to say… smell you later ;-)

Juanma.

In today post I will show how to create and brake a mirrored volume in Veritas Volume Manager and Logical Volume Manager.

## LVM ##

Creating a mirror of a volume and later split it in LVM is quite easy an can be done with a few commands. I’m going to suppose that the original volume is already created.

  • Extend the Volume Group that contain the lvol.

It has to be done with the same number of disks and of the same size that the ones within the VG.

[root@sheldon] / # vgextend vg_oracle /dev/disk/disk26
Volume group "vg_oracle" has been successfully extended.
Volume Group configuration for /dev/vg_oracle has been saved in /etc/lvmconf/vg_oracle.conf
[root@sheldon] / #
  • Create the mirror.
[root@sheldon] / # lvextend -m 1 /dev/vg_oracle/lv_oracle /dev/disk/disk26
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg_oracle/lv_oracle" has been successfully extended.
Volume Group configuration for /dev/vg_oracle has been saved in /etc/lvmconf/vg_oracle.conf
[root@sheldon] / #
  • Check the configuration.
[root@sheldon] / # lvdisplay /dev/vg_oracle/lv_oracle
--- Logical volumes ---
LV Name                     /dev/vg_oracle/lv_oracle
VG Name                     /dev/vg_oracle
LV Permission               read/write                
LV Status                   available/syncd           
Mirror copies               1            
Consistency Recovery        MWC                 
Schedule                    parallel      
LV Size (Mbytes)            208             
Current LE                  13             
Allocated PE                26             
Stripes                     0       
Stripe Size (Kbytes)        0                   
Bad block                   NONE         
Allocation                  strict                    
IO Timeout (Seconds)        default             
Number of Snapshots         0  

[root@sheldon] / #
  • Perform the split.
[root@sheldon] / # lvsplit -s copy /dev/vg_oracle/lv_oracle
Logical volume "/dev/vg_oracle/lv_oraclecopy" has been successfully created with
character device "/dev/vg_oracle/rlv_oraclecopy".
Logical volume "/dev/vg_oracle/lv_oracle" has been successfully split.
Volume Group configuration for /dev/vg_oracle has been saved in /etc/lvmconf/vg_oracle.conf
[root@sheldon] / #
  • Reestablish the mirror.

If the VG are 1.0 or 2.0 version the merge can not be performed if teh group is in shared mode, for the 2.1 volume groups the lvmerge can be done in any mode.

The order to do the merge is the copy FIRST and the master SECOND. This is very important if don’t want to sync the mirror in wrong direction.

[root@sheldon] / # lvmerge /dev/vg_oracle/lv_oraclecopy /dev/vg_oracle/lv_oracle
Logical volume "/dev/vg_oracle/lv_oraclecopy" has been successfully merged
with logical volume "/dev/vg_oracle/lv_oracle".
Logical volume "/dev/vg_oracle/lv_oraclecopy" has been successfully removed.
Volume Group configuration for /dev/vg_oracle has been saved in /etc/lvmconf/vg_oracle.conf
[root@sheldon] / #

## VXVM ##

The process in VxVM is in many ways similar to the LVM one.

  • Add a new disk/disks to the diskgroup

Launch the vxdiskadm tool and select Add or initialize one or more disks.

[root@sheldon] / # vxdiskadm 

Volume Manager Support Operations
Menu: VolumeManager/Disk

 1      Add or initialize one or more disks
 2      Remove a disk
 3      Remove a disk for replacement
 4      Replace a failed or removed disk
 5      Mirror volumes on a disk
 6      Move volumes from a disk
 7      Enable access to (import) a disk group
 8      Remove access to (deport) a disk group
 9      Enable (online) a disk device
 10     Disable (offline) a disk device
 11     Mark a disk as a spare for a disk group
 12     Turn off the spare flag on a disk
 13     Remove (deport) and destroy a disk group
 14     Unrelocate subdisks back to a disk
 15     Exclude a disk from hot-relocation use
 16     Make a disk available for hot-relocation use
 17     Prevent multipathing/Suppress devices from VxVM's view
 18     Allow multipathing/Unsuppress devices from VxVM's view
 19     List currently suppressed/non-multipathed devices
 20     Change the disk naming scheme
 21     Change/Display the default disk layouts
 22     Mark a disk as allocator-reserved for a disk group
 23     Turn off the allocator-reserved flag on a disk
 list   List disk information

 ?      Display help about menu
 ??     Display help about the menuing system
 q      Exit from menus

Select an operation to perform:  1

Enter the disk and answer the questions according to your configuration and exit the tool when the process is done.

Add or initialize disks
Menu: VolumeManager/Disk/AddDisks

 Use this operation to add one or more disks to a disk group.  You can
 add the selected disks to an existing disk group or to a new disk group
 that will be created as a part of the operation. The selected disks may
 also be added to a disk group as spares. Or they may be added as
 nohotuses to be excluded from hot-relocation use. The selected
 disks may also be initialized without adding them to a disk group
 leaving the disks available for use as replacement disks.

 More than one disk or pattern may be entered at the prompt.  Here are
 some disk selection examples:

 all:          all disks
 c3 c4t2:      all disks on both controller 3 and controller 4, target 2
 c3t4d2:       a single disk (in the c#t#d# naming scheme)
 xyz_0:        a single disk (in the enclosure based naming scheme)
 xyz_:         all disks on the enclosure whose name is xyz

 disk#:        a single disk (in the new naming scheme)

Select disk devices to add: [<pattern-list>,all,list,q,?]  disk28
Here is the disk selected.  Output format: [Device_Name]

 disk28

Continue operation? [y,n,q,?] (default: y)  

 You can choose to add this disk to an existing disk group, a
 new disk group, or leave the disk available for use by future
 add or replacement operations.  To create a new disk group,
 select a disk group name that does not yet exist.  To leave
 the disk available for future use, specify a disk group name
 of "none".

Which disk group [<group>,none,list,q,?] (default: none)  dg_sap

Use a default disk name for the disk? [y,n,q,?] (default: y)  n

Add disk as a spare disk for dg_sap? [y,n,q,?] (default: n)  

Exclude disk from hot-relocation use? [y,n,q,?] (default: n)  

Add site tag to disk? [y,n,q,?] (default: n)  

 The selected disks will be added to the disk group dg_sap with
 disk names that you will specify interactively.

 disk28

Continue with operation? [y,n,q,?] (default: y)  

 Initializing device disk28.

Enter desired private region length
[<privlen>,q,?] (default: 32768)  

Enter disk name for disk28 [<name>,q,?] (default: dg_sap02)  

 VxVM  NOTICE V-5-2-88
Adding disk device disk28 to disk group dg_sap with disk
 name dg_sap02.

Add or initialize other disks? [y,n,q,?] (default: n)
  • Check the configuration.
[root@sheldon] / # vxprint -g dg_sap
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg dg_sap       dg_sap       -        -        -        -        -       -

dm dg_sap01     disk27       -        228224   -        -        -       -
dm dg_sap02     disk28       -        228224   -        -        -       -

v  sapvol       fsgen        ENABLED  204800   -        ACTIVE   -       -
pl sapvol-01    sapvol       ENABLED  204800   -        ACTIVE   -       -
sd dg_sap01-01  sapvol-01    ENABLED  204800   0        -        -       -
[root@sheldon] / #
  • Create the mirror.
[root@sheldon] / # vxassist -g dg_sap mirror sapvol dg_sap02
[root@sheldon] / #
[root@sheldon] / # vxprint -g dg_sap                        
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg dg_sap       dg_sap       -        -        -        -        -       -

dm dg_sap01     disk27       -        228224   -        -        -       -
dm dg_sap02     disk28       -        228224   -        -        -       -

v  sapvol       fsgen        ENABLED  204800   -        ACTIVE   -       -
pl sapvol-01    sapvol       ENABLED  204800   -        ACTIVE   -       -
sd dg_sap01-01  sapvol-01    ENABLED  204800   0        -        -       -
pl sapvol-02    sapvol       ENABLED  204800   -        ACTIVE   -       -
sd dg_sap02-01  sapvol-02    ENABLED  204800   0        -        -       -
[root@sheldon] / #
  • Break the mirror.

To do this just disassociate the corresponding plex from the volume.

[root@sheldon] / # vxplex -g dg_sap dis sapvol-02
[root@sheldon] / # vxprint -g dg_sap             
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg dg_sap       dg_sap       -        -        -        -        -       -

dm dg_sap01     disk27       -        228224   -        -        -       -
dm dg_sap02     disk28       -        228224   -        -        -       -

pl sapvol-02    -            DISABLED 204800   -        -        -       -
sd dg_sap02-01  sapvol-02    ENABLED  204800   0        -        -       -

v  sapvol       fsgen        ENABLED  204800   -        ACTIVE   -       -
pl sapvol-01    sapvol       ENABLED  204800   -        ACTIVE   -       -
sd dg_sap01-01  sapvol-01    ENABLED  204800   0        -        -       -
[root@sheldon] / #
  • Reattach the plex to the volume and reestablish the mirror.
[root@sheldon] / # vxplex -g dg_sap att sapvol sapvol-02
[root@sheldon] / #

And we are done for now, more VxVM stuff in a future post :-)

Juanma.