In VxVM (Veritas Volume Manager) 5.0 versions, VxVM allowed initialization of 1TB+ LUN(s) and did not take into consideration where an EFI MBR (Master Boot Record) record was stamped (block 1 of the disk); therefore we simply used disk_offset 0. Starting 5.1SP1+ we now take into consideration where the EFI MBR resides and depending on OS(Operating System) we leave block 0-48 alone. We do this by using disk_offset parameter when we initialize a disk.
For HP-UX we use disk_offset=24, since HP-UX uses sector size of 1024k.
For Solaris, AIX and Linux we use disk_offset=48.
Example recovery procedure:
Lun aluadisk0_2 was initialized on VxVM 5.0. The LUN is 2TB in size.
# /etc/vx/bin/vxdisksetup -if aluadisk0_2 format=cdsdisk
# vxdisk list aluadisk0_2|egrep "private:|public:|format="
info: format=cdsdisk,privoffset=256,pubslice=3,privslice=3
public: slice=3 offset=65792 len=4194085936 disk_offset=0
private: slice=3 offset=256 len=65536 disk_offset=0
Note: The disk_offset is 0, due to this disk being initialized in VxVM 5.0
The LUN now resides on an HP-UX system running VxVM 5.1SP1
# uname -a
HP-UX sprsrx2660b6-22 B.11.31 U ia64 4120712239 unlimited-user license
# swlist -l product |grep vxvm
VRTSvxvm 5.1.100.000 Veritas Volume Manager by Veritas
# vxdisk -o alldgs list |grep datadg
aluadisk0_2 auto:cdsdisk 2tb-01 datadg online
# vxdg list datadg
Group: datadg
dgid: 1396041242.57.sprn18502a-23
import-id: 1024.89
flags: cds
version: 140
alignment: 8192 (bytes)
local-activation: read-write
ssb: on
autotagging: on
detach-policy: global
dg-fail-policy: dgdisable
copies: nconfig=default nlog=default
config: seqno=0.1030 permlen=25680 free=25678 templen=1 loglen=2048
config disk aluadisk0_2 copy 1 len=25680 state=clean online log disk aluadisk0_2 copy 1 len=2048
# vxprint -ht -g datadg
dg datadg default default 0 1396041242.57.sprn18502a-23
dm 2tb-01 aluadisk0_2 auto 32768 2097042968 -
v datavol - ENABLED ACTIVE 1572864000 SELECT - fsgen
pl datavol-01 datavol ENABLED ACTIVE 1572864000 CONCAT - RW
sd 2tb-01-01 datavol-01 2tb-01 0 1572864000 0 aluadisk0_2 ENA
# df -kln /datavol
/datavol (/dev/vx/dsk/datadg/datavol) : 1491410499 total allocated Kb
1221804433 free allocated Kb
269606066 used allocated Kb
19 % allocation used
# ls -li /datavol
total 494649674
220195 -rw-r----- 1 root sys 252079767552 Mar 28 15:23 bigfile
4 lrwxr-x--- 1 root sys 8 Mar 28 14:52 bin -> /usr/bin
5 dr-xr-xr-x 20 bin bin 5120 Mar 18 12:02 dev
1064 dr-xr-xr-x 46 bin bin 7168 Mar 28 10:58 etc
4287 drwxr-x--- 2 root sys 96 Sep 3 2013 evidence
4288 dr-xr-xr-x 6 bin bin 96 Aug 30 2013 home
4308 lrwxr-x--- 1 root sys 8 Mar 28 14:53 lib -> /usr/lib
3 drwxr-xr-x 2 root root 96 Aug 30 2013 lost+found
4309 drwxr-x--- 2 root sys 1024 Mar 28 11:11 miguel
4317 drwxr-x--- 2 root sys 96 Sep 3 2013 mnt
4318 dr-xr-xr-x 128 bin bin 3072 Mar 18 11:40 opt
105676 drwxr-x--- 2 root sys 96 Sep 3 2013 release
105677 drwxr-x--- 7 root sys 1024 Mar 28 03:26 root
116614 dr-xr-xr-x 16 bin bin 5120 Mar 18 11:41 sbin
117467 dr-xr-xr-x 8 bin bin 1024 Mar 18 12:02 stand
117882 drwxr-x--- 2 root sys 96 Oct 23 12:03 test
117883 drwxr-x--- 2 root sys 96 Sep 3 2013 test1
117884 drwxr-x--- 2 root sys 96 Sep 3 2013 test2
117885 drwxrwxrwt 11 root root 1024 Mar 28 14:55 tmp
117913 dr-xr-xr-x 22 bin bin 1024 Aug 30 2013 usr
159268 dr-xr-xr-x 35 bin bin 1024 Sep 3 2013 var
202371 drwxr-x--- 3 root sys 96 Oct 21 15:18 vcs
202373 drwxr-x--- 2 root sys 96 Mar 18 09:39 w
202374 -rwxr-x--- 1 root sys 1179650373 Mar 18 10:11 w15s
202375 drwxr-x--- 2 root sys 96 Mar 18 10:06 w51S
202376 drwxr-x--- 3 root sys 96 Mar 18 10:20 w51s
220194 drwxr-x--- 2 root sys 96 Mar 18 09:36 wc
Save VxVM volume label information. To be used to rebuild VxVM label later. We also keep a backup of this in /etc/vx/cbr/bk directory.
# vxprint -g datadg -mpvshr > /tmp/vxprint_mpvshr.out
Reproduction/recovery process:
Umount the file system:
# umount /datavol
Deport the diskgroup and invalidate the private region:
# vxdg deport datadg
Corrupt private region:
# dd if=/dev/zero of=/dev/vx/dmp/aluadisk0_2 bs=1 count=1
Attempt import:
# vxdisk -o alldgs list|grep datadg
aluadisk0_2 auto:cdsdisk - (datadg) online
# vxdg -Cf import datadg
VxVM vxdg ERROR V-5-1-10978 Disk group datadg: import failed:
No valid disk found containing disk group
Note: Per my previous instructions, since we have to rebuild the config copy and because our system where the Disk Group now resides is 5.1SP1 and due to the LUN size being 1TB+ we have to take into consideration offset 24 for LUN(s) greater than 1TB. Prior to re-initializing the LUN to recreate the private region.
OLD private|public information. This information can also be obtained from the "/etc/vx/cbr/bk" records.
vxdisk list aluadisk0_2|egrep "private:|public:"
public: slice=0 offset=32896 len=2097042968 disk_offset=0
private: slice=0 offset=128 len=32768 disk_offset=0
Subtracting 24 from the public offset value
32896-24=32872
We will use the above resulting value as the new puboffset to accommidate for the new disk_offset that VxVM will use.
/etc/vx/bin/vxdisksetup -if aluadisk0_2 privlen=32768 puboffset=32872 publen=2097042968
# vxdisk list aluadisk0_2| egrep "private:|public:"
public: slice=0 offset=32872 len=2097042968 disk_offset=24
private: slice=0 offset=104 len=32768 disk_offset=24
Rebuild the Disk Group datadg:
# vxdg init datadg 2tb-01=aluadisk0_2
Now replay VxVM volume label:
# vxmake -g datadg -d /tmp/vxprint_mpvshr.out
Now start the volume:
# vxvol -g datadg -f start datavol
# vxprint -ht -g datadg
dg datadg default default 0 1396044571.41.sprsx2660b6-20
dm 2tb-01 aluadisk0_2 auto 32768 2097042968 -
v datavol - ENABLED ACTIVE 1572864000 SELECT - fsgen
pl datavol-01 datavol ENABLED ACTIVE 1572864000 CONCAT - RW
sd 2tb-01-01 datavol-01 2tb-01 0 1572864000 0 aluadisk0_2 ENA
# mount -F vxfs /dev/vx/dsk/datadg/datavol /datavol
# df -kln /datavol
/datavol (/dev/vx/dsk/datadg/datavol) : 1491480963 total allocated Kb
1220747473 free allocated Kb
270733490 used allocated Kb
19 % allocation used
# ls -li /datavol
total 501696842
220195 -rw-r----- 1 root sys 255688966144 Mar 28 14:24 bigfile
4 lrwxr-x--- 1 root sys 8 Mar 28 13:52 bin -> /usr/bin
5 dr-xr-xr-x 20 bin bin 5120 Mar 18 11:02 dev
1064 dr-xr-xr-x 46 bin bin 7168 Mar 28 09:58 etc
4287 drwxr-x--- 2 root sys 96 Sep 3 2013 evidence
4288 dr-xr-xr-x 6 bin bin 96 Aug 30 2013 home
4308 lrwxr-x--- 1 root sys 8 Mar 28 13:53 lib -> /usr/lib
3 drwxr-xr-x 2 root root 96 Aug 30 2013 lost+found
4309 drwxr-x--- 2 root sys 1024 Mar 28 10:11 miguel
4317 drwxr-x--- 2 root sys 96 Sep 3 2013 mnt
4318 dr-xr-xr-x 128 bin bin 3072 Mar 18 10:40 opt
105676 drwxr-x--- 2 root sys 96 Sep 3 2013 release
105677 drwxr-x--- 7 root sys 1024 Mar 28 02:26 root
116614 dr-xr-xr-x 16 bin bin 5120 Mar 18 10:41 sbin
117467 dr-xr-xr-x 8 bin bin 1024 Mar 18 11:02 stand
117882 drwxr-x--- 2 root sys 96 Oct 23 11:03 test
117883 drwxr-x--- 2 root sys 96 Sep 3 2013 test1
117884 drwxr-x--- 2 root sys 96 Sep 3 2013 test2
117885 drwxrwxrwt 11 root root 1024 Mar 28 13:55 tmp
117913 dr-xr-xr-x 22 bin bin 1024 Aug 30 2013 usr
159268 dr-xr-xr-x 35 bin bin 1024 Sep 3 2013 var
202371 drwxr-x--- 3 root sys 96 Oct 21 14:18 vcs
202373 drwxr-x--- 2 root sys 96 Mar 18 08:39 w
202374 -rwxr-x--- 1 root sys 1179650373 Mar 18 09:11 w15s
202375 drwxr-x--- 2 root sys 96 Mar 18 09:06 w51S
202376 drwxr-x--- 3 root sys 96 Mar 18 09:20 w51s
220194 drwxr-x--- 2 root sys 96 Mar 18 08:36 wc
Veritas recommends making backups of critical data. Consult Veritas technical support prior to initializing any disk that is to be recovered.
Applies To
HPUX 11.31
VxVM 5.1SP1+
1TB + LUN.
LUN(s) were initialized in 5.0 environment and VxVM used the default disk_offset of 0.
Private region is corrupted and needs to be rebuilt on 5.1SP1+ version of VxVM.