Reinitializing a disk while preserving existing data

Article:TECH202416  |  Created: 2013-02-04  |  Updated: 2014-02-03  |  Article URL http://www.symantec.com/docs/TECH202416
Article Type
Technical Solution


Issue



To reinitialize a disk, while preserving the existing data, first determine the offset and length of the public region. Then, reinitialize the disk using vxdisksetup. Specifying the public region offset and length allows Veritas to preserve the existing data while allowing flexibility for changes to the private region.


Solution



 

This article is a part of a set on troubleshooting failed, or failing, disks. Click here to start at the beginning: http://www.symantec.com/docs/TECH200618

 



Table of Contents

Introduction
1. Determine the disk format
2. Find the public region offset and length
3. Reinitialize the disk using vxdisksetup




Introduction
(Back to top)

Finding the offset and length of the public region can be done with vxdisk, or by examining the "diskinfo" file in a vxconfigbackup. By default, the vxconfigbackup files are stored under /etc/vx/cbr/bk. The location may be different if a manual backup was performed using the "-l" argument.


Note: In most cases, using vxconfigrestore to recover a disk group is preferable to manually reinitializing disks. This procedure assumes that using vxconfigrestore is not possible, or that this is a special situation where manually reinitializing disks is necessary.

More details about vxconfigrestore, including syntax and examples, can be found in this article:

"Restoring the disk group configuration using vxconfigrestore"
http://www.symantec.com/docs/TECH201366





1. Determine the disk format
(Back to top)

From the vxdisk output, find the "info: format" property (Figure 1). Notice the value after the "format=" property.

Figure 1 - Vxdisk output with "info: format" emphasized

Syntax:

Run vxdisk list <disk>


Example, with typical output:

# vxdisk list disk_4

Device:    disk_4
devicetag: disk_4
type:      auto
hostid:
disk:      name= id=1359487098.25.Server101
group:     name= id=
info:      format=cdsdisk,privoffset=256,pubslice=3,privslice=3
flags:     online ready private autoconfig autoimport
pubpaths:  block=/dev/vx/dmp/disk_4s3 char=/dev/vx/rdmp/disk_4s3
guid:      {a2ee7828-6a48-11e2-b602-87801200fb9f}
udid:      MSFT%5FVirtual%20HD%5FDISKS%5F60003FF447A746E3A7B206863B3B89A8
site:      -
version:   3.1
iosize:    min=512 (bytes) max=1024 (blocks)
public:    slice=3 offset=8192 len=2027264 disk_offset=0
private:   slice=3 offset=256 len=5888 disk_offset=0
update:    time=1359487099 seqno=0.2
ssb:       actual_seqno=0.0
headers:   0 240
configs:   count=1 len=4112
logs:      count=1 len=624
Defined regions:
 config   priv 000048-000239[000192]: copy=01 offset=000000 disabled
 config   priv 000256-004175[003920]: copy=01 offset=000192 disabled
 log      priv 004176-004799[000624]: copy=01 offset=000000 disabled
 lockrgn  priv 004800-004943[000144]: part=00 offset=000000
Multipathing information:
numpaths:   2
sdp             state=enabled
sdf             state=enabled

 




2. Find the public region offset and length

(Back to top)

If the disk format is "cdsdisk" or "simple," then take note of the following values in the vxdisk output (Figure 2):

  • public: len
  • public: offset


If the disk format is "sliced," then take note of the following values in the vxdisk output (Figure 3):

  • public: len
  • public: disk_offset

 


Note: Do not confuse "disk_offset" with "offset." Also, notice that for CDS and simple disks, the "disk_offset" attributes are zero, while for sliced disks this value of "disk_offset" is a non-zero value.


Specifying the public region offset and length allows Veritas to preserve the user data while allowing flexibility for changes to the private region. This is important in situations when a disk that contains an older, and smaller, private region is reinitialized by a newer version of Veritas. When the disk is reinitialized, the size of the private region may change. As long as the public region offset and length are specified, it will not overwrite, or change, the public region.


Figure 2 - Attributes to gather for CDS and simple disks

Syntax:

Run vxdisk list <disk>


Example, with typical output:

# vxdisk list disk_4

