RHEL8 使用UDEV配置ASM磁盘

1.虚拟机需要在vmx文件中添加,才能显示UUID
disk.enableUUID = "TRUE"

2. (可省略)

rm -rf  99-oracle-asmdevices.rules

3.创建文件

for i in a b c d e f g;
do
echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\",PROGRAM==\"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\",SYMLINK+=\"asm-disk$i\",OWNER=\"grid\",GROUP=\"asmadmin\",MODE=\"0660\"" >>/etc/udev/rules.d/99-oracle-asmdevices.rules;
done

 注意未分区用 $name
分区用       $parent

4.加载

udevadm trigger --type=devices --action=change

5.验证

[root@mtxdb ~]# ls -ltr /dev/asm*
lrwxrwxrwx 1 root root 3 Jun 23 16:45 /dev/asm-diskb -> sdb
lrwxrwxrwx 1 root root 3 Jun 23 16:45 /dev/asm-diskg -> sdg
lrwxrwxrwx 1 root root 3 Jun 23 16:45 /dev/asm-diskf -> sdf
lrwxrwxrwx 1 root root 3 Jun 23 16:45 /dev/asm-diskc -> sdc
lrwxrwxrwx 1 root root 3 Jun 23 16:45 /dev/asm-diska -> sda
lrwxrwxrwx 1 root root 3 Jun 23 16:45 /dev/asm-diske -> sde
lrwxrwxrwx 1 root root 3 Jun 23 16:45 /dev/asm-diskd -> sdd
posted on 2020-06-22 15:53  InnoLeo  阅读(1461)  评论(0编辑  收藏  举报