For Linux platforms the LUNs presented from a SAN, NAS or SCSI devices are
identified with the path /dev/sdX. (/dev/sda, dev/sdb, etc). There is a common
issue when disks are removed from the system (due to I/O failures), causing a
change in the name (path) or changing the permissions.
Example: having /dev/sda, /dev/sdb, /dev/sdc, if disk /dev/sdb fails on the next
reboot the system will discover /dev/sda and /dev/sdb, but /dev/sdb had the
content originally referenced by /dev/sdc.
Similar situation could apply to disks used by ASM where after the reboot the
disk is not an ASM disk or because the permissions were not correct and the
device can not be read.
ASMLIB is not a problem because it reads the content of the header and creates
the block device under /dev/oracleasm/disks after finding the correct ASMLIB
label and adjust the correct permissions.
The solution to avoid this type of situations is to guarante concistent names for
the devices and correct permissions through reboots. Linux 2.6 introduced udev
as a mechanism to dynamically manage all type of devices, including disks.
This document presents how to configure udev and create persistent names and
use these names in a RAC configuration, for OCR, Voting disks and ASM disks.
udev provides a dynamic device directory containing only the files for actually
present devices. It creates or removes device node files usually located in the
/dev directory, or it renames network interfaces.
These attributes may be used as keys to determine a unique name for the
device. udev maintains a database for devices present on the system. On
device removal, udev queries its database for the name of the device file to be
deleted.
Configuring udev
[root@jfrac2 udev]# ls
devices permissions.d rules.d scripts udev.conf
The rules basically determine how to identify the disks and how to assign the
name that will be persistent through reboots or disk changes. The rule consist of
different fields:
BUS Match the bus type of the device. (The sysfs device bus must be able to
be determined by a "device" symlink. Examples of BUS will be scsi, usb
KERNEL Match the kernel device name. This is basically the name assgined by
the system to the device. LUNs usually are named /dev/sdX.
PROGRAM Call external program. This key is valid if the program returns
successful. The environment variables of udev are also available for the
program.
RESULT Match the returned string of the last PROGRAM call. This key may be
used in any following rule after a PROGRAM call.
NAME The name of the node to be created, or the name, the network interface
should be renamed to.
The program used to identify the unique disk is scsi_id which will report the
UUID name of the disk. This is a unique identification name for every disk.
To obtain this unique identifier, execute scsi_id -g -s /block/sdc. This is the value
to be used on the RESULT field. Replace sdc with every disk present on the
box.
The other field BUS, for LUNS presented to the machine (SAN,NAS,scsi) the
value is scsi.
The KERNEL field has the name used by the system. This example will search
all the sd devices, specifically the 10th partition. When the value specified under
result filed matches the value returned by scsi_id command, then a block device
/dev/ocr will be created.
“If applicable, make sure you identify the difference between sdX and
sdX1. This can be done with the key KERNEL="sd?1" to match sdX1, or
KERNEL=="sd?" to match sdX.”
In this test were used 4 disks of 9gb each, creating around 10 slices of 1gb on
each disk. In a production environment there is not recommended having
multiple slices on the same disk, so the value for kernel field will be sd?1 or sd?
only.
A common error is that after rebooting the server, the database or CRS can not
be started and the diagnostic shows the cause was permissions of the devices.
Udev protects against this type of situations.
Example:
voting:usupport:dba:0660
ocr:root:dba:0640
asmdisk*:usupport:dba:0660
Starting on this release, there is not need to manage the rules and permissions
on different directories/files. The permissions are defined as part of the rule
under /etc/udev/rules.d.
Also there was a change on how to define the rules. Now, UDEV clauses with
"==" are attribute comparisions and clauses with "=" are attribute assignments.
# options=-b
options=-g
Before creating the rules, obtain the UUID for each device:
That message will be repeated for every rule specified within file
/etc/udev/rules.d/50-udev.rules file.
Configuration
Installting CRS and not recognizing the voting disk and ocr
Installing Oracle Clusterware get an error because the API used by Oracle
Installer does not recognize block devices, only character devices (/dev/raw/raw).
Bug 5196176
Before starting the installation, bind the paritition used by OCR and Voting
disks to the raw device.
At the last stage of the installation, it requires executing shell script
$ORA_CRS_HOME/root.sh. Before executing this shell, modify file
$ORA_CRS_HOME/install/rootconfig.sh.
CRS_OCR_LOCATIONS=/dev/raw/raw1
CRS_VOTING_DISKS=/dev/raw/raw2
CRS_OCR_LOCATIONS=/dev/ocr
CRS_VOTING_DISKS=/dev/voting
/etc/udev/permissions.d/50-udev.permissions (before
OEL5/RHEL5/SLES10)
voting:usupport:dba:0660
ocr:root:dba:0640
asmdisk*:usupport:dba:0660
May 2006
Author: Jaime Figueroa
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Worldwide Inquiries:
Phone: +1.650.506.7000
Fax: +1.650.506.7200
oracle.com
Copyright © 2006, Oracle. All rights reserved.
This document is provided for information purposes only and the
contents hereof are subject to change without notice.
This document is not warranted to be error-free, nor subject to any
other warranties or conditions, whether expressed orally or implied
in law, including implied warranties and conditions of merchantability
or fitness for a particular purpose. We specifically disclaim any
liability with respect to this document and no contractual obligations
are formed either directly or indirectly by this document. This document
may not be reproduced or transmitted in any form or by any means,