How to parse the contents of the /etc/vx/disk.info file

book

Article ID: 100037821

calendar_today

Updated On:

Description

Description

 

 

 

Persistent Device Name Database


The persistent device naming feature, introduced in Veritas Volume Manager (VxVM) 4.1, makes the names of disk devices persistent across system reboots by populating a file named "disk.info", located in the /etc/vx directory.

After a hardware reconfiguration and a subsequent reboot, the operating system may generate different names for the paths to the disks.  As the DDL (Device Discovery Layer) assigns persistent disk names using the persistent device name database (stored in the /etc/vx/disk.info file) generated during a previous boot session. As a result, the disk names may no longer correspond to an actual path following the hardware reconfiguration event. This does not prevent the disk(s) from being used, however, the association between the Veritas disk access (DA) name and one of its paths may be lost, and appear incorrect.

The contents of the /etc/vx/disk.info file can be refreshed dynamically (as of VxVM 5.0 MP3 onwards), by running the VxVM "vxddladm assign names" command.
 


Understand the contents of the /etc/vx/disk.info file


In this instance, the devno " 0x4fc00c8 " is presented with an enclosure type of "EMC" and an enclosure serial number of " 000290301414".


# cat /etc/vx/disk.info

EMC%5FSYMMETRIX%5F000290301414%5F60060480000290301414533030304532 c1t5006048C536979A0d84 0x4fc00c8    0x2    emc1_00e2     EMC                000290301414


The device number (devno) recorded above in the third column of the /etc/vx/disk.info file contains both the major and minor numbers of the device.


The /etc/vx/disk.info file contents can be broken down as follows:
 

Column Number:     Value
 

#1:                             UDID (VID|PID|CAB_SERIAL_NO|LUN_SERIAL_NO )
#2:                             Native OS handle        
#3:                             Devno
#4:                             Namingscheme
#5:                             Veritas Disk Access Name (DA)
#6:                             Enclousure Type ( ENCLR_TYPE)
#7:                             Enclosure Serial Number (ENCLR_SNO)


The device number (devno) 0x4fc00c8 (hex value) can be converted to a binary value of "100111111000000000011001000".

 

The upper 14 bits give represents the "major" number

                 1 0011 1111  

 

The lower 18 bits represent the "minor" number

00 0000 0000 1100 1000

 
The hex value after the device number (devno) represents the namingscheme:


Disk has assigned OS based naming                   0x1
Disk has assigned Enclosure based naming       0x2
Disk has assigned TPD based naming                0x4



The following script has been created to assist with the translation of the /etc/vx/disk.info file contents.
 

[Perl script]


# cat parse_diskinfo.pl
#!/usr/bin/perl

  my $ETC_VX_DISKINFO = '/etc/vx/disk.info';

my %namingscheme = (
        0x1 => 'OSN',
        0x2 => 'ESN',
        0x4 => 'TPD',
);


