码迷,mamicode.com
首页 > 系统相关 > 详细

在Linux 5/6上使用UDEV SCSI规则配置ASM DISK

时间:2016-02-15 20:02:25      阅读:343      评论:0      收藏:0      [点我收藏+]

标签:

识别磁盘(/sbin/scsi_id) 

  • Oracle Linux 5用如下脚本:
#!/bin/sh
for i in b c d e f g  
do  
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id -g -u -s /block/\$name\", RESULT==\"`/sbin/scsi_id /block/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""  
done 
  • Oracle Linux 6用如下脚本:
#!/bin/sh
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\""  
done

 

UDEV配置文件

重要:每个配置文件一行为一条规则,并且,(逗号)与下一个关键词之间有空格

  • Oracle Linux 5用如下参数
[root@node1 ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$name", RESULT=="SATA_VBOX_HARDDISK_VB96e49463-3665e815_", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$name", RESULT=="SATA_VBOX_HARDDISK_VB944f68ec-f33e8a99_", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$name", RESULT=="SATA_VBOX_HARDDISK_VBf2e05152-1c6b4621_", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$name", RESULT=="SATA_VBOX_HARDDISK_VB91ee2629-8151eac9_", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$name", RESULT=="SATA_VBOX_HARDDISK_VB4541d4a0-9c804156_", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$name", RESULT=="SATA_VBOX_HARDDISK_VBa741850f-bf6c5aa6_", NAME="asm-diskg", OWNER="grid", GROUP="asmadmin", MODE="0660"
  • Oracle Linux 6 用如下参数
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c294347acba383e23ecbd43867c4", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"  
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2913d3b49354c9d030816bd5de9", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"  
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c296cf9ff63b87e2903925bdec21", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"  
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2952ef3147bf0c3efc345133b00", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"  
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c296f16a22e6292edfb3ec3b1934", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"  
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29ae38dfe96f6342cb2afd7f3fb", NAME="asm-diskg", OWNER="grid", GROUP="asmadmin", MODE="0660" 

 

重启UDEV服务

# #Linux5
# /sbin/udevcontrol reload_rules

# #Linux6
# udevadm control --reload-rules

# #Linux5 and Linux6
# /sbin/start_udev

 

在Linux 5/6上使用UDEV SCSI规则配置ASM DISK

标签:

原文地址:http://www.cnblogs.com/polestar/p/5191206.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!