RHEL5中裸裝置的建立簡介

atlantisholic發表於2011-05-19
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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章