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

25 Jul 13 Replacing a bad vxvm boot disk. HP-UX 11.23 PA-RISC

So you lose a boot disk on a vxvm booted system. You hot replace the disk, but now you need to make sure the software mirror is good.

 

Lets say for example its rootdisk02

If the disk stayed alive and did not power down you can run vxbrk_rootmirror and cleanly replace the disk.

What do do if the disk powered down?

/opt/VRTS/bin/vxdiskunsetup -C rootdisk02

vxrecover -g rootdg -sb

You more than likely end up with a disk named like this that is totally useless:

rootdg.26724.31359

vxdg destroy rootdg.26724.31359  (on rootdisk02)

 

Remove the incomplete mirror copy

 

/etc/vx/bin/vxbrk_rootmir -v rootdisk02

 

And mirror it back ,

/opt/VRTS/bin/vxrootmir -v -g rootdg rootdisk02

 

Tags: , , , ,

02 Oct 12 How to not blow up a vxvm boot HP-UX system when breaking the mirror

This is an improvement to fixing the problems if you do blow things up. Click here to see.

Here is the thing. VXvM is messed up on HP-UX. The mirror break command is broken on 11.23 and 11.31.

That being said depending on how you use it, you can have a mess to clean up or not.

Scenario:

[shmuel01]/root # vxdisk list
DEVICE TYPE DISK GROUP STATUS
c2t0d0 auto:hpdisk rootdisk02 rootdg online failing
c2t1d0 auto:hpdisk rootdisk01 rootdg online failing

Note the disks are supposedly failing. Easy fix, though I can’t say how long this will last.

[shmuel01]/root # vxedit -g rootdg set failing=off rootdisk01
[shmuel01]/root # vxedit -g rootdg set failing=off rootdisk02

Now we look at them.

[shmuel01]/root # vxdisk list
DEVICE TYPE DISK GROUP STATUS
c2t0d0 auto:hpdisk rootdisk02 rootdg online
c2t1d0 auto:hpdisk rootdisk01 rootdg online

Now they are fixed.

Now to the heart of the matter. Lets say you want to break c2t0d0 out of the mirror and say make a drd image. The man page and HP support says you can use this form.

/etc/vx/bin/vxbrk_rootmir -g rootdg -vb c2t0d0

If you use that form on many HP-UX systems the mirror break will fail and you will have a mess to clean up. If you want to prove your skills go ahead and use that form and click the link above to find the fix.

If you would rather look smart and say cruise the Internet, do this form.

/etc/vx/bin//vxbrk_rootmir -g rootdg -vb rootdisk02

You get the following UGLY results.

[shmuel01]/root # /etc/vx/bin//vxbrk_rootmir -g rootdg -vb rootdisk02
VxVM vxbrk_rootmir INFO V-5-2-4023 14:23: Checking specified disk(s) for presence and type
VxVM vxbrk_rootmir INFO V-5-2-4025 14:23: DA c2t0d0, DM rootdisk02 is a valid root mirror
VxVM vxbrk_rootmir INFO V-5-2-4052 14:23: Saving configuration data for later restoration
sed: Function s/plex=.*$/plex=homevol-02 cannot be parsed.
sed: Function s/plex=.*$/plex=lpvol-02 cannot be parsed.
sed: Function s/plex=.*$/plex=optvol-02 cannot be parsed.
sed: Function s/plex=.*$/plex=standvol-02 cannot be parsed.
sed: Function s/plex=.*$/plex=tmpvol-02 cannot be parsed.
sed: Function s/plex=.*$/plex=usrvol-02 cannot be parsed.
sed: Function s/plex=.*$/plex=varvol-02 cannot be parsed.
VxVM vxbrk_rootmir INFO V-5-2-4022 14:23: Breaking off root mirror on DA c2t0d0
VxVM vxbrk_rootmir INFO V-5-2-4054 14:23: Setting broken off mirror on c2t0d0 as unique root disk
VxVM vxbrk_rootmir INFO V-5-2-2566 14:23: Preparing disk c2t0d0 as a VxVM root disk
VxVM vxmake ERROR V-5-1-1173 Volume swvol already exists
VxVM vxbrk_rootmir ERROR V-5-2-4020 Attempting to recreate volume meta-data on rootdisk02/c2t0d0

However the only thing that actually goes wrong is removing the disk rootdisk02 from the roodg.

Easily fixed with a single command.