Device:    disk_4
devicetag: disk_4
type:      auto
hostid:
disk:      name= id=1359487098.25.Server101
group:     name= id=
info:      format=cdsdisk,privoffset=256,pubslice=3,privslice=3
flags:     online ready private autoconfig autoimport
pubpaths:  block=/dev/vx/dmp/disk_4s3 char=/dev/vx/rdmp/disk_4s3
guid:      {a2ee7828-6a48-11e2-b602-87801200fb9f}
udid:      MSFT%5FVirtual%20HD%5FDISKS%5F60003FF447A746E3A7B206863B3B89A8
site:      -
version:   3.1
iosize:    min=512 (bytes) max=1024 (blocks)
public:    slice=3 offset=8192 len=2027264 disk_offset=0
private:   slice=3 offset=256 len=5888 disk_offset=0
update:    time=1359487099 seqno=0.2
ssb:       actual_seqno=0.0
headers:   0 240
configs:   count=1 len=4112
logs:      count=1 len=624
Defined regions:
 config   priv 000048-000239[000192]: copy=01 offset=000000 disabled
 config   priv 000256-004175[003920]: copy=01 offset=000192 disabled
 log      priv 004176-004799[000624]: copy=01 offset=000000 disabled
 lockrgn  priv 004800-004943[000144]: part=00 offset=000000
Multipathing information:
numpaths:   2
sdp             state=enabled
sdf             state=enabled


 

 


Figure 3 - Attributes to gather for sliced disks


Syntax:

Run vxdisk list <disk>


Example, with typical output:

# vxdisk list disk_4

Device: disk_4s2
devicetag: disk_4
type: auto
hostid:
disk: name= id=1260548770.83.server1
group: name=cmwork2dg id=1260553141.58.server1
info: format=sliced,privoffset=1,pubslice=4,privslice=3
flags: online ready private autoconfig
pubpaths: block=/dev/vx/dmp/disk_4s4 char=/dev/vx/rdmp/disk_4s4
privpaths: block=/dev/vx/dmp/disk_4s3 char=/dev/vx/rdmp/disk_4s3
version: 2.1
iosize: min=512 (bytes) max=2048 (blocks)
public: slice=4 offset=0 len=39833600 disk_offset=8192
private: slice=3 offset=1 len=5887 disk_offset=2048
update: time=1280294897 seqno=0.151
ssb: actual_seqno=0.0
headers: 0 248
configs: count=1 len=4315
logs: count=1 len=653
Defined regions:
config priv 000017-000247[000231]: copy=01 offset=000000 enabled
config priv 000249-004332[004084]: copy=01 offset=000231 enabled
log priv 004333-004985[000653]: copy=01 offset=000000 enabled
Multipathing information:
numpaths: 4
disk_4s2 state=enabled type=secondary
c3t50050768011063BDd3s2 state=enabled type=primary
c4t50050768014063BDd3s2 state=enabled type=primary
c4t500507680140646Cd3s2 state=enabled type=secondary


 




3. Reinitialize the disk using vxdisksetup

(Back to top)

Once the public region offset and length have been determined, use vxdisksetup to reinitialize the disk. This reinitialization process recreates the private region on the disk, but it does not affect the user data that resides within the public region. This allows the disk to be added back into the disk group.


Figure 4 - Using vxdisksetup to reinitialize a disk


Syntax:

vxdisksetup -i <device> puboffset=<value> publen=<value> format=<format_type>


Note: For "puboffset," use the value for either "offset" or "disk_offset" (depending on the disk format) as discussed in Step 2.

The "format" argument is optional. If it is omitted, vxdisksetup assumes CDS.



Example, with typical output:

# vxdisksetup -i disk_4 puboffset=8192 publen=39833600


WARNING:  Use great care when running this command. Specifying incorrect values may result in data loss.


After reinitializing the disk, vxdisk now shows that the disk is online.

# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:cdsdisk    -            (vxfendg)    online
disk_1       auto:cdsdisk    -            (vxfendg)    online
disk_2       auto:cdsdisk    -            (vxfendg)    online
disk_3       auto:cdsdisk    datadg01     datadg       online
disk_4       auto:cdsdisk    -            -            online
disk_5       auto:cdsdisk    datadg03     datadg       online
disk_6       auto:cdsdisk    datadg04     datadg       online
disk_7       auto:cdsdisk    -            (sambadg)    online
disk_8       auto:cdsdisk    -            -            online
disk_9       auto:cdsdisk    -            -            online
sda          auto:none       -            -            online invalid
-            -         datadg02     datadg       failed was:disk_4

 

 

 




Article URL http://www.symantec.com/docs/TECH202416


Terms of use for this information are found in Legal Notices