Saturday, August 16, 2008

On RHL5 rawdevices: unrecognized service

On you RHL4 you can use the rawdevices service by enabling via,
# chkconfig --level 345 rawdevices on

But on RHL5 it shows the error message like,
[root@racnode-1 ~]# service rawdevices start
rawdevices: unrecognized service

Check your linux version by,
[root@racnode-1 ~]# uname -a
Linux racnode-1 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

This is because that raw device technology had been deprecated in RedHat Linux 5 (RHEL5) and Oracle Enterprise Linux 5 OEL5). / Linux Kernel 2.6

As we see this is linux version EL5 and kernel 2.6, so rawdevices technology had been deprecated.

So you may think can we use rawdevices into RHEL5 or OEL5? In fact rawdevice is enabled on RHL4 by
# chkconfig --level 345 rawdevices on

The answer is yes you can still use the disk partition by means of UDEV technique and Oracle 11g & 10gR2 has options to configure components to access the block devices directly instead of rawdevices.

You might be curious why RHL4 can do and why RHL5 can't. This is beacuse in RHEL5 and OEL5 there is missing,

1. /etc/sysconfig/rawdevices file.
2. /dev/raw file.
3. Service by the name "rawdevices".


So, trying to run the command "service rawdevices restart" will result in "rawdevices: unrecognized service".

In my blog there is shown how to do it if you use RHL4.

To make access of disk block devices in RHL5/OEL5,

Step 1: Make an entry in /etc/udev/rules.d/60-raw.rules or create your own file for example ., /etc/udev/rules.d/-oracle-raw.rules (eg. 63-oracle-raw.rules)

Here I made like this,
#vi /etc/udev/rules.d/63-oracle-raw.rules
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"
KERNEL=="raw[1-2]*", OWNER="root", GROUP="oinstall", MODE="640"
KERNEL=="raw[3-5]*", OWNER="oracle", GROUP="oinstall", MODE="644"


So our sdb1 will be recognized as /dev/raw/raw1, sdb2 will be as /dev/raw/raw2 and so on.

Step 2: For the mapping to have immediate effect, run below command

#/bin/raw /dev/raw/raw1 /dev/sdb1
/bin/raw /dev/raw/raw2 /dev/sdc1
/bin/raw /dev/raw/raw3 /dev/sdd1
/bin/raw /dev/raw/raw4 /dev/sde1
/bin/raw /dev/raw/raw5 /dev/sdf1


Step3: Adjust the permission settings by,
chown root:oinstall /dev/raw/raw1
chown root:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chown oracle:oinstall /dev/raw/raw4
chown oracle:oinstall /dev/raw/raw5
chmod 640 /dev/raw/raw1
chmod 640 /dev/raw/raw2
chmod 640 /dev/raw/raw3
chmod 640 /dev/raw/raw4
chmod 640 /dev/raw/raw5


Related Documents
Configure Shared Storage in Oracle RAC installation

No comments:

Post a Comment