确认是否安装UDEV

[root@rh2 ~]# rpm -qa|grep udev

udev-095-14.21.el5

1.进入/dev目录查看块设备

cd /dev

ls -l sd*

2.执行脚本

for i in b c d e f g ;

do

echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""      >> /etc/udev/rules.d/99-oracle-asmdevices.rules

done

4.运行语句

/sbin/start_udev

5.查看生成的asm共享盘

ls -l asm*



对于Linux5脚本如下:

for i in b c d e f g h i j k ;

do

echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id -g -u -s %p\", RESULT==\"`scsi_id -g -u -s /block/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""     >> /etc/udev/rules.d/99-oracle-asmdevices.rules

done


http://www.oracledatabase12g.com/archives/tag/udev