linux as 5 下的raw的處理

rainbowbridg發表於2009-06-16

linux as 5下沒有/etc/sysconfig/rewdevices,和as 4的處理方法不同:

需要修改:/etc/udev/rules.d/60-raw.rules

ACTION=="add", KERNEL=="sdb5",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="21",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="sdb6",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="22",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="sdb7",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="23",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="sdb8",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="24",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="sdb9",RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="25",RUN+="/bin/raw /dev/raw/raw1 %M %m"
KERNEL=="raw[1-4]", OWNER="oracle", GROUP="oinstall", MODE="640"

注意這個ENV{MINOR}後面的值該填什麼呢?

如果不知道我們可以先在這個檔案裡設定:

ACTION=="add", KERNEL=="sdb5",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb6",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdb7",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdb8",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdb9",RUN+="/bin/raw /dev/raw/raw5 %N"
KERNEL=="raw[1-4]", OWNER="oracle", GROUP="oinstall", MODE="640"

儲存後執行命令: start_udev

然後 raw -qa 檢視裸裝置:

/dev/raw/raw1: bound to major 8, minor 21
/dev/raw/raw2: bound to major 8, minor 22
/dev/raw/raw3: bound to major 8, minor 23
/dev/raw/raw4: bound to major 8, minor 24
/dev/raw/raw5: bound to major 8, minor 25

這下minor的值就有了,然後修改該檔案,重新執行start_udev就可以了!

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7916042/viewspace-1023185/,如需轉載,請註明出處,否則將追究法律責任。

相關文章