1) bind the local disks to raw devices using UDEV RULES
1@@@@ make sure you have the disk
[root@station123 ~]# fdisk -l /dev/sda
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe70af055
Device Boot Start End Blocks Id System
/dev/sda1 1 1044 8385898+ 5 Extended
/dev/sda5 1 132 1060227 83 Linux
/dev/sda6 133 264 1060258+ 83 Linux
/dev/sda7 265 396 1060258+ 83 Linux
/dev/sda8 397 528 1060258+ 83 Linux
Note:
here, I use /dev/sda5 6 7 8 as the raw devices
2@@@@ create the udev rules
[root@station123 ~]# cat /etc/udev/rules.d/60-raw.rules
# 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=="sda5", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sda6", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sda7", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sda8", RUN+="/bin/raw /dev/raw/raw4 %N"
3@@@@ create the udev rules privileges of raw devices
[root@station123 ~]# cat /etc/udev/rules.d/50-udev.rules
KERNEL=="raw1", OWNER="oracle" GROUP="oinstall", MODE="0660"
KERNEL=="raw2", OWNER="oracle" GROUP="oinstall", MODE="0660"
KERNEL=="raw3", OWNER="oracle" GROUP="oinstall", MODE="0660"
KERNEL=="raw4", OWNER="oracle" GROUP="oinstall", MODE="0660"
4@@@@ after reboot
[root@station123 ~]# reboot
[root@station123 ~]# ll /dev/raw/raw*
crw-rw----. 1 oracle oinstall 162, 1 May 4 12:34 /dev/raw/raw1
crw-rw----. 1 oracle oinstall 162, 2 May 4 12:34 /dev/raw/raw2
crw-rw----. 1 oracle oinstall 162, 3 May 4 12:34 /dev/raw/raw3
crw-rw----. 1 oracle oinstall 162, 4 May 4 12:34 /dev/raw/raw4
crw-rw----. 1 root disk 162, 0 May 4 12:34 /dev/raw/rawctl
[root@station123 ~]# raw -qa
/dev/raw/raw1: bound to major 8, minor 5
/dev/raw/raw2: bound to major 8, minor 6
/dev/raw/raw3: bound to major 8, minor 7
/dev/raw/raw4: bound to major 8, minor 8
5@@@@ complement
we can use command like below, you would create raw device temporily.
[root@station123 ~]# raw /dev/raw/raw1 /dev/sda5
bind raw devices using UDEV
原创emperor_majesty 博主文章分类:RHEL6 ©著作权
©著作权归作者所有:来自51CTO博客作者emperor_majesty的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
虚拟化kvm的raw文件处理
kvm的raw文件简单处理
raw文件打开 kvm的raw文件处理 -
typescript和javascript中如何使用bind方法?
本文给出typescript和javascript中如何使用bind方法的使用对比与建议。
函数绑定 全局对象 typescript javascript bind -
ASM Using OS Files Instead of Real Raw Devices On Windows. [ID 602620.1]
<br /> <br />Windows 平台下,使用OS files 代替raw devices,步骤如下:<br />
os initialization command path windows -
17.1.1.6 Creating a Data Snapshot Using Raw Data Files
17.1.1.6 Creating a Da...
mysql 数据文件 存储引擎 初始化 数据