vxdg -g rootdg rmdisk rootdisk02

vxdisk list shows:

[shmuel01]/root # vxdisk list
DEVICE TYPE DISK GROUP STATUS
c2t0d0 auto:hpdisk – – online
c2t1d0 auto:hpdisk rootdisk01 rootdg online

A healthy ready for DRD cloning rootdg

[shmuel01]/root # vxprint -ht -g 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 NVOLUME KSTATE STATE
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

dg rootdg default default 0 1129312400.1025.loopback

dm rootdisk01 c2t1d0 auto 1024 143364644 –

v homevol – ENABLED ACTIVE 524288 SELECT – fsgen
pl homevol-01 homevol ENABLED ACTIVE 524288 CONCAT – RW
sd rootdisk01-04 homevol-01 rootdisk01 9961472 524288 0 c2t1d0 ENA
pl homevol-04 homevol ENABLED ACTIVE LOGONLY CONCAT – RW
sd rootdisk01-14 homevol-04 rootdisk01 35389473 33 LOG c2t1d0 ENA

v lpvol – ENABLED ACTIVE 524288 SELECT – fsgen
pl lpvol-01 lpvol ENABLED ACTIVE 524288 CONCAT – RW
sd rootdisk01-12 lpvol-01 rootdisk01 34865152 524288 0 c2t1d0 ENA
pl lpvol-04 lpvol ENABLED ACTIVE LOGONLY CONCAT – RW
sd rootdisk01-16 lpvol-04 rootdisk01 35389572 33 LOG c2t1d0 ENA

v optvol – ENABLED ACTIVE 4194304 SELECT – fsgen
pl optvol-01 optvol ENABLED ACTIVE 4194304 CONCAT – RW
sd rootdisk01-05 optvol-01 rootdisk01 10485760 4194304 0 c2t1d0 ENA
pl optvol-04 optvol ENABLED ACTIVE LOGONLY CONCAT – RW
sd rootdisk01-17 optvol-04 rootdisk01 35389605 66 LOG c2t1d0 ENA

v rootvol – ENABLED ACTIVE 1048576 ROUND – root
pl rootvol-01 rootvol ENABLED ACTIVE 1048576 CONCAT – RW
sd rootdisk01-03 rootvol-01 rootdisk01 8912896 1048576 0 c2t1d0 ENA

v standvol – ENABLED ACTIVE 524288 ROUND – fsgen
pl standvol-01 standvol ENABLED ACTIVE 524288 CONCAT – RW
sd rootdisk01-01 standvol-01 rootdisk01 0 524288 0 c2t1d0 ENA
pl standvol-04 standvol DETACHED ACTIVE LOGONLY CONCAT – RW
sd rootdisk01-18 standvol-04 rootdisk01 35389671 33 LOG c2t1d0 ENA

v swapvol – ENABLED ACTIVE 8388608 ROUND – swap
pl swapvol-01 swapvol ENABLED ACTIVE 8388608 CONCAT – RW
sd rootdisk01-02 swapvol-01 rootdisk01 524288 8388608 0 c2t1d0 ENA

v swvol – ENABLED ACTIVE 6291456 SELECT – fsgen
pl swvol-01 swvol ENABLED ACTIVE 6291456 CONCAT – RW
sd rootdisk01-10 swvol-01 rootdisk01 27525120 6291456 0 c2t1d0 ENA
pl swvol-03 swvol ENABLED ACTIVE LOGONLY CONCAT – RW
sd rootdisk01-06 swvol-03 rootdisk01 35389440 33 LOG c2t1d0 ENA

v tmpvol – ENABLED ACTIVE 2097152 SELECT – fsgen
pl tmpvol-01 tmpvol ENABLED ACTIVE 2097152 CONCAT – RW
sd rootdisk01-07 tmpvol-01 rootdisk01 14942208 2097152 0 c2t1d0 ENA
pl tmpvol-04 tmpvol ENABLED ACTIVE LOGONLY CONCAT – RW
sd rootdisk01-20 tmpvol-04 rootdisk01 35389737 33 LOG c2t1d0 ENA

v usrvol – ENABLED ACTIVE 5242880 SELECT – fsgen
pl usrvol-01 usrvol ENABLED ACTIVE 5242880 CONCAT – RW
sd rootdisk01-08 usrvol-01 rootdisk01 17039360 5242880 0 c2t1d0 ENA
pl usrvol-04 usrvol ENABLED ACTIVE LOGONLY CONCAT – RW
sd rootdisk01-21 usrvol-04 rootdisk01 35389770 66 LOG c2t1d0 ENA

