自動掛載裸裝置及許可權

tolywang發表於2011-09-07
自動掛載裸裝置
方法一: OEL5
vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdb2
/dev/raw/raw3 /dev/sdb3
/etc/init.d/rawdevices status/restart/...


方法二: OEL5/redhat5下


vi /etc/udev/rules.d/60-raw.rules
ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw3 %N"


啟動後許可權
vi /etc/udev/rules.d/65-raw-permissions.rules
# Set permissions of raw bindings to Clusterware devices
KERNEL=="raw1", WNER="oracle", GROUP="oinstall", MODE="660"
KERNEL=="raw2", WNER="oracle", GROUP="oinstall", MODE="660"
KERNEL=="raw3", WNER="oracle", GROUP="oinstall", MODE="660"



資料:
5 以上版本已經取消了對裸裝置的支援,所以在 Oracle 時所使用的的裸裝置,需要透過 Udev 進行設定:

設定重新啟動自動掛載裸裝置
vi /etc/udev/rules.d/60-raw.rules
ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw3 %N"

注意確定raw命令在/bin目錄下,有的是在/usr/bin目錄下

vi /etc/udev/rules.d/65-raw-permissions.rules
# Set permissions of raw bindings to Oracle Clusterware devices
KERNEL=="raw1", WNER="root", GROUP="oinstall", MODE="660"
KERNEL=="raw2", WNER="oracle", GROUP="oinstall", MODE="660"
KERNEL=="raw3", WNER="oracle", GROUP="oinstall", MODE="660"

以上方法也適用其他使用udev掛載裝置的linux版本.

具體請參考 Oracle 官方文件:

Note 465001.1
- Configuring raw devices (singlepath) for Oracle Clusterware10gRelease 2 (10.2.0) on RHEL5/ OEL5






missing folder /etc/udev/permissions.d
Posted: 2008-1-13 下午5:23 in response to: user611755
Reply
Hi,

What kind of OS are you running ? Please upload the output of "uname -a".
If you are using EL5/RHEL5, that's right. You can't find the folder /etc/udev/permissions.d. Please follow the following steps:

1. Add udev permission rules to /etc/udev/rules.d/65-raw-permissions.rules file
2. Add the udev permission rules to the /etc/udev/rules.d/65-raw-permissions.rules file, for example:
# Set permissions of raw bindings to Oracle Clusterware devices
KERNEL=="raw1", WNER="root", GROUP="oinstall", MODE="640"
KERNEL=="raw2", WNER="oracle", GROUP="oinstall", MODE="640"

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

相關文章