UDEV SCSI Rules Configuration In Oracle Linux 5, 6 and 7 For Oracle Automatic Storage Man

本文详细介绍了在Redhat6环境下如何配置Udev来确保Oracle Automatic Storage Manager (ASM)能一致地识别和正确设置共享存储磁盘的所有权及权限。文中提供了针对不同Redhat版本的具体配置步骤。

Redhat 6环境下Udev相比之前发生了一些变化,因此转载一片文档用以记录

先在节点A对共享存储的磁盘进行分区

fdisk /dev/sdb

n / p / w

new, primary partition, save

之后在另一个节点B刷新并查询分区的信息

partprobe -s

fdisk /dev/sdb



UDEV SCSI Rules Configuration In OracleLinux 5, 6 and 7

 

For Oracle Automatic Storage Manager (ASM)to use disks, it needs to be able to identify the devices consistently and forthem to have the correct ownership and permissions. In Linux you can use ASMLibto manage these tasks, but it is seen as an additional layer of complexity andhas never really gained any popularity. Instead, many people use the Linuxdevice manager "udev" to perform these tasks. This article presents abrief overview of setting up udev rules with respect to disks for use with ASMin Oracle 11g. The examples are all done using Oracle Linux 5, 6 and 7, so theywill be consistent with RHEL and CentOS 5, 6 and 7.

 

    Background

   Identify the Disks (/sbin/scsi_id)

   Make SCSI Devices Trusted

   Create UDEV Rules File

   Load Updated Block Device Partitions (/sbin/partprobe)

   Test Rules (udevtest)

   Restart UDEV Service

   Check Ownership and Permissions

 

Background

 

Essentially, what udev does is apply rulesdefined in files in the "/etc/udev/rules.d" directory to the devicenodes listed in the "/dev" directory. The rules can be defined in avariety of ways, but what we need to do is identify the device and say what wewant udev to do with it.

 

In this case I know all my disk devices arenamed "/dev/sd?1", where the "?" represents a letter froma-d, so I can identify the devices of interest using the following ruleparameters.

 

KERNEL=="sd?1",BUS=="scsi"

 

I want to tie each specific device to analias, so it is always identified the same way, regardless of the device nameLinux assigns it. So I need to be able to test each device that matches theprevious pattern to see if it is the disk I am interested in. Each disk has aunique SCSI ID, so I can place a test into the rule, telling it how to performthe test, and the result it should return for a positive match. The followingrule parameters explain how to test the device and what result constitutes a matchin Oracle Linux 5.

 

PROGRAM=="/sbin/scsi_id -g -u -s/block/$parent",RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_"

 

The scsi_id command works a littledifferently in Oracle Linux 6, so for that the following test works better.

 

PROGRAM=="/sbin/scsi_id -g -u -d/dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_"

 

The scsi_id command is located in adifferent place in Oracle Linux 7, so for that the following test is correct.

 

PROGRAM=="/usr/lib/udev/scsi_id -g -u-d /dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_"

 

Once we have identified the specific deviceof interest, we need to indicate what actions should be performed on it. Thefollowing parameters specify an alias, the ownership and the permissions forthe device.

 

NAME="asm-disk1",OWNER="oracle", GROUP="dba", MODE="0660"

 

So the whole rule for each disk will looksomething like this in Oracle Linux 5.

 

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s/block/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",NAME="asm-disk1", OWNER="oracle", GROUP="dba",MODE="0660"

 

Or this in Oracle Linux 6.

 

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d/dev/$parent",RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",NAME="asm-disk1", OWNER="oracle", GROUP="dba",MODE="0660"

 

Or this in Oracle Linux 7.

 

KERNEL=="sd?1",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d/dev/$parent",RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba",MODE="0660"

 

This means that the device pointing to thepartition "sd*1" on the disk with the SCSI ID of"SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_" will always be called"/dev/asm-disk1", regardless of the letter "?" Linux assignswhen the device is discovered. In addition, the device will have the correctownership and permissions for ASM.

 

There are a number of wildcards andmatching patterns that can be used if you don't want to write device-specificrules.

 

Now we know roughly what we are trying toachieve, we will look at each step necessary for setting up the disks for ASMto use.

Identify the Disks (/sbin/scsi_id)

 

We are going to write device-specificrules, so we need to be able to identify each device consistently, irrespectiveof the order in which Linux discovers it. To do this we are going to use theSCSI ID for each disk (not the partition), which we get using the scsi_idcommand. The "-s" option makes the paths relative to the"/sys" directory. For Oracle Linux 5, use the following command.

 

# /sbin/scsi_id -g -u -s /block/sdb

SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_

# /sbin/scsi_id -g -u -s /block/sdc

SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_

# /sbin/scsi_id -g -u -s /block/sdd

SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_

# /sbin/scsi_id -g -u -s /block/sde

SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_

#

 

The "-s" is not available inOracle Linux 6, so you must use the following syntax.

 

# /sbin/scsi_id -g -u -d /dev/sdb

SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_

# /sbin/scsi_id -g -u -d /dev/sdc

SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_

# /sbin/scsi_id -g -u -d /dev/sdd

SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_

# /sbin/scsi_id -g -u -d /dev/sde

SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_

#

 

The location of the scsi_id command haschanged in Oracle Linux 7, so you must use the following syntax.

 

# /usr/lib/udev/scsi_id -g -u -d /dev/sdb

SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_

# /usr/lib/udev/scsi_id -g -u -d /dev/sdc

SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_

# /usr/lib/udev/scsi_id -g -u -d /dev/sdd

SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_

# /usr/lib/udev/scsi_id -g -u -d /dev/sde

SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_

#

 

Make SCSI Devices Trusted

 

Add the following to the"/etc/scsi_id.config" file to configure SCSI devices as trusted.Create the file if it doesn't already exist.

 

options=-g

 

Create UDEV Rules File

 

Create the"/etc/udev/rules.d/99-oracle-asmdevices.rules" file.

 

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

 

The file should contain the following linesfor Oracle Linux 5. The PROGRAM parameter must match the command you used toretrieve the SCSI ID, and the RESULT parameter must match the value returnedfrom your disks.

 

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s/block/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",NAME="asm-disk1", OWNER="oracle", GROUP="dba",MODE="0660"

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s/block/$parent",RESULT=="SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_",NAME="asm-disk2", OWNER="oracle", GROUP="dba",MODE="0660"

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s/block/$parent",RESULT=="SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_",NAME="asm-disk3", OWNER="oracle", GROUP="dba",MODE="0660"

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$parent",RESULT=="SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_",NAME="asm-disk4", OWNER="oracle", GROUP="dba",MODE="0660"

 

The equivalent for Oracle Linux 6 is shownbelow.

 

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d/dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",NAME="asm-disk1", OWNER="oracle", GROUP="dba",MODE="0660"

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d/dev/$parent",RESULT=="SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_",NAME="asm-disk2", OWNER="oracle", GROUP="dba",MODE="0660"

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d/dev/$parent",RESULT=="SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172_",NAME="asm-disk3", OWNER="oracle", GROUP="dba",MODE="0660"

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d/dev/$parent",RESULT=="SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_",NAME="asm-disk4", OWNER="oracle", GROUP="dba",MODE="0660"

 

The equivalent for Oracle Linux 7 is shownbelow.

 

KERNEL=="sd?1",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d/dev/$parent",RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_",SYMLINK+="asm-disk1", OWNER="oracle",GROUP="dba", MODE="0660"

KERNEL=="sd?1",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d/dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VB46dec7e0-192e8000_",SYMLINK+="asm-disk2", OWNER="oracle",GROUP="dba", MODE="0660"

KERNEL=="sd?1",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d/dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBce8c63bb-ac67a172",SYMLINK+="asm-disk3", OWNER="oracle",GROUP="dba", MODE="0660"

KERNEL=="sd?1",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d/dev/$parent",RESULT=="SATA_VBOX_HARDDISK_VB7437a3b7-95b199cd_",SYMLINK+="asm-disk4", OWNER="oracle", GROUP="dba",MODE="0660"

 

Load Updated Block Device Partitions(/sbin/partprobe)

 

Load updated block device partition tables.

 

# /sbin/partprobe /dev/sdb1

# /sbin/partprobe /dev/sdc1

# /sbin/partprobe /dev/sdd1

# /sbin/partprobe /dev/sde1

 

Test Rules (udevtest)

 

Test the rules are working as expected.

 

# #OL5

# udevtest /block/sdb/sdb1

# udevtest /block/sdc/sdc1

# udevtest /block/sdd/sdd1

# udevtest /block/sde/sde1

 

# #OL6 and OL7

# udevadm test /block/sdb/sdb1

# udevadm test /block/sdc/sdc1

# udevadm test /block/sdd/sdd1

# udevadm test /block/sde/sde1

 

The output from the first disk should looksomething like this.

 

# udevtest /block/sdb/sdb1

main: looking at device '/block/sdb/sdb1'from subsystem 'block'

udev_rules_get_name: add symlink'disk/by-id/scsi-SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3-part1'

udev_rules_get_name: add symlink'disk/by-path/pci-0000:00:0d.0-scsi-1:0:0:0-part1'

run_program: '/lib/udev/vol_id --export/dev/.tmp-8-17'

run_program: '/lib/udev/vol_id' returnedwith status 4