v varvol – ENABLED ACTIVE 5242880 SELECT – fsgen
pl varvol-01 varvol ENABLED ACTIVE 5242880 CONCAT – RW
sd rootdisk01-09 varvol-01 rootdisk01 22282240 5242880 0 c2t1d0 ENA
pl varvol-04 varvol ENABLED ACTIVE LOGONLY CONCAT – RW
sd rootdisk01-22 varvol-04 rootdisk01 35389836 66 LOG c2t1d0 ENA

Tags: , , ,

21 Jun 12 Taking apart a blown up vxvm boot system

Scenario:

vxvm boot system shut down decommissioned. It was left off for over a year. Hardware is needed. System is brought up.

Now you have rootdisk2 part of the boot disk group and to do anything useful you need to clean it up.

Get data:

vxprint -ht -g rootdg

I thought to write this only after I was done. So I don’t have a before state picture.

vxdg -g rootdg rmdisk rootdisk02

Getting rid of the sub disks (BE CAREFUL)

vxsd -g rootdg  -o force dis rootdisk02-10
Better to use -o force only when needed.
vxplex -g rootdg dis homevol-02
Here is the end state:
[sap1slt2]/var/opt/drd # vxprint -ht -g 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         NVOLUME      KSTATE   STATE
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      DCOdg rootdg       default      default  562000   1172687615.12.sapit04dm rootdisk01   c0t8d0s2     auto     1024     142449936 –
dm rootdisk02   –            –        –        –        REMOVEDsd rootdisk02-01 –           rootdisk02 0      524288   –         –        RMOV
sd rootdisk02-02 –           rootdisk02 524288 33554432 –         –        RMOV
sd rootdisk02-03 –           rootdisk02 34078720 1048576 –        –        RMOV
sd rootdisk02-04 –           rootdisk02 35127296 524288 –         –        RMOV
sd rootdisk02-05 –           rootdisk02 35651584 8388608 –        –        RMOV
sd rootdisk02-06 –           rootdisk02 44040192 2097152 –        –        RMOV
sd rootdisk02-07 –           rootdisk02 46137344 8388608 –        –        RMOV
sd rootdisk02-08 –           rootdisk02 54525952 8388608 –        –        RMOV
sd rootdisk02-09 –           rootdisk02 62914560 524288 –         –        RMOV
sd rootdisk02-10 –           rootdisk02 72089600 15728640 –       –        RMOV

sd rootdisk02-11 lpvol-02    rootdisk02 68419584 524288 0         –        RMOV
sd rootdisk02-12 –           rootdisk02 68943872 3145728 –        –        RMOV
sd rootdisk02-13 –           rootdisk02 63438848 1048576 –        –        RMOV


pl crashvol-01  –            DISABLED –        0        CONCAT    –        RW
pl homevol-02   –            DISABLED –        0        CONCAT    –        RW
pl optvol-02    –            DISABLED –        0        CONCAT    –        RW
pl standvol-02  –            DISABLED –        0        CONCAT    –        RW
pl swapvol-02   –            DISABLED –        0        CONCAT    –        RW
pl swvol-02     –            DISABLED –        0        CONCAT    –        RW
pl tmpvol-02    –            DISABLED –        0        CONCAT    –        RW
pl usrvol-02    –            DISABLED –        0        CONCAT    –        RW
pl varvol-02    –            DISABLED –        0        CONCAT    –        RW

v  crashvol     –            ENABLED  ACTIVE   15728640 SELECT    –        fsgen
pl crashvol-02  crashvol     ENABLED  ACTIVE   15728640 CONCAT    –        RW
sd rootdisk01-13 crashvol-02 rootdisk01 118226944 15728640 0      c0t8d0s2 ENA

v  homevol      –            ENABLED  ACTIVE   1048576  SELECT    –        fsgen
pl homevol-01   homevol      ENABLED  ACTIVE   1048576  CONCAT    –        RW
sd rootdisk01-04 homevol-01  rootdisk01 35127296 524288 0         c0t8d0s2 ENA
sd rootdisk01-11 homevol-01  rootdisk01 66322432 524288 524288    c0t8d0s2 ENA

