xzh2000的博客 本人提供杭州地区Oracle现场技术支持服务,包括性能调整、DataGuard、RAC等。
10 08, 2006
Linux 2.6 deprecation of raw devices
作者 xzh2000 11:32 | Permalink 静态链接网址 | Comments 最新回复 (0) | Trackback 引用 (0) | 技术交流

DEPRECATION OF RAW DEVICES IN LINUX 2.6 KERNELS
-----------------------------------------------

Starting with the 2.6 Linux kernel, raw devices are being phased
out in favor of O_DIRECT access directly to the block devices.

With Oracle RDBMS 10.2.0.2 and higher, block devices can be accessed via
any of the following methods, and utilized by RDBMS:

- Directly to the block device
- Via ASMLib mapped devices
- OCFS2 devices (Note: OCFS2 is still Pending Certification)
- LVM2 mapped devices if single-instance


SCRIPT TO MIGRATE RAW TO BLOCK DEVICES
--------------------------------------

Moving from RAW devices to O_DIRECT opened block devices is simple.
Just link the raw device files which used to exist to their corresponding
block device. For example, instead of running "raw /dev/raw/raw5 /dev/sdc1"
the should do "ln -s /dev/sdc1 /dev/raw/raw5".

This can be automated from the /etc/sysconfig/rawdevices file via the
following script:

#!/usr/bin/env perl
/^s*#/ and next;

/^(S+)s+(d+)s+(d+)/ and do {
my ($rawname, $major, $minor) = ($1, $2, $3);
$syspath = qx!find /sys/block -name dev | xargs grep -l "^$major:$minor$" !;
@pathelem = split '/', $syspath;
print "ln -s /dev/$pathelem[$#pathelem-1] $rawname";
} or
/^(S+)s+(S+)/ and print "ln -s $2 $1";

Save script as rawfinder.pl and run it with:

$ perl rawfinder.pl /etc/sysconfig/rawdevices

This will print out the list of symlinks to create.

REFERENCES
----------

Notes in /etc/sysconfig/rawdevices as follows, from a RHEL4 system:

# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format: <rawdev> <major> <minor>
# <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5

Comments
博客日历
« 三月 2010 »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
搜索
最新发表
文章分类
文章归档
网站链接
新闻聚合