Considerations when using vxdisksetup while performing a disk-group rebuild

book

Article ID: 100013151

calendar_today

Updated On:

Resolution

Prior to VERITAS Volume Manager (VxVM) 3.2,  when you ran  vxdisksetup to re-initializethe disk for disk-group rebuild recovery,  the main consideration
was to make sure the private region length was the same as the original size the disk was initialized on.

VxVM 3.2 and future releases now reserve an extra cylinder for Common Data Storage (CDS) and, taking this into consideration,rebuilding disk groups and recovering VxVM volumes results in the public region offsets being offset additionally by the CDS sector.

Note: To rebuild a disk group,  consider the following before attempting the initialization:

1. Run prtvtoc on all the disks in the disk group. Check the VxVM public and private region offsets.
2. Use vxdisk -f init  instead of vxdisksetup as this will just zero out the private region and not re-initialize with the default settings that vxdisksetup does.

If you still need to use this command, the following details will show how to use vxdisksetup to successfully restore the original public and private regions offsets.

Note: Confirm VxVM release

1. VxVM 3.2 with patch one or greater or VxVM 3.5or higher  See Section Two
2. VxVM 3.2 or less                                                            See Section Three


Section One - Using prtvtoc to obtain the necessaryinformation

1. prtvtoc/dev/rdsk/c*t*d*s2

example
-------

#>prtvtoc /dev/rdsk/c1t5d0s2


*/dev/rdsk/c1t5d0s2 partitionmap                                       
*                                                                         
*Dimensions:                                                             
*    512bytes/sector                                                   
*    686sectors/track                                                   
*      2tracks/cylinder                                                 
*    1372sectors/cylinder                                               
*  26125cylinders                                                       
*  26123 accessiblecylinders                                           
*                                                                         
*Flags:                                                                 
*  1:unmountable                                                       
*  10:read-only                                                         
*                                                                         
*                          First    Sector    Last                       
*Partition  Tag  Flags    Sector    Count    Sector  Mount Directory   
      2      5    01          0  35840756  35840755                     
      3    15    01          0      1372      1371                     
      4    14    01      1372  35839384  35840755   

Note: Now refer to the relevant section for your VxVM release

SectionTwo       
     
With VxVM 3.2 and patch one or VxVM 3.5 or greater there is an additional command line option called old_layout. It will initialize the disk without the reserved CDS sector. Without specifying old_layout , vxdisksetup will reserve this CDS sector which will cause the public region to be still offset by a sector.

example
-------------

#vxdisksetup-i c1t5d0 privlen=1372
#prtvtoc/dev/rdsk/c1t5d0s2

*Dimensions:                                                             
*    512bytes/sector                                                     
*    686sectors/track                                                   
*      2tracks/cylinder                                                 
*    1372sectors/cylinder                                                 
*  26125cylinders                                                       
*  26123 accessiblecylinders                                             
*                                                                         
*Flags:                                                                   
*  1:unmountable                                                         
*  10:read-only                                                           
*                                                                         
* Unallocatedspace:                                                       
*      First    Sector    Last                                           
*      Sector    Count    Sector                                         
*        1372      1372      2743                                         
*                                                                         
*                          First    Sector    Last                       
*Partition  Tag  Flags    Sector    Count    Sector  MountDirectory     
      2      5    01          0  35840756  35840755                       
      3    15    01          0      1372      1371                       
      4    14    01      2744  35838012  35840755

From the information, it can be seen that the public region (tag 14) starts at 2744 calculation  privlen sector count +  sector/cylinder    (1372+1372=2744)

Looking at the prtvtoc from section one,  it can be seen that the public region offset starts straight after the private region's sector count; recovering the volumes at this point will again put the volumes in the wrong offset.

To initialize correctly use thefollowing:

#>vxdisksetup -i c1t5d0privlen=1372 old_layout
#>prvtoc/dev/rdsk/c1t5d0

*/dev/rdsk/c1t5d0s2 partitionmap                                       
*                                                                         
*Dimensions:                                                             
*    512bytes/sector                                                   
*    686sectors/track                                                   
*      2tracks/cylinder                                                 
*    1372sectors/cylinder                                               
*  26125cylinders                                                       
*  26123 accessiblecylinders                                           
*                                                                         
*Flags:                                                                 
*  1:unmountable                                                       
*  10:read-only                                                         
*                                                                         
*                          First    Sector    Last                       
*Partition  Tag  Flags    Sector    Count    Sector  Mount Directory   
      2      5    01          0  35840756  35840755                     
      3    15    01          0      1372      1371                     
      4    14    01      1372  35839384  35840755                     

Section Three

With VxVM 3.2 [unpatched] the old_layout option was not included,  which would prevent vxdisksetup from reserving an extracylinder for CDS. To Initialize
the disk using vxdisksetup, it is necessary to specifythe following to the commands:

1. privlen
2. puboffset

The privlen is based on the "sector count"for tag 15 and the puboffset is based on the "first sector" for tag 14.

The following may also be required:

1. privoffset
2. publen

Inthe  prtvtoc from section one:

                              First    Sector
                              Sector  Count
      3    15    01        0        1372      1371                     
      4    14    01      1372    35839384  35840755   

To correctly align public and private regions:

#>vxdisksetup -i c1t5d0privlen=1372  puboffset=1372 [privoffset=][publen=]
#>prtvotc/dev/rdsk/c1t5d0s2

*/dev/rdsk/c1t5d0s2 partitionmap                                         
*                                                                         
*Dimensions:                                                             
*    512bytes/sector                                                     
*    686sectors/track                                                   
*      2tracks/cylinder                                                 
*    1372sectors/cylinder                                                 
*  26125cylinders                                                       
*  26123 accessiblecylinders                                             
*                                                                         
*Flags:                                                                   
*  1:unmountable                                                         
*  10:read-only                                                           
*                                                                         
*                          First    Sector    Last                       
*Partition  Tag  Flags    Sector    Count    Sector  MountDirectory     
      2      5    01          0  35840756  35840755                       
      3    15    01          0      1372      1371                       
      4    14    01      1372  35839384  35840755                       


Note:Even if the disk was initialized with a larger private region or with the CDSsector, you can still initialize it again to the original size. You will lose access to the first volume contained on that disk if the private region size has encroached into the public region. But the other volumes should be fine if they had no issues prior to the disk group rebuild.



 
 

 

Issue/Introduction

Considerations when using vxdisksetup while performing a disk-group rebuild