v  lpvol        –            ENABLED  ACTIVE   524288   SELECT    –        fsgen
pl lpvol-01     lpvol        ENABLED  ACTIVE   524288   CONCAT    –        RW
sd rootdisk01-12 lpvol-01    rootdisk01 71565312 524288 0         c0t8d0s2 ENA
pl lpvol-02     lpvol        DISABLED REMOVED  524288   CONCAT    –        WO

v  optvol       –            ENABLED  ACTIVE   8388608  SELECT    –        fsgen
pl optvol-01    optvol       ENABLED  ACTIVE   8388608  CONCAT    –        RW
sd rootdisk01-05 optvol-01   rootdisk01 35651584 8388608 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 34078720 1048576 0        c0t8d0s2 ENA
pl rootvol-02   rootvol      DISABLED RECOVER  0        CONCAT    –        RW

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

v  swapvol      –            ENABLED  ACTIVE   33554432 SELECT    –        swap
pl swapvol-01   swapvol      ENABLED  ACTIVE   33554432 CONCAT    –        RW
sd rootdisk01-02 swapvol-01  rootdisk01 524288 33554432 0         c0t8d0s2 ENA

v  swapvol2     –            ENABLED  ACTIVE   46137344 SELECT    –        fsgen
pl swapvol2-01  swapvol2     ENABLED  ACTIVE   46137344 CONCAT    –        RW
sd rootdisk01-06 swapvol2-01 rootdisk01 72089600 46137344 0       c0t8d0s2 ENA

v  swvol        –            ENABLED  ACTIVE   3145728  SELECT    –        fsgen
pl swvol-01     swvol        ENABLED  ACTIVE   3145728  CONCAT    –        RW
sd rootdisk01-10 swvol-01    rootdisk01 63176704 3145728 0        c0t8d0s2 ENA

v  tmpvol       –            ENABLED  ACTIVE   2097152  SELECT    –        fsgen
pl tmpvol-01    tmpvol       ENABLED  ACTIVE   2097152  CONCAT    –        RW
sd rootdisk01-07 tmpvol-01   rootdisk01 44302336 2097152 0        c0t8d0s2 ENA

v  usrvol       –            ENABLED  ACTIVE   8388608  SELECT    –        fsgen
pl usrvol-01    usrvol       ENABLED  ACTIVE   8388608  CONCAT    –        RW
sd rootdisk01-08 usrvol-01   rootdisk01 46399488 8388608 0        c0t8d0s2 ENA

v  varvol       –            ENABLED  ACTIVE   9437184  SELECT    –        fsgen
pl varvol-01    varvol       ENABLED  ACTIVE   9437184  CONCAT    –        RW
sd rootdisk01-09 varvol-01   rootdisk01 54788096 8388608 0        c0t8d0s2 ENA
sd rootdisk01-14 varvol-01   rootdisk01 66846720 1048576 8388608  c0t8d0s2 ENA

Now maybe I can run drd clone. For those of you that found a mistake in the original post, kudos the drd clone failed. I have removed the offending disk and tried again.
All evidence that rootdisk02 ever existed must be erased.

Time to clean up the mess we made. attach and disassociate properly.

 

532     vxplex -o force -g rootdg att swvol swvol-02

533     vxplex -o force -o rm -g rootdg dis swvol-02

 

575     vxprint -ht -g rootdg | grep RMOV | awk ‘{print $2}’ | while read -r sd

        do

          vxedit -g rootdg rm $sd

        done

vxedit -g rootdg rm rootdisk02

20 Jun 12 Force umount when a file system won’t umount

Lets say we have a file system mounted as /stuck

umount /stuck

Mount Point busy.

fuser -cu /stuck

# shows no open processes on the filesystem. umount won’t work.

umount has no documented -f (force) paramter

vxumount is the tool of choice here.

vxumount -o force /stuck

/stuck is no longer stuck

vxmount is not always in the PATH. It is something worth searching for and is available on most HP-UX systems.

Only works on vxfs file systems, not HFS or NFS.

 

Tags: ,

16 Feb 12 Enabling a falsely disabled OnlineJFS license

Older versions of HP-UX 11.11,11.23 and 11.31 do suffer from the OnlineJFS license disabling itself. This was due to a product defect from Symanntec which HP let into a depot a few years ago.

System had this license information:

vxlicrep[/root] # vxlicrep

