linux7 以上uuid绑定裸设备

Oracle Linux 7: Udev rule for ASM Cannot Place the ASM Disk in a Directory under /dev (Doc ID 2217951.1)

[root@ht01 rules.d]# cat 96-asmmultipath.rules
ACTION=="add|change", KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VB8232b998-1dc7cf62", RUN+="/bin/sh -c ‘/usr/bin/mkdir /dev/asm; mknod /dev/asm/asm_vote1 b $major $minor; chown grid:asmadmin /dev/asm/asm_vote1; chmod 0660 /dev/asm/asm_vote1‘"

ACTION=="add|change", KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VBc78e77ea-134c35be", RUN+="/bin/sh -c ‘/usr/bin/mkdir /dev/asm; mknod /dev/asm/asm_vote2 b $major $minor; chown grid:asmadmin /dev/asm/asm_vote2; chmod 0660 /dev/asm/asm_vote2‘"

ACTION=="add|change", KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VBd86aaffd-37dd54e9", RUN+="/bin/sh -c ‘/usr/bin/mkdir /dev/asm; mknod /dev/asm/asm_vote3 b $major $minor; chown grid:asmadmin /dev/asm/asm_vote3; chmod 0660 /dev/asm/asm_vote3‘"

ACTION=="add|change", KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VB16d622e9-34bd556b", RUN+="/bin/sh -c ‘/usr/bin/mkdir /dev/asm; mknod /dev/asm/asm_data1 b $major $minor; chown grid:asmadmin /dev/asm/asm_data1; chmod 0660 /dev/asm/asm_data1‘"

ACTION=="add|change", KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VB03b9e34d-5b8d38cc", RUN+="/bin/sh -c ‘/usr/bin/mkdir /dev/asm; mknod /dev/asm/asm_data2 b $major $minor; chown grid:asmadmin /dev/asm/asm_data2; chmod 0660 /dev/asm/asm_data2‘"

ACTION=="add|change", KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VB9600ad48-cc8573a4", RUN+="/bin/sh -c ‘/usr/bin/mkdir /dev/asm; mknod /dev/asm/asm_data3 b $major $minor; chown grid:asmadmin /dev/asm/asm_data3; chmod 0660 /dev/asm/asm_data3‘"

  加载配置文件及启动

[root@ht01 rules.d]# udevadm control --reload-rules
[root@ht01 rules.d]# udevadm trigger --type=devices --action=change

  查看

[root@ht01 asm]# ls -lrt
总用量 0
brw-rw---- 1 grid asmadmin 8, 16 7月   3 00:38 asm_vote1
brw-rw---- 1 grid asmadmin 8, 32 7月   3 00:45 asm_vote2
brw-rw---- 1 grid asmadmin 8, 48 7月   3 00:45 asm_vote3
brw-rw---- 1 grid asmadmin 8, 80 7月   3 00:45 asm_data2
brw-rw---- 1 grid asmadmin 8, 96 7月   3 00:45 asm_data3
brw-rw---- 1 grid asmadmin 8, 64 7月   3 00:45 asm_data1
[root@ht01 asm]# pwd
/dev/asm

  

linux7 以上uuid绑定裸设备

上一篇:操作系统第四次实验报告——文件系统之使用LinuxAPI实现ls -lai命令


下一篇:Code Walkthroughs Table API