首页 » ORACLE 9i-23ai, 系统相关 » How to create ASM devices with UDEV

How to create ASM devices with UDEV

Udev is the mechanism used to create and name /dev device nodes corresponding to the devices that are present in the system. Udev uses matching information provided by sysfs with rules provided by the user to dynamically add the required device nodes.

Udev rule files are kept in the /etc/udev/rules.d/ directory.

How to create ASM devices

/etc/udev/rules.d/99-oracle-asmdevices.rules

# LINUX 5

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\""
done

# LINUX 6 +

for i in b c d e f ;
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

# LINUX 7 SYMLINK

for i in b c d e f ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", SYMLINK+=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done

After making the changes in udev configuration if there is no possibility to reboot the server, udevadm trigger can be utilized to reload the new rules configuration in udev:
Raw

# /sbin/udevadm control --reload-rules
# /sbin/udevadm trigger --type=devices --action=change

udevadm trigger --subsystem-match=block
udevadm trigger --sysname-match=sdb
打赏

对不起,这篇文章暂时关闭评论。