open(F, "$ETC_VX_DISKINFO") || die ("failed to open $ETC_VX_DISKINFO");
while () {
        chomp;
        /([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+)/;
        my ($udid, $devname, $daname, $encl, $ser) = ($1, $2, $5, $6, $7);
        my ($maj, $min) = ('NO DEVICE', 'NO DEVICE');
        ($maj, $min) = ((hex($3) & 0xfffc0000) >> 18, (hex($3) & 0x3ffff))
                unless (hex($3) eq 0xffffffff);
        my $ns = $namingscheme{hex($4)};

        print "DANAME\t\t: $daname\t";
        print "OS DEVICE NAME\t: $devname\n";
        print "DMP MAJOR, MIN\t: $maj, $min\t";
        print "NAMING SCHEME\t: $ns\t";
        print "ENCLOSURE TYPE\t: $encl\n";
        print "CAB SERIAL NO\t: $ser\n";
        print "UDID(VID|PID|CAB_SERIAL_NO|LUN_SERIAL_NO):\n";
        print "$udid\n";
        print "==========\n"
};
close(F);



Sample output


The following server consists of a single internal device and four EMC CLARiiON devices.
 

# vxdmpadm listenclosure all
ENCLR_NAME        ENCLR_TYPE     ENCLR_SNO      STATUS       ARRAY_TYPE     LUN_COUNT
===================================================================================
disk              Disk           DISKS                CONNECTED    Disk        1
emc_clariion0     EMC_CLARiiON   CK200053300424       CONNECTED    CLR-A/PF    4


The /etc/vx/disk.info file contains the following content:


# more /etc/vx/disk.info
SEAGATE%5FST373307LSUN72G%5FDISKS%5F3035303342395A3654460000 c2t2d0 0x5040000 0x2 disk_0 Disk DISKS
DGC%5FRAID%205%5FCK200053300424%5F60060160E8341600D061C0D4DF31DF11 c1t500601613021C60Ed3 0x5040038 0x2 emc_clariion0_83 EMC_CLARiiON CK200053300424
DGC%5FRAID%205%5FCK200053300424%5F60060160E8341600D161C0D4DF31DF11 c1t500601693021C60Ed2 0x5040040 0x2 emc_clariion0_84 EMC_CLARiiON CK200053300424
DGC%5FRAID%205%5FCK200053300424%5F60060160113516006C6EABCA6400DB11 c1t500601683021C60Ed1 0x5040028 0x2 emc_clariion0_85 EMC_CLARiiON CK200053300424
DGC%5FRAID%205%5FCK200053300424%5F60060160113516006D6EABCA6400DB11 c1t500601613021C60Ed0 0x5040030 0x2 emc_clariion0_86 EMC_CLARiiON CK200053300424


The perl script generates the following output:


# ./parse_diskinfo.pl
DANAME          : disk_0
OS DEVICE NAME  : c2t2d0
DMP MAJOR, MIN  : 1284, 0
NAMING SCHEME   : ESN
ENCLOSURE TYPE  : Disk
CAB SERIAL NO   : DISKS
UDID(VID|PID|CAB_SERIAL_NO|LUN_SERIAL_NO)
                : SEAGATE%5FST373307LSUN72G%5FDISKS%5F3035303342395A3654460000
==========
DANAME          : emc_clariion0_83
OS DEVICE NAME  : c1t500601613021C60Ed3
DMP MAJOR, MIN  : 1284, 56
NAMING SCHEME   : ESN
ENCLOSURE TYPE  : EMC_CLARiiON
CAB SERIAL NO   : CK200053300424
UDID(VID|PID|CAB_SERIAL_NO|LUN_SERIAL_NO)
                : DGC%5FRAID%205%5FCK200053300424%5F60060160E8341600D061C0D4DF31DF11
==========
DANAME          : emc_clariion0_84
OS DEVICE NAME  : c1t500601693021C60Ed2
DMP MAJOR, MIN  : 1284, 64
NAMING SCHEME   : ESN
ENCLOSURE TYPE  : EMC_CLARiiON
CAB SERIAL NO   : CK200053300424
UDID(VID|PID|CAB_SERIAL_NO|LUN_SERIAL_NO)
                : DGC%5FRAID%205%5FCK200053300424%5F60060160E8341600D161C0D4DF31DF11
==========
DANAME          : emc_clariion0_85
OS DEVICE NAME  : c1t500601683021C60Ed1
DMP MAJOR, MIN  : 1284, 40
NAMING SCHEME   : ESN
ENCLOSURE TYPE  : EMC_CLARiiON
CAB SERIAL NO   : CK200053300424
UDID(VID|PID|CAB_SERIAL_NO|LUN_SERIAL_NO)
                : DGC%5FRAID%205%5FCK200053300424%5F60060160113516006C6EABCA6400DB11
==========
DANAME          : emc_clariion0_86
OS DEVICE NAME  : c1t500601613021C60Ed0
DMP MAJOR, MIN  : 1284, 48
NAMING SCHEME   : ESN
ENCLOSURE TYPE  : EMC_CLARiiON
CAB SERIAL NO   : CK200053300424
UDID(VID|PID|CAB_SERIAL_NO|LUN_SERIAL_NO)
                : DGC%5FRAID%205%5FCK200053300424%5F60060160113516006D6EABCA6400DB11
==========

 

 

Issue/Introduction

How to parse the contents of the /etc/vx/disk.info file

Attachments

parse_diskinfo.pl get_app