Symantec License Manager vxlicrep utility version 3.02.19.0
Copyright (C) 1996-2006 Symantec Corporation. All rights reserved.

Creating a report on all VERITAS products installed on this system

—————–***********************—————–

License Key = 3JZU-WDP6-PP6C-P4O4-HS38-NPPO-P
Product Name = VERITAS File System
Serial Number = 1
License Type = PERMANENT
OEM ID = 4095

Features :=
HP_OnlineJFS = Enabled

CPU Count = Not Restricted
Platform = HP-UX
Version = 4.1
File Change Log = Enabled
Maximum number of file systems = Not Restricted

Command and response.
fsadm: /etc/default/fs is used for determining the file system type
vxfs fsadm: V-3-25255: fsadm: You don’t have a license to run this program

[/root] # vxenablef -a

After the vxenablef -a statement the fsadm command starts to work. This will is not a license bypass. If the system is not actually licensed it won’t work.

fsadm command works after this correction.

Tags: , ,

12 Jul 11 Migrate VXVM booted system to LVM

From the HP-UX Veritas Administration guide, buried on page 106

This example shows how to create an LVM root disk on physical disk c0t1d0
after removing the existing LVM root disk configuration from that disk.

BOOTBG=$(vxdg bootdg)

vxprint -htg $BOOTDG | grep ^dm

dm rootdisk01   disk233_p2   auto     1024     142450592 –
dm rootmirr     disk234_p2   auto     1024     142450592 –

# You get the boot disk from this command. Break off the s2 if you are using legacy devices you can use them or the agile SDF devices.

# You may need to use vxbrk_mirror to break the mirror. Make sure you know which disk you are booted from. Check syslog to be sure. setboot is not a good indicator.

# Due to a wordpress error I’ve been forced to take the path etc vx bin out of the commands. I will fix this when wordpress stops blowing chunks on this data. Where there are spaces there need to be slashes.
#  etc vx bin vxdestroy_lvmroot -v c0t1d0
# etc vx bin vxres_lvmroot -v -b c0t1d0
The -b option to vxres_lvmroot sets c0t1d0 as the primary boot device.
As these operations can take some time, the verbose option, -v, is specified to
indicate how far the operation has progressed.

This command takes care of setboot and all details. Then just boot from the console.

This procedure does not remove VxVM software. The daemon still runs. But your system now boots LVM and that makes using Dynamic Root Disk (DRD) much easier.

 

Tags: , , , , , ,

05 Jul 11 VxVM replace boot disk

Create a partition description file

(Need to update the EFI and HPSP size below according to the other root disk partition’s size)
This examples is where the new disk is disk85. Applies only to HP-UX 11.31 with VxVM as boot drive manager.

# vi /tmp/efipart

3
EFI 500MB
HPUX 100%
HPSP 400MB

Use the idisk(1M) command to partition the disk according to this file
# idisk -wf /tmp/efipart /dev/rdisk/disk85

Write EFI info to the EFI partition on the disk
# mkboot -e -l /dev/rdisk/disk85

Confirm the AUTO file entry is intact It should be  “boot vmunix”
# efi_cp -d /dev/rdisk/disk85_p1 -u /EFI/HPUX/AUTO /tmp/efi; cat /tmp/efi

If found any difference, edit /tmp/efi file  as below to update the entry “boot vmunix”
#echo “boot vmunix ” > /tmp/efi

Update auto file
#efi_cp -d /dev/rdisk/disk85_p1 /tmp/efi /EFI/HPUX/AUTO

Confirm the AUTO file entry again, It should be  “boot vmunix”
# efi_cp -d /dev/rdisk/disk85_p1 -u /EFI/HPUX/AUTO /tmp/efi; cat /tmp/efi

Initialize the disk as VXVM  boot disk

#### vxdisksetup -iB disk85_p2  ((lives in etc vx bin slashes removed due to Word Press error))

Add the disk to the existing rootdg
# vxdg -g rootdg adddisk rootdisk02=disk85_p2

Write Volume Manager volume information to the LABEL file:
# /opt/VRTS/bin/vxbootsetup rootdisk02

Display the LIF and Volume Manager label information:
# vxvmboot -v /dev/rdisk/disk85

Check the Mirror status  ( Each volume should be with two plex )
$ vxprint –htg rootdg |egrep –i “^v|^pl”

 

Tags: , , , ,

sidebarbottom
sidebartop
sidebarbottom
WhatsApp chat