A-A+

使用udev绑定裸设备

2014年05月29日 Other Tech 暂无评论 阅读 1,279 次

查看当前分区情况

[root@ocm4 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      514048+  83  Linux
/dev/sda2              65         586     4192965   82  Linux swap / Solaris
/dev/sda3             587        2610    16257780   83  Linux

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381    5  Extended
/dev/sdb5               1          62      497952   83  Linux
/dev/sdb6              63         124      497983+  83  Linux
/dev/sdb7             125         186      497983+  83  Linux
/dev/sdb8             187         248      497983+  83  Linux
/dev/sdb9             249         310      497983+  83  Linux
/dev/sdb10            311        1305     7992306   83  Linux

在2个节点上增加以下文件

[root@ocm3 rules.d]# pwd
/etc/udev/rules.d
[root@ocm3 rules.d]# cat 99-oracle-asmdevices.rules 
KERNEL=="sdb5", BUS=="scsi", NAME="rac_ocr1",OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sdb6", BUS=="scsi", NAME="rac_ocr2",OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sdb7", BUS=="scsi", NAME="rac_vote1",OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sdb8", BUS=="scsi", NAME="rac_vote2",OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sdb9", BUS=="scsi", NAME="rac_vote3",OWNER="oracle", GROUP="oinstall", MODE="0660"
KERNEL=="sdb10", BUS=="scsi", NAME="rac_data1",OWNER="oracle", GROUP="oinstall", MODE="0660"
[root@ocm3 rules.d]# scp 99-oracle-asmdevices.rules 192.168.137.204:/etc/udev/rules.d/
The authenticity of host '192.168.137.204 (192.168.137.204)' can't be established.
RSA key fingerprint is 65:54:76:91:e0:62:b8:fb:11:8d:23:5c:73:02:53:73.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.137.204' (RSA) to the list of known hosts.
root@192.168.137.204's password: 
99-oracle-asmdevices.rules                                                                        100%  551     0.5KB/s   00:00    

启动2个节点的udev

[root@ocm3 rules.d]# /sbin/start_udev
Starting udev: [  OK  ]
[root@ocm4 rules.d]# /sbin/start_udev
Starting udev: [  OK  ]

查看绑定情况

[root@ocm3 ~]# ls -l /dev/rac*
brw-rw---- 1 oracle oinstall 8, 26 May 29 10:34 /dev/rac_data1
brw-rw---- 1 oracle oinstall 8, 21 May 29 10:34 /dev/rac_ocr1
brw-rw---- 1 oracle oinstall 8, 22 May 29 10:34 /dev/rac_ocr2
brw-rw---- 1 oracle oinstall 8, 23 May 29 10:34 /dev/rac_vote1
brw-rw---- 1 oracle oinstall 8, 24 May 29 10:34 /dev/rac_vote2
brw-rw---- 1 oracle oinstall 8, 25 May 29 10:34 /dev/rac_vote3

在节点2查看

[root@ocm4 ~]# ls -l /dev/rac*
ls: /dev/rac*: No such file or directory
[root@ocm4 ~]# partprobe
Warning: Unable to open /dev/hdc read-write (Read-only file system).  /dev/hdc has been opened read-only.
[root@ocm4 ~]# ls -l /dev/rac*
brw-rw---- 1 oracle oinstall 8, 26 May 29 10:46 /dev/rac_data1
brw-rw---- 1 oracle oinstall 8, 21 May 29 10:46 /dev/rac_ocr1
brw-rw---- 1 oracle oinstall 8, 22 May 29 10:46 /dev/rac_ocr2
brw-rw---- 1 oracle oinstall 8, 23 May 29 10:46 /dev/rac_vote1
brw-rw---- 1 oracle oinstall 8, 24 May 29 10:46 /dev/rac_vote2
brw-rw---- 1 oracle oinstall 8, 25 May 29 10:46 /dev/rac_vote3
标签:

给我留言

Copyright © YallonKing 保留所有权利.   Theme  Ality

用户登录

分享到: