ITPub博客

首页 > Linux操作系统 > Linux操作系统 > HPUX 11.31下更改设备名

HPUX 11.31下更改设备名

原创 Linux操作系统 作者:bluesshadow 时间:2012-11-05 15:44:44 0 删除 编辑
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONEHPUX 11.31下更改设备名


HPUX(特别是HPUX 11.31,不能安装其它多路径软件)下安装ORACLE RAC时,建ASM磁盘组时有时会碰到两个节点上存储映射过来的磁盘盘符不一致,有时是物理路径一致,但聚合后路径不一致,有时甚至物理路径也不一致,此时就需将两个节点上的磁盘盘符修改为一致,上网找了很久,找到一篇HPUX网站上的一篇文档,将实施过程记录下来,以备后查:

1.确认LUN ID与磁盘的对应关系,确认两个节点磁盘的对应关系

首先找到存储映射到主机的磁盘的LUN ID,并将两台主机之间相同LUN ID的磁盘对应关系找到,因为HP 11.31使用的是HP自己的多路径软件,如果存储是HDS的话可以通过HDS提供的工具脚本来找到磁盘和LUN ID的对应关系:

HPUXLun对应关系查看方式如下:

请将附件的工具inqraid.hpux以二进制模式ftp上传到主机/tmp目录,执行以下命令

a>cd /tmp

b>chmod +x /tmp/inqraid.hpux

c>ioscan -fun | grep -e rdisk -e rdsk | ./inqraid.hpux -CLI -fx

d>ioscan -fun | grep -e rdisk -e rdsk | ./inqraid.hpux -CLI -fx -fg

 

 

-h可以看到更多选项。。。。。。

 

根据命令的输出结果可以核对出主机设备名与存储设备Lun的对应关系。

 

如果是EMC或者其它的需要找存储厂商了解,如果找不到办法就只有用最笨的办法,一块盘一块盘的映射来找磁盘和LUN ID的对应关系 

以下映射了5块磁盘,存储是EMC CX4-240,在两个节点上磁盘与LUN ID的对应关系如下:

LUNID                                            节点1磁盘名                                                        节点2磁盘名         

lun 36                                             /dev/rdisk/disk216                                              /dev/rdisk/disk191

lun 37                                             /dev/rdisk/disk217                                              /dev/rdisk/disk192

lun 38                                             /dev/rdisk/disk218                                              /dev/rdisk/disk193

lun 39                                             /dev/rdisk/disk219                                              /dev/rdisk/disk194

lun 40                                             /dev/rdisk/disk220                                              /dev/rdisk/disk195

 

查看两个节点上聚合后和聚合前磁盘对应关系

                   节点1                                                                                                   节点2

nodeA#ioscan -m dsf                                nodeB#ioscan -m dsf    

Persistent DSF           Legacy DSF(s)        Persistent DSF      Legacy DSF(s)

===================================      ===================================  

/dev/rdisk/disk216  /dev/rdsk/c36t0d0              /dev/rdisk/disk191  /dev/rdsk/c37t0d0

                    /dev/rdsk/c35t0d0                        /dev/rdsk/c36t0d0

                    /dev/rdsk/c38t0d0                        /dev/rdsk/c38t0d0

                    /dev/rdsk/c37t0d0                        /dev/rdsk/c39t0d0

/dev/rdisk/disk217  /dev/rdsk/c36t0d1              /dev/rdisk/disk192  /dev/rdsk/c37t0d1

                    /dev/rdsk/c35t0d1                        /dev/rdsk/c36t0d1

                    /dev/rdsk/c38t0d1                        /dev/rdsk/c38t0d1

                    /dev/rdsk/c37t0d1                        /dev/rdsk/c39t0d1

/dev/rdisk/disk218  /dev/rdsk/c36t0d2          /dev/rdisk/disk193  /dev/rdsk/c37t0d2

                    /dev/rdsk/c35t0d2                        /dev/rdsk/c36t0d2

                    /dev/rdsk/c38t0d2                        /dev/rdsk/c38t0d2

                    /dev/rdsk/c37t0d2                        /dev/rdsk/c39t0d2

/dev/rdisk/disk219  /dev/rdsk/c36t0d3               /dev/rdisk/disk194  /dev/rdsk/c37t0d3

                    /dev/rdsk/c35t0d3                        /dev/rdsk/c36t0d3

                    /dev/rdsk/c38t0d3                        /dev/rdsk/c38t0d3

                    /dev/rdsk/c37t0d3                        /dev/rdsk/c39t0d3

