Walker News

How To Add Raw Device Mapping In Red Hat Enterprise Linux 5?

Although I can’t remember the detail of steps to create raw device in SCO UNIX for Informix DBMS, I do remember it was a scary process for me as junior administrator.

Then, we moved on to Red Hat Linux 8 Professional. With Red Hat Linux, the process of creating raw device for DB2 database system was pleasant.

However, there was a little change on how to properly and persistently define raw device permission mode, as the database application moved to RHEL4 platform.

Now, Red Hat Enterprise Linux 5 is again introduces different steps to create raw device, as I just came across this in an email subscription related to RHEL5.

On top of the configuration changes, there is even a short note to remind all raw device fans AGAIN that the rawio is deprecated and this interface is scheduled for removal from future releases.

The legacy applications (majority are DBMS) that rely on rawio for performance sake should have code changes to support opening block device with O_DIRECT flag.

How to create raw device mapping in RHEL 5?

According to Red Hat Magazine article, here is the simplified step for my reference when our infrastructure team decides to go ahead with the upgrade of RHEL 4 to RHEL 5.

First, edit /etc/udev/rules.d/60-raw.rules to bind the hard disk to raw device, one line per record of mapping. (Consult Linux man page for udev related information).

There are two ways to define such mapping, but I prefer the easier way. For example, this line defines a mapping of first SCSI hard disk (/dev/sda) to first raw device (/dev/raw/raw1):
ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"

Next, add another line to define a persistent raw device permission mode (if the default permission mode is not suitable for my case):
ACTION=="add", KERNEL=="raw*", OWNER=="root", GROUP=="disk", MODE=="0660"

Lastly, to create the raw devices by executing /sbin/start_udev shell script. To check if the raw devices are created, execute raw -qa

Custom Search

  1. jay 11-02-09@23:54

    i think this new rawdevices behaviour is shitty!!

    in my opinion a lot of people who uses rhel, run oracle on their system, maybe with rawdevices, so why redhat thinks to de-support rawdevices?? also with 1001 workarounds you can get it to work, but it’s much more complicated than in RHEL4 and before…

    And who in the world uses oracle 11g in production, because only then you can use blockdevices instead of rawdevices (without any workarounds)

    although this is an old topic, it still makes me aaaangry!! :D

  2. sanflores 04-10-12@22:39

    Thank you, I could make the raw device persistent on reboot whit this. Running RHEL 6 with Oracle 11 (production)

2017  •  Privacy Policy