转自:http://blog.csdn.net/staricqxyz/article/details/8332566

RHEL 5 / CentOS 5 / Oracle Linux 5

[root@vmt ~]# cat /etc/issue
Oracle Linux Server release 5.7
Kernel \r on an \m [root@vmt ~]# uname -p
x86_64
[root@vmt ~]# scsi_id -g -u -s /block/sdb
SATA_VBOX_HARDDISK_VBf5fa9817-60df9544_
[root@vmt ~]# scsi_id -g -u -s /block/sdc
SATA_VBOX_HARDDISK_VB3a608c6d-857258c2_
[root@vmt ~]# scsi_id -g -u -s /block/sdd
SATA_VBOX_HARDDISK_VB3e117166-7159170a_
[root@vmt ~]# cat /etc/udev/rules.d/-oracle-asmdevices.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_VBOX_HARDDISK_VBf5fa9817-60df9544_", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE=""
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_VBOX_HARDDISK_VB3a608c6d-857258c2_", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE=""
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="SATA_VBOX_HARDDISK_VB3e117166-7159170a_", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE=""
[root@vmt ~]# start_udev
Starting udev: [ OK ]
[root@vmt ~]# ls -l /dev/asm-disk*
brw-rw---- grid asmadmin , Dec : /dev/asm-diskb
brw-rw---- grid asmadmin , Dec : /dev/asm-diskc
brw-rw---- grid asmadmin , Dec : /dev/asm-diskd
[root@vmt ~]# fdisk /dev/sdb

Command (m for help): n
Command action
e extended
p primary partition (-)
p
Partition number (-):
First cylinder (-, default ):
Using default value
Last cylinder or +size or +sizeM or +sizeK (-, default ): +512M Command (m for help): p Disk /dev/sdb: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes Device Boot Start End Blocks Id System
/dev/sdb1 Linux Command (m for help): n
Command action
e extended
p primary partition (-)
p
Partition number (-):
First cylinder (-, default ):
Using default value
Last cylinder or +size or +sizeM or +sizeK (-, default ):
Using default value Command (m for help): p Disk /dev/sdb: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes Device Boot Start End Blocks Id System
/dev/sdb1 Linux
/dev/sdb2 + Linux Command (m for help): w
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.
[root@vmt ~]# ls -l /dev/sdb*
brw-r----- root disk , Dec : /dev/sdb
brw-r----- root disk , Dec : /dev/sdb1
brw-r----- root disk , Dec : /dev/sdb2
[root@vmt ~]# cat /etc/udev/rules.d/-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}=="", ENV{MINOR}=="", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major , minor .
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="raw*", OWNER=="oracle", GROUP=="oinstall", MODE==""
[root@vmt ~]# start_udev
Starting udev: [ OK ]
[root@vmt ~]# ls -l /dev/raw/raw*
crw-rw---- oracle oinstall , Dec : /dev/raw/raw1
crw-rw---- oracle oinstall , Dec : /dev/raw/raw2
[root@vmt ~]# ls -l /dev/asm-disk*
brw-rw---- grid asmadmin , Dec : /dev/asm-diskc
brw-rw---- grid asmadmin , Dec : /dev/asm-diskd

RHEL 6 / CentOS 6 / Oracle Linux 6

[root@vmol6 ~]# cat /etc/issue
Oracle Linux Server release 6.3
Kernel \r on an \m [root@vmol6 ~]# uname -p
x86_64
[root@vmol6 ~]# scsi_id -g -u -d /dev/sdb
1ATA_VBOX_HARDDISK_VB3a217fd5-b0e5b939
[root@vmol6 ~]# scsi_id -g -u -d /dev/sdc
1ATA_VBOX_HARDDISK_VBebf4c4a8-ce363f12
[root@vmol6 ~]# scsi_id -g -u -d /dev/sdd
1ATA_VBOX_HARDDISK_VB70f61801-584899be
[root@vmol6 ~]# cat /etc/udev/rules.d/-oracle-asmdevices.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB3a217fd5-b0e5b939", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE=""
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBebf4c4a8-ce363f12", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE=""
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB70f61801-584899be", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE=""
[root@vmol6 ~]# start_udev
Starting udev: [ OK ]
[root@vmol6 ~]# ls -l /dev/asm-disk*
brw-rw----. grid asmadmin , Dec : /dev/asm-diskb
brw-rw----. grid asmadmin , Dec : /dev/asm-diskc
brw-rw----. grid asmadmin , Dec : /dev/asm-diskd
05-11 20:07