在做vxsnap addmir时报错如下:
#> vxsnap -g OLS_DATA_DG -b addmir OLS_DATA_ACC_P mirvol=OLS_DATA_ACC_SM1
VxVM vxsnap ERROR V-5-1-0 Volume OLS_DATA_ACC_SM1 in DG OLS_DATA_DG cannot be linked to volume OLS_DATA_ACC_P in DG OLS_DATA_DG due to size/regionsize incompatibilityVxVM vxsnap ERROR V-5-1-12745 Unable to create mirror relationship between volume OLS_DATA_ACC_P (dg OLS_DATA_DG) and volume OLS_DATA_ACC_SM1 (dg OLS_DATA_DG)
报错里提示原卷和镜像卷的regionsize不匹配。先来看一下regionsize的作用:
The value of the regionsize attribute specifies the size of the tracked regions in the volume. A write to a region is tracked by setting a bit in the change map. The default value is 64k (64KB).A smaller value requires more disk space for the change maps, but the finer granularity provides faster resynchronization.
regionsize主要是用于增量同步的。VXVM按照regionsize值把一个卷划分为很多个region,然后用DCO change map的1个bit代表一个region. 当一个region的数据发生改变后,change map中的对应bit就设置为1。因此通过chang map就可以知道哪些region的数据发生了变化。在快照刷新时,只需要把对应region中的数据同步到快照卷中即可,这样就实现了快照的增量刷新。
创建快照时,镜像卷需要与原卷的regionsize保持一致。本例中的报错就是由于regionsize不一致造成的。
解决方法如下:
- 先删除镜像卷的DCO
#> vxsnap -g OLS_DATA_DG unprepare OLS_DATA_ACC_SM1
- 查询原卷regionsize大小
#> vxprint -g OLS_DATA_DG -F%dco_name OLS_DATA_ACC_P
OLS_DATA_ACC_P_dco
查询原卷DCO名称
#> vxprint -g OLS_DATA_DG -F%regionsz OLS_DATA_ACC_P_dco
32
查询原卷regionsize大小,此处单位是block (1个block = 512 bytes)
- 重建镜像卷的DCO, 使regionsize与原卷一致
#> vxsnap -g OLS_DATA_DG prepare OLS_DATA_ACC_SM1 regionsize=32
- vxsnap addmir
#> vxsnap -g OLS_DATA_DG -b addmir OLS_DATA_ACC_P mirvol=OLS_DATA_ACC_SM1