Disk Repairs

How to repair a disk’s private region when vxdisk list shows “online altused”

# vxdisk list

Below is a partial listing from vxdisk list.

DEVICE       TYPE      DISK         GROUP        STATUS
c0t10d0s2    sliced    disk01       rootdg       online
c2t4d1s2     sliced    –            –            online altused
c2t4d2s2     sliced    –            –            offline
c2t4d3s2     sliced    –            –            online altused
c2t4d4s2     sliced    –            –            offline
c2t4d5s2     sliced    –            –            online altused
c3t5d0s2     sliced    –            –            online altused

2) Determine which slice is being used for the private region by doing the following:

# prtvtoc /dev/rdsk/cXtXdXs2

(Use the vxdisk list to determine which bad disk to look at, ie: prtvtoc /dev/rdsk/c2t4d1s2). The result will be output similar to the following:

* /dev/rdsk/c2t4d1s2 partition map
*
* Dimensions:
*     512 bytes/sector
*     258 sectors/track
*       5 tracks/cylinder
*    1290 sectors/cylinder
*    6907 cylinders
*    6905 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

Find the line for Tag 15 (this is the tag for the private region) and note the Partition that corresponds to it.  Record this partition number for this disk for use in future steps.

3) Repeat step 2 for each corrupted disk.

4) dd each disk’s private region to a file (please name the file accordingly so that it can easily be referred to) by performing the following;

In this example c1t15d0s2 will be used as the example disk and c1t15d0s3_privreg as the filename. They will need to be replaced with the disk and correct private region slice that are to be repaired.The filename can be anything that is easy to remember

# dd if=/dev/rdsk/c1t15d0s3 of=/tmp/c1t15d0s3_privreg

5) Run the following script on the file created in step 4. (If the script is saved as fixaltused.sh, then the script would be run on the file shown in step 4 by entering –  fixaltused.sh c1t15d0s3_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 barfs 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 running the script, an output similar to the example below should be seen. (This output could also result by typing  “/etc/vx/diag.d/vxprivutil list c1t15d0s3_privreg.good” from the command line after the script has been run,c1t15d0s3_privreg.good is the file that is created by the above script.)
diskid: 862510173.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, there should not be an altused flag set. If the output is not good, an error message similar to the error shown below may also appear:

vxvm:vxprivutil: ERROR: join operation failed:
Format error in disk private region
6) If the output from the script looks good, then dd data from the good file back to the corresponding disk’s private region. This is accomplished by doing the following:

In this example c1t15d0s2 will be used as the example disk, the private region is on slice3 (c1t15d0s3). The name of the file on which the script was run is /tmp/t15s3repair.

# dd if=/tmp/c1t15d0s3_privreg.good of=/dev/rdsk/c1t15d0s3

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