In RHEL and OEL 5, entries must be made under
the rules specified in
/etc/udev.
Udev is responsible for managing the
/dev area in Linux, and udev rules
determine how
/dev will be presented.
While
/bin/raw can be used to bind a
block device to a raw device,
/bin/raw binding alone is not
meant to be a long-term configuration.
One of the primary purposes of udev is to
keep disk areas and naming consistent.
To create a udev rule that maps block device
/dev/sda1 to raw device
/dev/raw1:
-
Create a file called:
/etc/udev/rules.d/60-raw.rules
-
Any number greater than or equal to 60 may
be used
-
Add the line:
ACTION==”add”, “KERNEL==”sda1”,
RUN+=”/bin/raw /dev/raw/raw1 %N”
-
Despite this ability, in Oracle 11g there is
really no point in creating
/dev/raw devices unless it is
being done for comfort value.
This is because in Oracle 10.2.0.2
up, block devices are accessible by Oracle
using the O_DIRECT flag, meaning they are
able to perform direct I/O without using the
rawio interface.
OUI and ASMlib will both accept a
block device (i.e.
/dev/sda1) as input for file
placement in Oracle 11g on Linux.
Note:
In 10gR2, even though Oracle allowed block
devices to be used in 10.2.0.2 and up, OUI
was not able to handle a block device name.
Instead, symbolic links had to be
created to map the block device to a
different name under /dev.
While effective, this does not follow
the udev rules.
Even with direct support for block devices, in
order to configure a block device for Oracle’s
use, udev rules
must still be created.
Since udev manages the
/dev area, the rules will need to
state ownership of the block devices in order to
grant Oracle the permissions necessary to use
them.
-
Edit the file:
/etc/udev/rules.d/50-udev.rules
-
At the bottom of the file, add the new rules
in the following format:
KERNEL==”blockdevicename”,
OWNER=”deviceowner”, GROUP=”devicegroup”,
MODE=”4digitpermissions”
-
Block device name
- the name of the block device.
For instance, if the device is listed
as
/dev/sda1, the block device
name is sda1.
-
Device owner
- should be set to the name of the OS user
that will own the block device.
For instance, if the device is going
to be used for placement of the OCR, root
should be the owner.
For the voting disk or ASM disks,
oracle should be the owner.
-
Device group
- should be set to the name of the group
which owns the block device.
This will usually be oinstall or dba.
-
4digitpermissions
-
should be set to the permissions mask of the
block device.
For the OCR and ASM devices this will
be 0640.
For the voting disk, it will usually
be 0644.
It is important to note that even though Oracle
is writing to a block device instead of a raw
device, this is still technically raw storage.
Instead of using the rawio interface,
a direct interface to the block device has been
provided by the Linux kernel and Oracle.
The limitations of raw are still a factor when
writing to block devices.
Only one file may be present on any
single block device when the device is
unformatted.
Creating the OCR and voting disk on block
devices is a popular option, as the only other
storage method available is a cluster file
system such as OCFS2 which presents yet another
layer of dependency for an Oracle installation.
For datafiles, control files, SPFILEs,
redo logs, RMAN backups, and archive logs, ASM
is the new de facto standard for RAC storage.