![]() | ![]() |
Home |
|
|
Installation Guide Adaptive Server Enterprise for Linux/Intel |
|
| Appendix B Creating Raw Partitions |
Chapter 11
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:
More stable support for raw devices.
Support for large file systems.
Support for asynchronous I/O.
Support for LDAP.
Backup directly to tape devices.
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:
Do not initialize a database device on the partition that contains your Sybase installation software. Doing so destroys all existing files on that partition.
A raw partition designated for use by Sybase cannot be mounted for use by the operating system for any other purpose, such as for file systems or swap space.
After a Sybase configuration utility or the disk init command has initialized a portion of a partition as a database device, the entire partition cannot be used for any other purpose. Any space left on the partition beyond the size specified for the device becomes inaccessible, unless you drop and re-create the device.
For best performance, place the Sybase software and all disk devices, including the master device, on the same machine.
To avoid any possibility of using a partition that contains the partition map, do not use cylinder 0.
Place the database device on a character device, because the Adaptive Server recovery system needs unbuffered system I/O.
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 partitionDetermine which raw partitions are available.
Determine the sizes of the raw partitions.
From the list of available raw partitions, select a raw partition for each device, based on the size recommendations in Table 2-13.
Verify with the operating system administrator that the partition you have chosen is available.
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.
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.
Start fdisk on /dev/sdd:
# fdisk /dev/sdd
The system returns:
The number of cylinders for this disk is set to 8683 .... Command (m for help):
Enter "p" to print the current partition lay-out. The output is:
Disk /dev/sdd: 64 heads, 32 sectors, 8683 cylinders
Units = cylinders of 2048 * 512 bytes
Device Boot Start End Blocks Id System /dev/sdd1 1 7499 7678960 83 Linux /dev/sdd2 7500 8012 525312 82 Linux swap /dev/sdd4 8013 8683 687104 5 Extended
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:
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)
Accept the default by pressing Enter on the keyboard when you are prompted:
First cylinder (8013-8683, default 8013):
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
Use the t command, enter "5" at this prompt:
Partition number (1-8):5
Enter "60" at this prompt:
Hex code (type L to list codes): 60
The output is:
Changed system type of partition 5 to 60 (Unknown)
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
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:
show - all dedicated partitions
create - all dedicated raw device entries
bind - all dedicated raw device entries to their partitions
list - all dedicated raw device bindings
Follow below steps to administrate your system allowing Adaptive Server to initialize and gain direct access to the device mappings.
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
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
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
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
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
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
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
To guarantee that the raw device binding occurs during any restart, use the chkconfig(8) utility.
# /sbin/chkconfig rawdevices on
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.
To verify your settings, query the device binding using the raw command, enter:
$ raw -qa
The output should be:
/dev/raw/raw1: bound to major 3, minor 5/dev/raw/raw2: bound to major 3, minor 6/dev/raw/raw3: bound to major 3, minor 7/dev/raw/raw4: bound to major 3, minor 8
To verify your settings, query the device binding using the permissions command, enter:
<username@servername.sybase.com:4>
raw -qa
The output should be:
Cannot open master raw device '/dev/rawctl' (Permission denied)
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.
|
|