AIX逻辑卷的LVCB
LVCB(逻辑卷控制块):logical volume control block,保存着逻辑卷的重要信息,在mklv时使用-T O选项可以指定其是否存放于LV的头部:
-T O
For big vg format volume groups, the -T O option indicates that the logical volume control block will not occupy the
first block of the logical volume. Therefore, the space is available for application data. Applications can identify
this type of logical volume with the IOC INFO ioctl. The logical volume has a device subtype of DS_LVZ. A logical
volume created without this option has a device subtype of DS_LV. This option is ignored for old and scalable vg
format volume groups.
加了-T O选项,也就是LVCB不会占用LV的第一个块,DD时也就不需要skip了,此时的LVCB存放于VGDA(卷组描述区)中。
在创建LV时,如果没有使用-T O选项,lslv时也就没有DEVICESUBTYPE这一项:
/dev#lslv ocs_spfile LOGICAL VOLUME: ocs_spfile VOLUME GROUP: vgocstest LV IDENTIFIER: 00023cf70000d6000000011fd4df8ad5.13 PERMISSION: read/write VG STATE: active/complete LV STATE: closed/syncd TYPE: raw WRITE VERIFY: off MAX LPs: 512 PP SIZE: 128 megabyte(s) COPIES: 1 SCHED POLICY: striped LPs: 6 PPs: 6 STALE PPs: 0 BB POLICY: relocatable INTER-POLICY: maximum RELOCATABLE: no INTRA-POLICY: middle UPPER BOUND: 3 MOUNT POINT: N/A LABEL: None MIRROR WRITE CONSISTENCY: on/ACTIVE EACH LP COPY ON A SEPARATE PV ?: yes (superstrict) Serialize IO ?: NO STRIPE WIDTH: 3 STRIPE SIZE: 128K
使用-T O选项创建的LV,lslv时就可以找到DEVICESUBTYPE这一项:
/dev#mklv -T O -y'ocs_tbs_test01' -t'raw' '-S128K' vgocstest 4 vpath1 vpath2 ocs_tbs_test01 /dev# /dev#lslv ocs_tbs_test01 LOGICAL VOLUME: ocs_tbs_test01 VOLUME GROUP: vgocstest LV IDENTIFIER: 00023cf70000d6000000011fd4df8ad5.25 PERMISSION: read/write VG STATE: active/complete LV STATE: closed/syncd TYPE: raw WRITE VERIFY: off MAX LPs: 512 PP SIZE: 128 megabyte(s) COPIES: 1 SCHED POLICY: striped LPs: 6 PPs: 6 STALE PPs: 0 BB POLICY: relocatable INTER-POLICY: maximum RELOCATABLE: no INTRA-POLICY: middle UPPER BOUND: 3 MOUNT POINT: N/A LABEL: None MIRROR WRITE CONSISTENCY: on/ACTIVE EACH LP COPY ON A SEPARATE PV ?: yes (superstrict) Serialize IO ?: NO STRIPE WIDTH: 3 STRIPE SIZE: 128K DEVICESUBTYPE : DS_LVZ
如果LVCB没有损坏,使用以下命令来查看,就可以看到“AIX LVCB”字样:
/dev#od -c /dev/ocs_tbs_test01 | head 0000000 A I X L V C B \0 \0 r a w \0 \0 \0 0000020 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000040 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0 0 0 2 3 c 0000060 f 7 0 0 0 0 d 6 0 0 0 0 0 0 0 1 0000100 1 f \0 o c s _ t b s _ t e s t 0 0000120 1 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000140 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 * 0000200 \0 \0 \0 M o n A p r 2 0 1 4 0000220 : 5 3 : 2 8 2 0 0 9 \n \0 \0 \0 \0
或者:
/dev#getlvcb -TA ocs_tbs_test01 AIX LVCB intrapolicy = m copies = 1 interpolicy = x lvid = 00023cf70000d6000000011fd4df8ad5.25 lvname = ocs_tbs_test01 label = None machine id = 23CF7D600 number lps = 6 relocatable = n strict = s stripe width = 3 stripe size in exponent = 17 type = raw upperbound = 3 fs = time created = Mon Apr 20 14:53:28 2009 time modified = Mon Apr 20 14:53:28 2009
今天从徐大哥这里了解到一个IBM的BUG,有可能导致DS_LVZ类开型的LV的LVCB信息丢失,从而导致数据库无法启动,在这里MARK一下:
/dev$instfix -a -k IY94343 IY94343 Abstract: MKLV -TO ON BIG VOLUME GROUPS FAILS TO PUT SOME LV INFORMAT IY94343 Symptom Text: The lslv command will fail to show the DEVICESUBTYPE : DS_LVZ entry for LVs created as DS_LVZ. Some applications depending on the subtype, like Oracle, may fail to start.
记得还有一次,SA使用IBM TDMF(Softek Transparent Data Migration Facility)进行数据迁移时,失败好几次,最终发现:老存储用的LV是DS_LV,而新存储使用的LV是DS_LVZ,迁移过去后,数据库无法启动了,这也就是文中开头提到的LVCB存储位置不同引起的。而使用RMAN进行迁移,则不受这一限制。
— The End —


站内搜索