1. Generate Rule File Touch/etc/udev/rules.d/99-oracle-asmdevices.rules
Or
Touch/usr/lib/udev/rules.d/99-oracle-asmdevices.rules
2. Generate rules
The SDB is not partitioned to execute the following shell script,
For i in B;
Todo
echo "kernel==\" sd*\ ", subsystem==\" Block\ ", program==\"/usr/lib/udev/scsi_id--whitelisted- Device=/dev/\ $name \ ", result==\" '/usr/lib/udev/scsi_id--whitelisted--replace-whitespace ' ", Symlink+=\ "Asm-disk$i\", owner=\ "grid\", group=\ "asmadmin\", mode=\ "0660\" "
Done
The SDB is partitioned to execute the following shell script,
For I in B1 B2
Todo
echo "kernel==\" sd$i\ ", subsystem==\" Block\ ", program==\"/usr/lib/udev/scsi_id--whitelisted- Device=/dev/\ $parent \ ", result==\" '/usr/lib/udev/scsi_id--whitelisted--replace-whitespace--device=/dev/sd${i:0 : 1} ', symlink+=\ "asm-disk$i\", owner=\ "grid\", group=\ "asmadmin\", mode=\ "0660\" "
Done
Note $name not zoned
$parent for Zoning
3. Copy the results to 99-oracle-asmdevices.rules
Paste the output of the second step into the 99-oracle-asmdevices.rules file
kernel== "sd*", subsystem== "block", program== "/usr/lib/udev/scsi_id,--whitelisted--replace-whitespace--device=/dev /$name ", result==" 36000c2948ef9d9e4a7937bfc65888bc8 ", name=" ASM-DISKB ", owner=" grid ", group=" Asmadmin ", MODE=" 0660 "
Load updated block device partition tables.
#/SBIN/PARTPROBE/DEV/SDB
Note:
Get result
Under Linux 7, you can use the following command:
#/usr/lib/udev/scsi_id-g-u/dev/sdb
Under Linux 6, you can use the following command:
#/sbin/scsi_id-g-u/dev/sdb
Under Linux 5, you can use the following command:
#/sbin/scsi_id-g-u-s/block/sdb/sdb
4. Use Udevadm to test, note udevadm command does not accept/DEV/SDC such a mount device name, must be the use of/sys/block/sdb, such as the original device name.
Udevadm Test/sys/block/sdb
Udevadm Info--query=all--path=/sys/block/sdb
Udevadm Info--query=all--NAME=ASM-DISKB
5. Start Udev
/usr/sbin/udevadm Control--reload-rules
Systemctl Status Systemd-udevd.service
Systemctl Enable Systemd-udevd.service
6. Check that the device is properly bound
# ls-l/dev/asm*/dev/sdb
lrwxrwxrwx 1 root 3 Nov 18:17/dev/asm-diskb-> SDB
BRW-RW----1 grid asmadmin 8 Nov 18:17/dev/sdb