ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RHEL5中裸设备的创建简介

RHEL5中裸设备的创建简介

原创 Linux操作系统 作者:atlantisholic 时间:2011-05-19 20:58:09 0 删除 编辑
Redhat5以上版本已废弃rawdevices管理方式,

1)#vi /etc/udev/rules.d/60-raw.rules


 

ACTION=="add", KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="/dev/sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="33",RUN+="/bin/raw /dev/raw/raw2 %M %m"
ACTION=="add", KERNEL=="/dev/sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="49",RUN+="/bin/raw /dev/raw/raw3 %M %m"
ACTION=="add", KERNEL=="/dev/sdb5",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="21",RUN+="/bin/raw /dev/raw/raw4 %M %m"
ACTION=="add", KERNEL=="/dev/sdc5",RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="37",RUN+="/bin/raw /dev/raw/raw5 %M %m"
ACTION=="add", KERNEL=="/dev/sdd5",RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="53",RUN+="/bin/raw /dev/raw/raw6 %M %m"
KERNEL=="raw[1-6]",OWNER="oracle", GROUP="dba", MODE="660"

 

 

##注意其中的:

ENV{MINOR}==“1”

ENV{MINOR}==“17”

ENV{MINOR}==“33”

个人总结:16X+N,其中的X:为硬盘的序号,N:为分区序号,如果乱写很有可能无法得到期望的结果。如果不知道的话,可以使用以前的绑定方式查看具体数值:

raw /dev/raw/raw1 /dev/sdb1

/dev/raw/raw1: bound to major 8 minor 17

这里的:major为8,minor为17.

2)#start_udev


 

3)# ls /dev/raw/ -l

 

[root@rac1 sysconfig]# ls /dev/raw -l
total 0
crw-rw---- 1 oracle dba 162, 1 Aug 11 18:03 raw1
crw-rw---- 1 oracle dba 162, 2 Aug 11 18:03 raw2
crw-rw---- 1 oracle dba 162, 3 Aug 11 18:03 raw3

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

请登录后发表评论 登录
全部评论

注册时间:2010-08-30

  • 博文量
    130
  • 访问量
    629247