识别磁盘(/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用如下参数
[[email protected] ~]# 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
时间: 2025-01-17 17:23:24