May 13

[原]在Asianux 3.0上使用裸设备 晴

linuxing , 15:31 , 基础知识 » 硬件处理 , 评论(1) , 引用(0) , 阅读(20872) , Via 本站原创 | |
    裸设备经常用于Oracle等数据库系统存放数据,过去,在DC Server 5.0是使用rawdevices服务,配合raw命令来实现物理设备和裸设备的绑定工作的,但从Asianux 3.0开始,已经改用udev来管理大部分的物理设备,因此,裸设备的绑定方法也需要修改。

一、DC Server 5.0 版本
DC Server 5.0使用rawdevices服务管理裸设备:
引用
# chkconfig --list|grep raw
rawdevices      0:关闭  1:关闭  2:关闭  3:启用  4:启用  5:启用  6:关闭

配置文件在/etc/sysconfig/rawdevices:
引用
# cd /etc/sysconfig
# cat rawdevices
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format:  
#          
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5

显而易见,只要在该配置文件中加入类似:
引用
/dev/raw/raw1 /dev/sda1

即可。

二、Asianux 3.0 版本
该版本改用udev管理物理设备,配置文件在/etc/udev/rules.d/60-raw.rules:
引用
# cat 60-raw.rules
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
#
# Enter raw device bindings here.
#
# An example would be:
#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.

同样的,参考注释的说明,可加入:
引用
ACTION=="add", KERNEL=="sda1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="raw1", OWNER=="oracle",GROUP=="oinstall",MODE=="0640"

第二行的参数可用于设置裸设备的用户宿主和权限。

示例配置文件:
本文参考zzniu#redflag-linux.com提供的文档实际操作后编写而成。
Tags:
少年阿宾 Email Homepage
2009/05/13 23:40
好文章啊
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]