1. Add record to/etc/scsi_id.config
echo "options=--whitelisted--replace-whitespace" >>/etc/scsi_id.config
2. In this example, the block device sdb-> SDD needs to be bound
[[email protected] ~]# for i in B c D;
> 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\" "
> Done
kernel== "sd*", bus== "scsi", program== "/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name", RESULT= = "291bbf9b896a0f503", name= "ASM-DISKB", owner= "grid", group= "Asmadmin", mode= "0660"
kernel== "sd*", bus== "scsi", program== "/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name", RESULT= = "24D3963EC66158AAC", name= "ASM-DISKC", owner= "grid", group= "Asmadmin", mode= "0660"
kernel== "sd*", bus== "scsi", program== "/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name", RESULT= = "2A188DF0F367EC9AD", name= "ASM-DISKD", owner= "grid", group= "Asmadmin", mode= "0660"
3. Write these rule to/etc/udev/rules.d/99-oracle-asmdevices.rules and modify the value of name as needed.
[Email protected] rules.d]# VI 99-oracle-asmdevices.rules
kernel== "sd*", bus== "scsi", program== "/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name", RESULT= = "291bbf9b896a0f503", name= "Asm-data", owner= "grid", group= "Asmadmin", mode= "0660"
kernel== "sd*", bus== "scsi", program== "/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name", RESULT= = "24D3963EC66158AAC", name= "ASM-OCR", owner= "grid", group= "Asmadmin", mode= "0660"
kernel== "sd*", bus== "scsi", program== "/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name", RESULT= = "2A188DF0F367EC9AD", name= "Asm-fra", owner= "grid", group= "Asmadmin", mode= "0660"
4. Start Udev
[Email protected] rules.d]#/sbin/start_udev
Starting udev: [OK]
[Email protected] rules.d]# ll/dev/asm*
BRW-RW----1 Grid asmadmin 8, June 22:43/dev/asm-data
BRW-RW----1 Grid asmadmin 8, June 22:43/dev/asm-fra
BRW-RW----1 Grid asmadmin 8, June 22:43/DEV/ASM-OCR
[Email protected] rules.d]#
Note: RHEL5 commands differ from RHEL6
The RHEL5 command is:/sbin/scsi_id-g-u-s
For example:
For i in B c D;
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\" "
Done
This article is from "Technical achievement dream!" "Blog, be sure to keep this provenance http://dreamsanqin.blog.51cto.com/845412/1665576
Using Udev on Linux 6 to address ASM storage device issues