Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Appendix A Alternative
Installation Methods [Table of Contents]

Installation Guide Adaptive Server Enterprise for Linux/Intel

[-] Appendix B Creating Raw Partitions

Chapter 11

Creating Raw Partitions

Adaptive Server 12.5 is certified and released on kernel 2.2.14. If you choose to configure your system to use raw partitions on a multi-CPU system, you may get better results with Linux kernel release level 2.2.18, since that is the kernel release that is most stable with raw disk partitions.

Adaptive Server version 12.5.0.1 has been released on kernel 2.4.7-10 in addition to kernel 2.2.14. Sybase recommends that you upgrade to this new release since 2.4.7-10 provides:

Overview

Adaptive Server 12.5 allows you to create and mount its database devices on raw bound devices for raw disk I/O. Raw disk I/O has performance advantages since it enables direct memory access from user address space to the physical sectors on the disk, omitting needless memory copy operations from the user address space to the kernel buffers.

Raw disk I/O also assumes that logical and physical I/O are simultaneous, and writes are guaranteed to flush to the disk when the system write() call returns.

For Red Hat 6.2 distributions, you must use a distribution with kernel 2.2.18, at minimum. Correct kernel errata packages can be downloaded from the Red Hat Web site .

When preparing a raw partition device, follow these guidelines:

To determine whether a device is a block device or a character device, run this command on the /dev/raw directory:

ls -l

"b" (block) or "c" (character) appears in the left-most column.

Choosing a raw partition
  1. Determine which raw partitions are available.

  2. Determine the sizes of the raw partitions.

  3. From the list of available raw partitions, select a raw partition for each device, based on the size recommendations in Table 2-13.

  4. Verify with the operating system administrator that the partition you have chosen is available.

  5. Make sure the "sybase" user has read and write privileges to the raw partition.

    For more information on choosing a raw partition, see your operating system documentation.

Creating the partitions

Specific system administration is required before raw devices can be enabled and used. The available tools to configure devices depend on the distribution.

Physical disk space needs to be allocated in partitions on the disks where you want to set up raw devices. The physical I/O subsystem can be on either SCSI or EIDE devices.

Creating the partitions can be done with the Linux default fdisk(8) utility. You must have "root" privileges to use the command fdisk. Refer to the fdisk(8) man pages for a complete description of the command.

This example shows how to set up partitions as raw devices, on four SCSI disks in the system--sda, sdb, sdc, and sdd.

This sample shows the extended partition (sdd4) has 687104 free blocks, starting from 8013 and ending at 8683. The remaining partitions can be assigned later.

The next example assigns an additional partition for raw bound disk I/O:

  1. Use the n command to create a new partition, and enter "l" at this prompt for logical.

    Command (m for help):n
    Command action
    l   logical (5 or over)
    p   primary partition (1-4)

  2. Accept the default by pressing Enter on the keyboard when you are prompted:

    First cylinder (8013-8683, default 8013):

  3. Accept the default by pressing Enter on the keyboard when you are prompted:

    Last cylinder or +size or +sizeM or +sizeK (8013-8683, default 8683): 8269

  4. Use the t command, enter "5" at this prompt:

    Partition number (1-8):5

  5. Enter "60" at this prompt:

    Hex code (type L to list codes): 60

  6. The output is:

    Changed system type of partition 5 to 60 (Unknown)

  7. Repeat the above steps to create four partitions for raw device I/O.

Verify the setup using p to print the full partition table before writing it out. Make sure that there are no overlapping partitions and the type for the unassigned partitions is Unknown type 60.

The partition table can now be written to disk and you can quit the fdisk(8) utility.

Before continuing, restart your system to verify that the kernel running is in sync with the new disk partition layout. This is reported during system start when probing for disk spindles.

# /sbin/reboot

Binding the partitions for raw disk I/O

Red Hat 6.2 is equipped with the administration tools to setup raw devices but does not setup the raw device bindings during system start. For those environments a script named sybdevices.sh is available from $SYBASE/install/sybdevices.sh. This script contains four arguments:

Follow below steps to administrate your system allowing Adaptive Server to initialize and gain direct access to the device mappings.

  1. Execute $SYBASE/install/sybdevices.sh, and enter:

    show

    The output should be:

        /dev/sdd5      88326 blocks    /dev/sdd6      88326 blocks    /dev/sdd7      48163 blocks    /dev/sdd8      40131 blocks

  2. From the same directory, enter:

    create

    The output should be:

    /dev/raw/raw1 c 162 1
    /dev/raw/raw2 c 162 2
    /dev/raw/raw3 c 162 3
    /dev/raw/raw4 c 162 4

  3. From the same directory, enter:

    bind

    The output should be:

    /dev/raw/raw1:      bound to major 3, minor 8
    /dev/raw/raw2:      bound to major 3, minor 9
    /dev/raw/raw3:      bound to major 3, minor 10
    /dev/raw/raw4:      bound to major 3, minor 11

  4. From the same directory, enter:

    list

    The output should be:

    /dev/raw/raw1:      bound to major 3, minor 8
    /dev/raw/raw2:      bound to major 3, minor 9
    /dev/raw/raw3:      bound to major 3, minor 10
    /dev/raw/raw4:      bound to major 3, minor 11

  5. To guarantee that the raw device binding occurs on any system restart, open an editor on the following file:

    # vi /etc/rc.d/rc.local

  6. Add the following commands to the end of this file:

    export SYBASE=`rpm -q --queryformat '%{installprefix}' sybase-common-12.5`
    $SYBASE/install/sybdevices.sh bind
    $SYBASE/install/sybdevices.sh list

Red Hat 7.2 is fully equipped with the administration tools to set up raw devices and administrate them during system start. To set up a Red Hat 7.2 system the partitions are administrated in the file /etc/sysconfig/rawdevices.

This is a plain text file contains comments and examples for possible configurations, as follows:

# 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. Once created, you need to bind the raw devices. This can be done 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 startAssigning 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

  2. To guarantee that the raw device binding occurs during any restart, use the chkconfig(8) utility.

    # /sbin/chkconfig rawdevices on

Accessing raw devices from Adaptive Sever

Once the partitions are created and the devices are bound for raw disk I/O, Adaptive Server is able to use them. If Adaptive Server is running as user sybase, then apply read, write, and owner permissions to the /dev/raw/raw# device entries and the raw bound control device /dev/rawctl for user sybase.

See the chown(1), chgrp(1), and chmod(1) commands to apply correct permissions.

Using the raw devices, Adaptive Server and the installation and configuration utility, srvbuild, detects and presents their size automatically. Just enter the absolute path to the raw device when creating the master, sybsystemprocs, sybtempdb, or any other device.


Appendix A Alternative
Installation Methods [Table of Contents]