/dev/rdisk/disk220  /dev/rdsk/c35t0d4               /dev/rdisk/disk195  /dev/rdsk/c37t0d4

                    /dev/rdsk/c36t0d4                        /dev/rdsk/c36t0d4

                    /dev/rdsk/c38t0d4                        /dev/rdsk/c38t0d4

                    /dev/rdsk/c37t0d4                        /dev/rdsk/c39t0d4

节点1                                                     节点2

 /dev/rdisk/disk216                       /dev/rdisk/disk191

 /dev/rdisk/disk217                       /dev/rdisk/disk192

 /dev/rdisk/disk218                       /dev/rdisk/disk193

 /dev/rdisk/disk219                       /dev/rdisk/disk194

 /dev/rdisk/disk220                       /dev/rdisk/disk195

 

根据以上情况决定以第一个节点上的盘符为准,将第二个节点上的盘符进行更改:

2.根据磁盘路径信息生成IO初始化的infile文件

查找磁盘聚合后路径:

nodeB#ioscan -fnNkCdisk                                                    

Class     I  H/W Path  Driver         S/W State   H/W Type     Description     

===========================================================================    

disk  191  64000/0xfa00/0x1e  esdisk         CLAIMED     DEVICE  DGC CX4-240WDR5

                    /dev/disk/disk191             /dev/rdisk/disk191                       

disk  192  64000/0xfa00/0x1f  esdisk         CLAIMED     DEVICE  DGC CX4-240WDR5

                    /dev/disk/disk192            /dev/rdisk/disk192                       

disk  193  64000/0xfa00/0x20  esdisk         CLAIMED     DEVICE  DGC CX4-240WDR5

                    /dev/disk/disk193            /dev/rdisk/disk193                        

disk  194  64000/0xfa00/0x21  esdisk         CLAIMED     DEVICE  DGC CX4-240WDR5

                    /dev/disk/disk194            /dev/rdisk/disk194                       

disk  195  64000/0xfa00/0x22  esdisk         CLAIMED     DEVICE  DGC CX4-240WDR5

                      /dev/disk/disk195         /dev/rdisk/disk195                                            

.....                                                                                                 

查找磁盘聚合前路径:                                                                                                 

nodeB#ioscan -fnkCdisk                                                        

Class     I  H/W Path      Driver         S/W State   H/W Type     Description    

============================================================================      

                                                                                  

disk  28  0/3/1/0.1.21.0.0.0.0  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t0d0    /dev/rdsk/c37t0d0                        

disk 149  0/3/1/0.1.21.0.0.0.1  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t0d1  /dev/rdsk/c37t0d1                        

disk 150  0/3/1/0.1.21.0.0.0.2  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t0d2  /dev/rdsk/c37t0d2                        

disk 151  0/3/1/0.1.21.0.0.0.3  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t0d3  /dev/rdsk/c37t0d3                        

disk 152  0/3/1/0.1.21.0.0.0.4  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t0d4  /dev/rdsk/c37t0d4                        

disk 153  0/3/1/0.1.21.0.0.0.5  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t0d5  /dev/rdsk/c37t0d5                        

disk 154  0/3/1/0.1.21.0.0.0.6  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t0d6  /dev/rdsk/c37t0d6                        

disk 155  0/3/1/0.1.21.0.0.0.7  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t0d7  /dev/rdsk/c37t0d7                        

disk 156  0/3/1/0.1.21.0.0.1.0  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t1d0  /dev/rdsk/c37t1d0                        

disk 157  0/3/1/0.1.21.0.0.1.1  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t1d1  /dev/rdsk/c37t1d1                        

disk 158  0/3/1/0.1.21.0.0.1.2  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c37t1d2  /dev/rdsk/c37t1d2                        

....                                                                               

disk 174  0/7/1/0.1.23.0.0.1.4  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c38t1d4  /dev/rdsk/c38t1d4                        

disk 175  0/7/1/0.1.23.0.0.1.5  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c38t1d5  /dev/rdsk/c38t1d5                        

disk 176  0/7/1/0.1.23.0.0.1.6  sdisk           CLAIMED     DEVICE  DGC CX4-240WDR5

                       /dev/dsk/c38t1d6  /dev/rdsk/c38t1d6

