当前位置: > RedHat >

RHEL5中裸设备的创建简介

时间:2015-01-22 01:03来源:linux.it.net.cn 作者:IT
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

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容