Rhel 7.x uses Udev SCSI rules to configure RAW devices

Source: Internet
Author: User
Tags symlink

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.