生成infile文件

# cd /tmp

 # ioscan -kNf | grep ^disk | awk '{printf "%s %s %s\n",$3,$1,$2}' > infile

 # ioscan -kf | grep ^disk | awk '{printf "%s %s %s\n",$3,$1,$2}'  >> infile

 

修改生成的infile文件,64000/0xfa00/0x1e开始的行,除了需要修改设备名的,其它的都删除掉:

 # vi infile                                         

 nodeBtmp/hpdisk#vi infile                       

"infile" 109 lines, 3144 characters                  

64000/0xfa00/0x1e disk 191

64000/0xfa00/0x1f disk 192

64000/0xfa00/0x20 disk 193

64000/0xfa00/0x21 disk 194

64000/0xfa00/0x22 disk 195                           

0/0/2/1.0.16 disk 3                           

0/3/1/0.1.21.0.0.0.0 disk 28                         

……                       

0/3/1/0.1.22.0.0.0.1 disk 118

0/3/1/0.1.22.0.0.0.2 disk 119

0/3/1/0.1.22.0.0.0.3 disk 120

0/3/1/0.1.22.0.0.0.4 disk 121

                        

将阴影部分修改成以下内容:

64000/0xfa00/0x1e disk 216

64000/0xfa00/0x1f disk 217

64000/0xfa00/0x20 disk 218

64000/0xfa00/0x21 disk 219

64000/0xfa00/0x22 disk 220

0/0/2/1.0.16 disk 3

0/3/1/0.1.21.0.0.0.0 disk 28

……

0/3/1/0.1.22.0.0.0.1 disk 118

0/3/1/0.1.22.0.0.0.2 disk 119

0/3/1/0.1.22.0.0.0.3 disk 120

0/3/1/0.1.22.0.0.0.4 disk 121

3.初始化修改后设备文件

执行生成的文件:

nodeB #ioinit -f ./infile

ioinit: Input is identical to kernel, line ignored

Input line 2:  0/0/2/1.0.16 disk 3

……

ioinit: Input is identical to kernel, line ignored   

Input line 83:  0/7/1/0.1.23.0.0.1.6 disk 176

  4.删除之前旧的设备

nodeB#rmsf /dev/disk/disk191        /dev/rdisk/disk191

nodeB#rmsf /dev/disk/disk192        /dev/rdisk/disk192

nodeB#rmsf /dev/disk/disk193        /dev/rdisk/disk193

nodeB#rmsf /dev/disk/disk194        /dev/rdisk/disk194

nodeB#rmsf /dev/disk/disk195        /dev/rdisk/disk195

 

5.验证查询                  

 

nodeBtmp#ioscan -m dsf

Persistent DSF           Legacy DSF(s)

========================================

/dev/rdisk/disk1            /dev/rdsk/c34t0d0

                         /dev/rdsk/c35t0d0

/dev/rdisk/disk41           /dev/rdsk/c34t0d2

                         /dev/rdsk/c35t0d2

.....

/dev/rdisk/disk216          /dev/rdsk/c37t0d0

                         /dev/rdsk/c36t0d0

                         /dev/rdsk/c38t0d0

                         /dev/rdsk/c39t0d0

/dev/rdisk/disk217          /dev/rdsk/c37t0d2

                         /dev/rdsk/c36t0d2

                         /dev/rdsk/c38t0d2

                         /dev/rdsk/c39t0d2

/dev/rdisk/disk218          /dev/rdsk/c37t0d4

                         /dev/rdsk/c36t0d4

                         /dev/rdsk/c38t0d4

                         /dev/rdsk/c39t0d4

/dev/rdisk/disk219          /dev/rdsk/c37t0d6

                         /dev/rdsk/c36t0d6

                         /dev/rdsk/c38t0d6

                         /dev/rdsk/c39t0d6

/dev/rdisk/disk220          /dev/rdsk/c37t1d0

                         /dev/rdsk/c36t1d0

                         /dev/rdsk/c38t1d0

                         /dev/rdsk/c39t1d0

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24668589/viewspace-748369/,如需转载,请注明出处,否则将追究法律责任。

上一篇: fuser
请登录后发表评论 登录
全部评论

注册时间:2010-09-27

  • 博文量
    34
  • 访问量
    139674