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

27 Jan 14 Fixing an inconsistent volume group with no downtime

I recently encountered a volume group that was part legacy devices, part dsf agile.
root@protterdbsvr1:/root/shuffle> vgdisplay -v vgprotter
--- Volume groups ---
VG Name                     /dev/vgprotter
VG Write Access             read/write
VG Status                   available
Max LV                      2047
Cur LV                      15
Open LV                     15
Cur Snapshot LV             0
Max PV                      2048
Cur PV                      11
Act PV                      11
Max PE per PV               65536
VGDA                        22
PE Size (Mbytes)            16
Unshare unit size (Kbytes)  1024
Total PE                    48004
Alloc PE                    46765
Current pre-allocated PE    0
Free PE                     1239
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  2.2
VG Max Size                 1t
VG Max Extents              65536
Cur Snapshot Capacity       0p
Max Snapshot Capacity       1t
   --- Logical volumes ---
   LV Name                     /dev/vgprotter/sqlbin
   LV Status                   available/syncd
   LV Size (Mbytes)            20000
   Current LE                  1250
   Allocated PE                1250
   Used PV                     1
   LV Name                     /dev/vgprotter/sqladmin
   LV Status                   available/syncd
   LV Size (Mbytes)            4000
   Current LE                  250
   Allocated PE                250
   Used PV                     1
   LV Name                     /dev/vgprotter/sqlctrl1
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  32
   Allocated PE                32
   Used PV                     1
   LV Name                     /dev/vgprotter/sqlctrl2
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  32
   Allocated PE                32
   Used PV                     1
   LV Name                     /dev/vgprotter/sqldata1
   LV Status                   available/syncd
   LV Size (Mbytes)            550000
   Current LE                  34375
   Allocated PE                34375
   Used PV                     10
   LV Name                     /dev/vgprotter/sqldiag
   LV Status                   available/syncd
   LV Size (Mbytes)            4000
   Current LE                  250
   Allocated PE                250
   Used PV                     1
   LV Name                     /dev/vgprotter/sqlexport
   LV Status                   available/syncd
   LV Size (Mbytes)            70000
   Current LE                  4375
   Allocated PE                4375
   Used PV                     5
   LV Name                     /dev/vgprotter/sqlindex1
   LV Status                   available/syncd
   LV Size (Mbytes)            30000
   Current LE                  1875
   Allocated PE                1875
   Used PV                     1
   LV Name                     /dev/vgprotter/sqlredo1
   LV Status                   available/syncd
   LV Size (Mbytes)            10000
   Current LE                  625
   Allocated PE                625
   Used PV                     1
   LV Name                     /dev/vgprotter/sqlredo2
   LV Status                   available/syncd
   LV Size (Mbytes)            10000
   Current LE                  625
   Allocated PE                625
   Used PV                     1
   LV Name                     /dev/vgprotter/sqlsystem
   LV Status                   available/syncd
   LV Size (Mbytes)            7200
   Current LE                  450
   Allocated PE                450
   Used PV                     1
   LV Name                     /dev/vgprotter/sqltemp
   LV Status                   available/syncd
   LV Size (Mbytes)            20000
   Current LE                  1250
   Allocated PE                1250
   Used PV                     1
   LV Name                     /dev/vgprotter/sqltools
   LV Status                   available/syncd
   LV Size (Mbytes)            1008
   Current LE                  63
   Allocated PE                63
   Used PV                     1
   LV Name                     /dev/vgprotter/sqlundo
   LV Status                   available/syncd
   LV Size (Mbytes)            20000
   Current LE                  1250
   Allocated PE                1250
   Used PV                     1
   LV Name                     /dev/vgprotter/sqlusers
   LV Status                   available/syncd
   LV Size (Mbytes)            1008
   Current LE                  63
   Allocated PE                63
   Used PV                     1
 
   --- Physical volumes ---
   PV Name                     /dev/dsk/c3t1d6
   PV Name                     /dev/dsk/c5t1d6  Alternate Link
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/dsk/c3t1d7
   PV Name                     /dev/dsk/c5t1d7  Alternate Link
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/dsk/c3t2d0
   PV Name                     /dev/dsk/c5t2d0  Alternate Link
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/dsk/c3t2d1
   PV Name                     /dev/dsk/c5t2d1  Alternate Link
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/dsk/c3t2d2
   PV Name                     /dev/dsk/c5t2d2  Alternate Link
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/disk/disk220
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/disk/disk221
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/disk/disk222
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/disk/disk223
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/disk/disk224
   PV Status                   available
   Total PE                    4364
   Free PE                     0
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On
   PV Name                     /dev/disk/disk225
   PV Status                   available
   Total PE                    4364
   Free PE                     1239
   Current pre-allocated PE    0
   Autoswitch                  On
   Proactive Polling           On