run_program: '/sbin/scsi_id -g -u -s/block/sdb/sdb1'

run_program: '/sbin/scsi_id' (stdout)'SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_'

run_program: '/sbin/scsi_id' returned withstatus 0

udev_rules_get_name: rule applied, 'sdb1'becomes 'asm-disk1'

udev_device_event: device '/block/sdb/sdb1'already in database, validate currently present symlinks

udev_node_add: creating device node'/dev/asm-disk1', major = '8', minor = '17', mode = '0660', uid = '1100', gid ='1200'

udev_node_add: creating symlink'/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3-part1' to'../../asm-disk1'

udev_node_add: creating symlink'/dev/disk/by-path/pci-0000:00:0d.0-scsi-1:0:0:0-part1' to '../../asm-disk1'

main: run:'socket:/org/kernel/dm/multipath_event'

main: run:'socket:/org/kernel/udev/monitor'

main: run: '/lib/udev/udev_run_devd'

main: run:'socket:/org/freedesktop/hal/udev_event'

main: run: '/sbin/pam_console_apply/dev/asm-disk1/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3-part1/dev/disk/by-path/pci-0000:00:0d.0-scsi-1:0:0:0-part1'

#

 

Restart UDEV Service

 

Restart the UDEV service.

 

# #OL5

# /sbin/udevcontrol reload_rules

 

# #OL6 and OL7

# udevadm control --reload-rules

 

# #OL5 and OL6 : Not needed for OL7

# /sbin/start_udev

 

Check Ownership and Permissions

 

Check the disks are now available with the"asm-disk*" alias and the correct ownership and permissions.

 

# cd /dev

# ls -al asm-disk*

brw-rw---- 1 oracle dba 8, 17 Apr  8 22:47 asm-disk1

brw-rw---- 1 oracle dba 8, 33 Apr  8 22:47 asm-disk2

brw-rw---- 1 oracle dba 8, 49 Apr  8 22:47 asm-disk3

brw-rw---- 1 oracle dba 8, 65 Apr  8 22:47 asm-disk4

#

 

So the ASM_DISKSTRING initializationparameter in the ASM instance can be set to '/dev/asm-disk*' to identify theASM disks.

 

For more information see:

 

   udev

   Configuring Disk Devices Manually for Oracle ASM

 

Hope this helps. Regards Tim...

 

Back to the Top.

 


本项目构建于RASA开源架构之上,旨在实现一个具备多模态交互能力的智能对话系统。该系统的核心模块涵盖自然语言理解、语音转文本处理以及动态对话流程控制三个主要方面。 在自然语言理解层面,研究重点集中于增强连续对话中的用户目标判定效能,并运用深度神经网络技术提升关键信息提取的精确度。目标判定旨在解析用户话语背后的真实需求,从而生成恰当的反馈;信息提取则专注于从语音输入中析出具有特定意义的要素,例如个体名称、空间位置或时间节点等具体参数。深度神经网络的应用显著优化了这些功能的实现效果,相比经典算法,其能够解析更为复杂的语言结构,展现出更优的识别精度与更强的适应性。通过分层特征学习机制,这类模型可深入捕捉语言数据中隐含的语义关联。 语音转文本处理模块承担将音频信号转化为结构化文本的关键任务。该技术的持续演进大幅提高了人机语音交互的自然度与流畅性,使语音界面日益成为高效便捷的沟通渠道。 动态对话流程控制系统负责维持交互过程的连贯性与逻辑性,包括话轮转换、上下文关联维护以及基于情境的决策生成。该系统需具备处理各类非常规输入的能力,例如用户使用非规范表达或对系统指引产生歧义的情况。 本系统适用于多种实际应用场景,如客户服务支持、个性化事务协助及智能教学辅导等。通过准确识别用户需求并提供对应信息或操作响应,系统能够创造连贯顺畅的交互体验。借助深度学习的自适应特性,系统还可持续优化语言模式理解能力,逐步完善对新兴表达方式与用户偏好的适应机制。 在技术实施方面,RASA框架为系统开发提供了基础支撑。该框架专为构建对话式人工智能应用而设计,支持多语言环境并拥有活跃的技术社区。利用其内置工具集,开发者可高效实现复杂的对话逻辑设计与部署流程。 配套资料可能包含补充学习文档、实例分析报告或实践指导手册,有助于使用者深入掌握系统原理与应用方法。技术文档则详细说明了系统的安装步骤、参数配置及操作流程,确保用户能够顺利完成系统集成工作。项目主体代码及说明文件均存放于指定目录中,构成完整的解决方案体系。 总体而言,本项目整合了自然语言理解、语音信号处理与深度学习技术,致力于打造能够进行复杂对话管理、精准需求解析与高效信息提取的智能语音交互平台。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值