VXVM配置信息简要说明 |
|
作者: 发表于:2008-11-16 22:25:23 |
【】【】【】【】 |
首先,先来介绍一下vxvm的磁盘头信息。
veritas 磁盘头信息
当磁盘被Veritas Volume Manager 初始化或者封装的时候,磁盘头信息会被写到磁盘的私有分区上。磁盘头包含了磁盘的唯一标示ID,磁盘组标示代表了磁盘组是由那些设备组
成,设置flag标志位表示设备状态和设备用于什么(比如:hot spare), hostid 代表了挂接磁盘的主机的主机名。磁盘头信息的显示输出通过vxdisk(1m)'s "list" 来实现:
$ vxdisk list c1t1d0 Device: c1t1d0s2 devicetag: c1t1d0 type: auto hostid: pooh disk: name=c1t1d0 id=1123602295.10.pooh group: name=oradg id=1123603158.13.pooh info: format=cdsdisk,privoffset=256,pubslice=2,privslice=2 flags: online ready private autoconfig autoimport imported pubpaths: block=/dev/vx/dmp/c1t1d0s2 char=/dev/vx/rdmp/c1t1d0s2 version: 3.1 iosize: min=512 (bytes) max=2048 (blocks) public: slice=2 offset=2304 len=35365968 disk_offset=0 private: slice=2 offset=256 len=2048 disk_offset=0 update: time=1123603160 seqno=0.6 ssb: actual_seqno=0.0 headers: 0 240 configs: count=1 len=1280 logs: count=1 len=192 Defined regions: config priv 000048-000239[000192]: copy=01 offset=000000 enabled config priv 000256-001343[001088]: copy=01 offset=000192 enabled log priv 001344-001535[000192]: copy=01 offset=000000 enabled lockrgn priv 001536-001679[000144]: part=00 offset=000000 Multipathing information: numpaths: 1 c1t1d0s2 state=enabled
期间关键的配置信息存储在磁盘头内,定期进行这些信息的备份是很重要的。
下面介绍一下配置库。
veritas 配置库
当新的设备通过 (比如., subdisks, plexes, volumes) aVeritas CLI或者 GUI来创建。 Veritas会将这些设备的配置信息写入到配置库中。配置库存放在几个磁盘的私有分区
中在磁盘组中这样可以达到冗余的效果。显示配置库的冗余信息通过vxdg(1m) 中的 "list"选项: $ vxdg list oradg | egrep "config disk.*clean online" config disk c1t1d0s2 copy 1 len=1280 state=clean online config disk c1t2d0s2 copy 1 len=1280 state=clean online config disk c1t3d0s2 copy 1 len=1280 state=clean online config disk c1t4d0s2 copy 1 len=1280 state=clean online config disk c1t5d0s2 copy 1 len=1280 state=clean online
显示配置库中的内容通过vxprint(1m)来实现. 下面的例子通过使用 vxprint(1m) "-h" (显示层次信息)和 "-t" (为任何记录类型显示单行格式) 选项来显示配置库的头信息和描述记
录: $ vxprint -ht 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 oradg default default 46000 1123603158.13.pooh
dm c1t1d0 c1t1d0s2 auto 2048 35365968 - dm c1t2d0 c1t2d0s2 auto 2048 35521408 - dm c1t3d0 c1t3d0s2 auto 2048 35521408 - dm c1t4d0 c1t4d0s2 auto 2048 35521408 - dm c1t5d0 c1t5d0s2 auto 2048 35365968 - dm c1t6d0 c1t6d0s2 auto 2048 35521408 -
v oravol01 - ENABLED ACTIVE 41943040 SELECT oravol01-03 fsgen pl oravol01-03 oravol01 ENABLED ACTIVE 41943168 STRIPE 3/128 RW sv oravol01-S01 oravol01-03 oravol01-L01 1 13981056 0/0 2/2 ENA sv oravol01-S02 oravol01-03 oravol01-L02 1 13981056 1/0 2/2 ENA sv oravol01-S03 oravol01-03 oravol01-L03 1 13981056 2/0 2/2 ENA
v oravol01-L01 - ENABLED ACTIVE 13981056 SELECT - fsgen pl oravol01-P01 oravol01-L01 ENABLED ACTIVE 13981056 CONCAT - RW sd c1t1d0-02 oravol01-P01 c1t1d0 0 13981056 0 c1t1d0 ENA pl oravol01-P02 oravol01-L01 ENABLED ACTIVE 13981056 CONCAT - RW sd c1t4d0-02 oravol01-P02 c1t4d0 0 13981056 0 c1t4d0 ENA
v oravol01-L02 - ENABLED ACTIVE 13981056 SELECT - fsgen pl oravol01-P03 oravol01-L02 ENABLED ACTIVE 13981056 CONCAT - RW sd c1t2d0-02 oravol01-P03 c1t2d0 0 13981056 0 c1t2d0 ENA pl oravol01-P04 oravol01-L02 ENABLED ACTIVE 13981056 CONCAT - RW sd c1t5d0-02 oravol01-P04 c1t5d0 0 13981056 0 c1t5d0 ENA
v oravol01-L03 - ENABLED ACTIVE 13981056 SELECT - fsgen pl oravol01-P05 oravol01-L03 ENABLED ACTIVE 13981056 CONCAT - RW sd c1t3d0-02 oravol01-P05 c1t3d0 0 13981056 0 c1t3d0 ENA pl oravol01-P06 oravol01-L03 ENABLED ACTIVE 13981056 CONCAT - RW sd c1t6d0-02 oravol01-P06 c1t6d0 0 13981056 0 c1t6d0 ENA
设备类型(比如., subdisks, disk groups, plexes, volumes, 等等.), 块的偏移量,设备名和位置对于理解Veritas Volume Manager 布局和当出现故障的时候重新组合配置布
局是很有帮助的。对于进行配置库的备份是很重要的。下面我们来看一下配置库的备份。
配置库备份
vxconfigbackupd(1m) 进程在Veritas Volume Manager 4.X提供一种自动方式进行磁盘头和配置库的备份。Vxconfigbackupd(1m)在系统启动的时候自动执行的并且进行配
置库和磁盘头的活动监控。当vxconfigbackupd(1m) 检测到配置发生改变,则vxconfigbackupd(1m)将配置写入到文件/etc/vx/cbr/bk/. directory. ("" 标示磁盘组 "" 标示磁
盘组ID.) vxconfigbackupd(1m) man page 提供了关于 /etc/vx/cbr/bk/. Directory的描述: /etc/vx/cbr/bk/./.diskinfo Location of backup file for disk attributes.
/etc/vx/cbr/bk/./.binconfig Location of backup file for binary configuration copy.
/etc/vx/cbr/bk/./.cfgrec Location of backup file for configuration records in vxprint -m format.
自动的备份是通过vxconfigbackupd(1m)来完成的, 手工备份是通过执行vxconfigbackup(1m)来完成的。此外还提供一些选项来完成用户提出的需求。下面的例子使用 vxconfi
gbackup(1m) "-l" (定位存储备份) 来备份/etc/dgbackups: $ /usr/lib/vxvm/bin/vxconfigbackup -l /etc/dgbackups Start backing up diskgroup oradg to \ /etc/dgbackups/oradg.1127240283.19.winnie ... VxVM NOTICE V-5-2-3100 Backup complete for diskgroup: oradg
如果你使用的是Veritas Volume Manager 4.X以前的版本, 你并不能够使用vxconfigbackupd(1m) 和 vxconfigbackup(1m) 命令来管理备份。不过不用担心,使用 vxmake
(1m)'s "-d" 可以重新建立配置文件。
配置数据恢复
当配置信息丢失,配置信息可以通过(前提是必须知道有通过xconfigbackup(1m)来建立的备份配置信息) vxconfigrestore(1m)来恢复. 下面的列子显示如果恢复磁盘组oradg
通过使用已有的备份在/etc/dgbackups目录下: $ /usr/lib/vxvm/bin/vxconfigrestore -l /etc/dgbackups oradg Diskgroup oradg configuration restoration started ......
Installing volume manager disk header for c1t1d0s2 ... Installing volume manager disk header for c1t2d0s2 ... Installing volume manager disk header for c1t3d0s2 ... Installing volume manager disk header for c1t4d0s2 ... Installing volume manager disk header for c1t5d0s2 ... Installing volume manager disk header for c1t6d0s2 ... - oradg's diskgroup configuration is restored (in a precommitted state). Diskgroup can be accessed in read only and can be examined using vxprint(1m) in this state.
Run: vxconfigrestore -l /etc/dgbackups/ -c oradg ==> to commit the restoration. vxconfigrestore -l /etc/dgbackups/ -d oradg ==> to abort the restoration.
当vxconfigrestore(1m)被引入, 配置进入短暂的定位阶段,允许管理员通过, vxprint(1m) 进行配置有效性确认。如果,配置信息可见,则通过xconfigrestore(1m) "-c" (提交)
选项进行磁盘头和配置库的配置信息提交。
$ /usr/lib/vxvm/bin/vxconfigrestore -l /etc/dgbackups/ -c oradg Committing configuration restoration for diskgroup oradg ....
oradg's diskgroup configuration restoration is committed.
一旦配置信息恢复,则卷就可以正常运行,并且卷上的文件系统可以进行mount.
| |
阅读(1654) | 评论(0) | 转发(1) |