The issue is that two different technologies, alternate link and native multipathing are in use in the same volume group.

The volume group was working but might have maintenance issues down the road. Plus I personally found it darn confusing.
  PV Name                     /dev/dsk/c3t2d2
   PV Name                     /dev/dsk/c5t2d2  Alternate Link
 
The fix:
vgextend vgprotter /dev/disk/disk53
echo $?
0
vgreduce vgprotter /dev/dsk/c3t2d2
echo $?
0
vgreduce vgprotter /dev/dsk/c5t2d2
echo $?
0
We check the return code to make sure the operation was a success. Repeat for each legacy device.
No downtime though for prodcution systems I recommend working with a change request under your organizations policy.

What id looks like after we are done:

root@
protterdbsvr1:/root> vgdisplay -v vgprotter
--- Volume groups ---
VG Name /dev/vgprotter
VG Write Access read/write
VG Status available
Max LV 2047
Cur LV 15
Open LV 15
Cur Snapshot LV 0
Max PV 2048
Cur PV 11
Act PV 11
Max PE per PV 65536
VGDA 22
PE Size (Mbytes) 16
Unshare unit size (Kbytes) 1024
Total PE 48004
Alloc PE 46765
Current pre-allocated PE 0
Free PE 1239
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 2.2
VG Max Size 1t
VG Max Extents 65536
Cur Snapshot Capacity 0p
Max Snapshot Capacity 1t
--- Logical volumes ---
LV Name /dev/vgprotter/sqlbin
LV Status available/syncd
LV Size (Mbytes) 20000
Current LE 1250
Allocated PE 1250
Used PV 1
LV Name /dev/vgprotter/sqladmin
LV Status available/syncd
LV Size (Mbytes) 4000
Current LE 250
Allocated PE 250
Used PV 1
LV Name /dev/vgprotter/sqlctrl1
LV Status available/syncd
LV Size (Mbytes) 512
Current LE 32
Allocated PE 32
Used PV 1
LV Name /dev/vgprotter/sqlctrl2
LV Status available/syncd
LV Size (Mbytes) 512
Current LE 32
Allocated PE 32
Used PV 1
LV Name /dev/vgprotter/sqldata1
LV Status available/syncd
LV Size (Mbytes) 550000
Current LE 34375
Allocated PE 34375
Used PV 10
LV Name /dev/vgprotter/sqldiag
LV Status available/syncd
LV Size (Mbytes) 4000
Current LE 250
Allocated PE 250
Used PV 1
LV Name /dev/vgprotter/sqlexport
LV Status available/syncd
LV Size (Mbytes) 70000
Current LE 4375
Allocated PE 4375
Used PV 5
LV Name /dev/vgprotter/sqlindex1
LV Status available/syncd
LV Size (Mbytes) 30000
Current LE 1875
Allocated PE 1875
Used PV 1
LV Name /dev/vgprotter/sqlredo1
LV Status available/syncd
LV Size (Mbytes) 10000
Current LE 625
Allocated PE 625
Used PV 1
LV Name /dev/vgprotter/sqlredo2
LV Status available/syncd
LV Size (Mbytes) 10000
Current LE 625
Allocated PE 625
Used PV 1
LV Name /dev/vgprotter/sqlsystem
LV Status available/syncd
LV Size (Mbytes) 7200
Current LE 450
Allocated PE 450
Used PV 1
LV Name /dev/vgprotter/sqltemp
LV Status available/syncd
LV Size (Mbytes) 20000
Current LE 1250
Allocated PE 1250
Used PV 1
LV Name /dev/vgprotter/sqltools
LV Status available/syncd
LV Size (Mbytes) 1008
Current LE 63
Allocated PE 63
Used PV 1
LV Name /dev/vgprotter/sqlundo
LV Status available/syncd
LV Size (Mbytes) 20000
Current LE 1250
Allocated PE 1250
Used PV 1
LV Name /dev/vgprotter/sqlusers
LV Status available/syncd
LV Size (Mbytes) 1008
Current LE 63
Allocated PE 63
Used PV 1
 
