You must know the device or file names of the containers you are going to reference when creating your table spaces. You must know the space associated with each device or file name that is to be allocated to the table space.
Before you set up raw I/O on Linux, you require the following:
• One or more free IDE or SCSI disk partitions
• A raw device controller named /dev/rawctl or /dev/raw. If not, create a symbolic link:
# ln -s /dev/your_raw_dev_ctrl /dev/rawctl
• The raw utility, which is usually provided with the Linux distribution
Note:
Of the distributions currently supporting raw I/O, the naming of raw device nodes is different:
Table 53. Linux distributions supporting raw I/O.
Distribution Raw device nodes Raw device controller
RedHat or TurboLinux /dev/raw/raw1 to 255 /dev/rawctl
SuSE /dev/raw1 to 63 /dev/raw
Procedure
Linux has a pool of raw device nodes that must be bound to a block device before raw I/O can be performed on it. There is a raw device controller that acts as the central repository of raw to block device binding information. Binding is performed using a utility named raw, which is normally supplied by the Linux distributor.
To configure raw I/O on Linux:
In this example, the raw partition to be used is /dev/sda5. It should not contain any valuable data.
Step 1.
Calculate the number of 4 096-byte pages in this partition, rounding down if necessary. For example:
# fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 255 heads, 63 sectors, 1106 cylinders
Units = cylinders of 16065 * 512 bytes
Device boot Start End Blocks Id System
/dev/sda1 1 523 4200997 83 Linux
/dev/sda2 524 1106 4682947+ 5 Extended
/dev/sda5 524 1106 4682947 83 Linux
Command (m for help): q
#
The number of pages in /dev/sda5 is
num_pages = floor( ((1106-524+1)*16065*512)/4096 )
num_pages = 11170736
Step 2.
Bind an unused raw device node to this partition. This needs to be done every time the machine is rebooted, and requires root access. Use raw -a to see which raw device nodes are already in use:
# raw /dev/raw/raw1 /dev/sda5
/dev/raw/raw1: bound to major 8, minor 5
Step 3.
Set appropriate read permissions on the raw device controller and the disk partition. Set appropriate read and write permissions on the raw device.
Partager