Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3199009
  • 博文数量: 443
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 5679
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-08 12:30
个人简介

欢迎加入IT云增值在线QQ交流群:342584734

文章分类

全部博文(443)

文章存档

2022年(1)

2021年(1)

2015年(2)

2014年(1)

2013年(1)

2012年(4)

2011年(19)

2010年(32)

2009年(2)

2008年(4)

2007年(31)

2006年(301)

2005年(42)

2004年(2)

分类: 系统运维

2011-01-06 09:55:35

How to Repair the Private Region When "vxdisk list" Shows "online altused"
 
This document applies to Sun Enterprise Volume Manager[TM] 2.x and Veritas Volume Manager (VxVM) 3.x.
 

There are several scenarios where a disk under the control of volume manager software control can get into an "online altused" state. Volume manager software stores the configuration of the individual disk in the private region in two places for redundancy. If one of these "configuration copies" gets corrupted because of a bad block on the disk, the disk will be marked as "online altused" to notify the administrator that one of the copies is disabled. Online altused can also be generated after moving an A3x00 array from one host to another. The private regions are not corrupted but have sequence numbers out of sync. In either case, the following symptoms will occur:

# vxdisk list
DEVICE TYPE DISK GROUP STATUS c0t8d0s2 sliced rootdisk rootdg online c0t9d0s2 sliced disk02 rootdg online c1t0d0s2 sliced disk01 rootdg online c2t4d1s2 sliced - - online altused c2t5d0s2 sliced - - online altused

When attempting to import the disk group the following error is produced:

# vxdg -C import datadg
vxvm:vxconfigd:ERROR error in disk group configuration copies. No valid disk found containing disk group.

 

To fix the private region, you can perform the following procedure. Sometimes, this procedure does not work because of an actual hardware problem on the physical disk. If dd'ing to the private region produces errors, or does not change the disk to an online state, it might need to be replaced.

1) From a terminal window enter the following:

# vxdisk list

The following is an excerpt from the vxdisk list:

  DEVICE       TYPE      DISK         GROUP        STATUS
  c0t8d0s2     sliced    rootdisk     rootdg       online
  c0t9d0s2     sliced    disk02       rootdg       online
  c1t0d0s2     sliced    disk01       rootdg       online
  c2t4d1s2     sliced    -            -            online altused
  c2t5d0s2     sliced    -            -            online altused

2) Perform the following steps:

a) Determine which slice is being used for the private region:

     # prtvtoc /dev/rdsk/cXtXdXs2

  b) Use the vxdisk list to determine which bad disk to review, that is:

     # prtvtoc /dev/rdsk/c2t4d1s2

     Output appears that is similar to the following example:

     * /dev/rdsk/c2t4d1s2 partition map
     *
     * Dimensions:
     *     512 bytes/sector
     *      16 sectors/track
     *       2 tracks/cylinder
     *      32 sectors/cylinder
     *      63 cylinders
     *      61 accessible cylinders
     *
     * Flags:
     *   1: unmountable
     *  10: read-only
     *
     *                          First     Sector    Last
     * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
            2      5    01          0    8907450    8907449
            3      15   01          0      1290      1289
            4      14   01       1290     8906160   8907449

  c) In the Tag column in the example output, find the line for Tag 15 (the tag
     for the private region) and note the partition that corresponds to it.  In
     the example output, the private region is on partition 3.  Record the
     partition number for the disk for use in future steps.

3) Repeat step 2 for each corrupted disk.

4) dd each disk's private region to a file (naming the file accordingly so that
you can easily refer back to that file):

In the following, c2t4d1s2 is used as an example disk and c2t4d1s2_privreg as the filename. Replace these labels with the actual labels for the disk and and the correct private region slice that you are attempting to repair. The filename can be anything that will help you remember the file:

  # dd if=/dev/rdsk/c2t4d1s3 of=/tmp/c2t4d1s3_privreg

5) Run the following script on the file you created in step 4. (If you save the
script as fixaltused.sh, you would run the script on the file shown in step 4
by entering fixaltused.sh c2t4d1s3_privreg.)
------------------------------------------------------------------
#!/bin/ksh
#
# This is a script to repair a private region which has been corrupted and
# is showing up as "online altused" in the vxdisk list, but errors in a
# vxprivutil list type operation. $1 should be the path to the dd image
# of the private region.
#
cp $1 $1.good
tid=`od -c $1 | grep 2020 | awk '{print $5}'`
echo "$tid" | dd of=$1.good oseek=127507 bs=1 count=1
dd if=$1 iseek=127508 bs=1 >> $1.good
/etc/vx/diag.d/vxprivutil list ./$1.good
------------------------------------------------------------------
After you run the script, an output that is similar to the following should
appear. You can also get this output by entering "/etc/vx/diag.d/vxprivutil
list c2t4d1s3_privreg.good" from the command line after the script has been
run. The preceding script creates the c2t4d1s3_privreg.good file.

diskid: 86251073.30247.cradev group: name=ora_dg id=881621654.31353.cradev flags: private autoimport ... ...... logs: count=1 len=167 tocblks: 0 tocs: 2/1533 Defined regions: config priv 000017-000247[000231]: copy=01 offset=000000 enabled config priv 000249-001119[000871]: copy=01 offset=000231 enabled log priv 001120-001286[000167]: copy=01 offset=000000 enabled

  Note: Look for the line marked "flags."  An altused flag set should not
  appear.  If the output is not good, you might also get an error message that
  is similar to the following:

  vxvm:vxprivutil: ERROR: join operation failed:
  Format error in disk private region

6) If the output from the script looks good, dd data from the good file back to
the corresponding disk's private region:

# dd if=/tmp/c2t4d1s3_privreg.good of=/dev/rdsk/c2t4d1s3

7) Repeat steps 4 through 6 for each bad disk.

8) Do a "vxdctl enable" and then verify success:

# vxdctl enable

# vxdisk list

  DEVICE       TYPE      DISK         GROUP        STATUS
  c0t8d0s2     sliced    rootdisk     rootdg       online
  c0t9d0s2     sliced    disk02       rootdg       online
  c1t0d0s2     sliced    disk01       rootdg       online
  c2t4d1s2     sliced    data01       datadg       online
  c2t5d0s2     sliced    data02       datadg       online

阅读(3481) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~