--- Physical volumes ---
PV Name /dev/disk/disk220
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk221
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk222
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk223
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk224
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk225
PV Status available
Total PE 4364
Free PE 1239
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk57
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk56
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk55
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk54
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk53
PV Status available
Total PE 4364
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

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: , , ,

11 Jul 12 Online JFS filesystem expansion without umount

This requires add in software from Veritas/Symmantec that can be expensive on HP-UX.

Lets say we want to extend /var which is lvol8.

It was originally 600 LE and we extended it as follows.

lvextend -l 800 /dev/vg00/lvol8 /dev/disk/disk25_p2

The 800 refers to LE logical extents. I prefer to use this rather than MB because it corresponds to the values displayed by most lvm utilities. -L <value in megabytes> can be used. I assume you can do the math here.

[system099]/root # lvdisplay /dev/vg00/lvol8
— Logical volumes —
LV Name                     /dev/vg00/lvol8
VG Name                     /dev/vg00
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               1
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            12800
Current LE                  800
Allocated PE                1600
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  non-strict
IO Timeout (Seconds)        default

It was originally 600 LE and we extended it as follows.

lvextend -l 800 /dev/vg00/lvol8 /dev/disk/disk25_p2

 

fsadm -F vxfs -b 12800M /var

This command will use online JFS to extend the filesystem. The alternative is extendfs. But that requires a umount.  Or perhaps xvumount -o force. Your choice, I don’t recommend it, but did test it the other day in the sandbox.

Now if you want to be cute and use all your space, try this.

SIZE=$(lvdisplay /dev/vg00/lvol8 | awk ‘/LV Size/ {print $NF}’);

ESIZE=”${SIZE}M”

fsadm -F vxfs -b $ESIZE /var

You can get more cute and do it with a single command line but I’m not going to do that. I have not broken any systems this week and am trying to avoid that.

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: ,

07 Jun 12 awk trick of the day(month?) parsing bdf output. awk with if else logic

Ever try and do system reporting based on bdf?

Annoying as all heck that sometimes the output is two line and sometimes one? I was forced to solve that problem today.

 

if [ “$OS” = “HP-UX” ]
then
   dcmd=bdf
fi

arraypointer=0

exec $dcmd | egrep -v “%used|/dev/deviceFileSystem” | awk ‘{lvn=$1;v=$2;if (v==””) {getline;cap=$1;ucap=$2;acap=$3;puse=$4;mp=$5;printf “%s %s %s %s %s %s\n”, lvn,cap,ucap,acap,puse,mp} else {printf “%s %s %s %s %s %s\n”, $1,$2,$3,$4,$5,$6} }’ | while read -r  p1 p2 p3 p4 p5 p6
do

   #### calculations

done

Typical bdf output:

/dev/vg00/lvol9    4096000 3140019  896285   78% /var/adm/crash
/dev/vg_stgb1/lvol1
1572765696 1382813225 178080447   89% /steven05stgb

More when the script is done

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: , , , , , ,

06 Apr 11 setboot hardware path to legacy hardware path. A converter.

HP-UX 11.23

setboot provides output only including the hardware path (ioscan -H).

When calculating DRD clone targets and such you need the regular legacy device path.

Here is a converter, built with a little help from JRF on the ITRC forums.

First get the setboot path. Might want to use the full path of the setboot command in practice.

pboot=$(setboot | grep ^Primary | awk ‘{ print $NF }’);
aboot=$(setboot | grep ^Alternate |awk ‘{ print $NF}’);

abootdisk=$(ioscan -kfnCdisk | awk -v aboot=${aboot} ‘/aboot/ $0~aboot {getline;print aboot,$2}’ | awk ‘{ print $2 }’);

pbootdisk=$(ioscan -kfnCdisk | awk -v aboot=${pboot} ‘/pboot/ $0~pboot {getline;print pboot,$2}’ | awk ‘{ print $2 }’);

