ASM, Oracle RAC and Raw Devices

Raw devices on not supported in Oracle11gR1 and R2 installer when ASM comes up. They are not allowed in Oracle12c.

Raw Partitions

I’m attempting to create raw partitions in Linux on two disks, with 4 partitions on each disk, one set for primary and the other for failover. In Linux do this on install – or an easier way is using the parted command.

parted

When in use the following:

print all

to display all partitions

select

to pick /dev/hda,b,c,d

rm NUMBER

to remove a partition (be careful with the boot sector and the Linux installation)

mkpart PRIMARY n m

where m=1000 for 1Gb

mkpart PRIMARY m+1 o

I can examine the partitions in parted:

[root@nas1 init.d]# parted
GNU Parted 1.8.1
Using /dev/hda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/hdb
Using /dev/hdb
(parted) print

Model: ST340014A (ide)
Disk /dev/hdb: 40.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1000kB  10.0GB  9999MB  primary
 2      10.0GB  20.0GB  9999MB  primary
 3      20.0GB  30.0GB  9999MB  primary
 4      30.0GB  40.0GB  9999MB  primary

(parted)

Or using fdsk:

[root@nas1 init.d]# fdisk /dev/hdd

The number of cylinders for this disk is set to 30515.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): print

Disk /dev/hdd: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1               1        1216     9764649   83  Linux
/dev/hdd2            1216        2432     9764649   83  Linux
/dev/hdd3            2432        3648     9764649   83  Linux
/dev/hdd4            3648        4864     9764649   83  Linux

Command (m for help):

Now configure the raw devices for use in /etc/sysconfig/rawdevices:

# raw device bindings
# format:    
#           
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/hdb1
/dev/raw/raw2 /dev/hdb2
/dev/raw/raw3 /dev/hdb3
/dev/raw/raw4 /dev/hdb4
/dev/raw/raw5 /dev/hdd1
/dev/raw/raw6 /dev/hdd2
/dev/raw/raw7 /dev/hdd3
/dev/raw/raw8 /dev/hdd4

Now that the raw devices are created, bind them by starting them from /etc/rc.d/init.d/rawdevices:

cd /etc/rc.d/init.d
sh rawdevices start

This is what you should see:

[root@nas1 ~]# cd /etc/rc.d/init.d
[root@nas1 init.d]# sh rawdevices start
Assigning devices:
           /dev/raw/raw1  -->   /dev/hdb1
/dev/raw/raw1:  bound to major 3, minor 65
           /dev/raw/raw2  -->   /dev/hdb2
/dev/raw/raw2:  bound to major 3, minor 66
           /dev/raw/raw3  -->   /dev/hdb3
/dev/raw/raw3:  bound to major 3, minor 67
           /dev/raw/raw4  -->   /dev/hdb4
/dev/raw/raw4:  bound to major 3, minor 68
           /dev/raw/raw5  -->   /dev/hdd1
/dev/raw/raw5:  bound to major 22, minor 65
           /dev/raw/raw6  -->   /dev/hdd2
/dev/raw/raw6:  bound to major 22, minor 66
           /dev/raw/raw7  -->   /dev/hdd3
/dev/raw/raw7:  bound to major 22, minor 67
           /dev/raw/raw8  -->   /dev/hdd4
/dev/raw/raw8:  bound to major 22, minor 68
done
[root@nas1 init.d]#

And now to make sure that the raw device binding occurs during any restart:

/sbin/chkconfig rawdevices on

Check after restart using this:

[root@nas1 init.d]# service rawdevices status
/dev/raw/raw1:  bound to major 3, minor 65
/dev/raw/raw2:  bound to major 3, minor 66
/dev/raw/raw3:  bound to major 3, minor 67
/dev/raw/raw4:  bound to major 3, minor 68
/dev/raw/raw5:  bound to major 22, minor 65
/dev/raw/raw6:  bound to major 22, minor 66
/dev/raw/raw7:  bound to major 22, minor 67
/dev/raw/raw8:  bound to major 22, minor 68
[root@nas1 init.d]#

Now add the raw devices to the /etc/exports file:

#/cluster       *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
#/oradata       *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/dev/raw/raw1   *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/dev/raw/raw2   *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/dev/raw/raw3   *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/dev/raw/raw4   *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/dev/raw/raw5   *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/dev/raw/raw6   *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/dev/raw/raw7   *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/dev/raw/raw8   *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

And start the NFS server:

chkconfig nfs on
service nfs restart