Red Hat Raw Device Administration

Red Hat Enterprise Linux is fully equipped with the tools to set up raw devices and administer them during a system start-up.How you set up a Red Hat Enterprise Linux system to administer partitions depends on what version of Red Hat Enterprise Linux you are using.

Red Hat Enterprise Linux System Running Release 3 or 4

Administer the partitions using the /etc/sysconfig/rawdevices file. This is a plain text file that contains comments and examples for possible configurations:
# raw device bindings
# format: rawdev major minor
#         rawdev blockdev
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sdd1
/dev/raw/raw2 /dev/sdd2
/dev/raw/raw3 /dev/sdd3
/dev/raw/raw4 /dev/sdd4
  1. Create the raw devices.
  2. Bind the raw devices by starting them from /etc/rc.d/init.d/rawdevices:
    [root@legolas init.d]# cd /etc/rc.d/init.d
    [root@legolas init.d]# sh rawdevices start
    Assigning devices:
    /dev/raw/raw1  -->   /dev/sdd5
         /dev/raw/raw1:     bound to major 3, minor 5
    /dev/raw/raw2  -->   /dev/sdd6
         /dev/raw/raw2:     bound to major 3, minor 6
    /dev/raw/raw3  -->   /dev/sdd7
         /dev/raw/raw3:     bound to major 3, minor 7
    /dev/raw/raw4  -->   /dev/sdd8
         /dev/raw/raw4:     bound to major 3, minor 8
    done
  3. To guarantee that the raw device binding occurs during any restart, use the chkconfig(8) utility:
    # /sbin/chkconfig rawdevices on

Red Hat Enterprise Linux System Running Release 5 or Later

To set up a Red Hat Enterprise Linux system running release 5 or newer for raw devices, modifications need to be made to the /etc/udev/rules.d/60-raw.rules file. This is a plain text file that contains comments and examples for possible configurations:
# Enter raw device bindings here.
#
# An example would be:
#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.
ACTION=="add", KERNEL=="sdb5", OWNER=="sybase",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb6", OWNER=="sybase",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdb7", OWNER=="sybase",RUN+="/bin/raw /dev/raw/raw3 %N"