The slick part is getting the variable in and out of awk.

Uses ioscan.

Tags: , , ,

20 May 10 clean up procedure after ignite replication of hpvm host

This errror is created by Ignite replication of an hpvm system. The following checks device integrity and cleans up errors created by Ignite replication.

hpvmcreate: ERROR (jdeautp1): Incorrect backing device type.

First check for errors with this script (I may check this in at some point)

#!/usr/bin/sh
#
# Unofficial quick and dirty passthru DSF check script
#
# It walks all /dev/pt/* files and tries to find corresponding /dev/rdisk
# or /dev/rtape files. If they are foudn their minor numbers are compared.
#
# @(#) pt_check.sh v1.1 – stanm@wtec
#

for i in $(ls /dev/pt/*)
do
# ll $i
shortname=${i##*_}
printf “checking $shortname”
minor1=$(ll $i|awk ‘{print $6}’)
# echo minor1=$minor ($i)
if [ -c /dev/rdisk/$shortname ]; then
minor2=$(ll /dev/rdisk/$shortname|awk ‘{print $6}’)
# echo minor2=$minor2 ($/dev/rdisk/$shortname)
if [[ “x$minor1” = “x$minor2″ ]]; then
printf ” – OK\n”
else
printf ” – Minor numbers are probably incorrect\n”
printf “minor1=$minor1 ($i) vs ”
printf “minor2=$minor2 (/dev/rdisk/$shortname)\n”
fi
else
# could be tape
if [ -c /dev/rtape/${shortname}_BEST ]; then
minor2=$(ll /dev/rtape/${shortname}_BEST|awk ‘{print $6}’)
if [[ “x$minor1” = “x$minor2″ ]]; then
printf ” – OK\n”
else
printf ” – Minor numbers are probably incorrect\n”
printf “minor1=$minor1 ($i) vs ”
printf “minor2=$minor2 (/dev/rtape/${shortname}_BEST)\n”
fi
else
printf ” – /dev/rdisk/$shortname or /dev/rtape/${shortname}_BEST not found – check skipped\n”
fi
fi
done

Output indicating problems:

checking disk11 – Minor numbers are probably incorrect
minor1=0x000005 (/dev/pt/pt_disk11) vs minor2=0x000008 (/dev/rdisk/disk11)
checking disk12 – Minor numbers are probably incorrect
minor1=0x000006 (/dev/pt/pt_disk12) vs minor2=0x000009 (/dev/rdisk/disk12)
checking disk13 – Minor numbers are probably incorrect
minor1=0x000007 (/dev/pt/pt_disk13) vs minor2=0x00000a (/dev/rdisk/disk13)
checking disk14 – Minor numbers are probably incorrect
minor1=0x000008 (/dev/pt/pt_disk14) vs minor2=0x00000b (/dev/rdisk/disk14)
checking disk15 – Minor numbers are probably incorrect
minor1=0x000009 (/dev/pt/pt_disk15) vs minor2=0x00000c (/dev/rdisk/disk15)
checking disk17 – OK
checking disk18 – /dev/rdisk/disk18 or /dev/rtape/disk18_BEST not found – check skipped
checking disk19 – Minor numbers are probably incorrect
minor1=0x000017 (/dev/pt/pt_disk19) vs minor2=0x000013 (/dev/rdisk/disk19)
checking disk2 – OK
checking disk22 – Minor numbers are probably incorrect
minor1=0x000018 (/dev/pt/pt_disk22) vs minor2=0x000014 (/dev/rdisk/disk22)
checking disk23 – Minor numbers are probably incorrect
minor1=0x000019 (/dev/pt/pt_disk23) vs minor2=0x000015 (/dev/rdisk/disk23)
checking disk3 – OK
checking disk5 – OK
checking disk8 – /dev/rdisk/disk8 or /dev/rtape/disk8_BEST not found – check skipped
checking disk9 – /dev/rdisk/disk9 or /dev/rtape/disk9_BEST not found – check skipped

Correction procedure:

cd /var/opt/hpvm/common/

rm -f hpvm_devinit
cd /dev/pt
ls
rm -f *
hpvmdevmgmt -I

Consider this a necessary procedure to clean up after ignite replication

Tags: , , , , , , ,

WhatsApp chat