Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-18-2009, 05:14 PM   #1
LQ Newbie
Registered: Jul 2009
Posts: 9

Rep: Reputation: 0
Difference between using Raw block device with O_DIRECT and Raw Character Device


I am running a Sybase Database (version 15.0.3 64-bit) on RHEL 5.3 using LVM Raw Block devices. Basically, Sybase would open the devices using O_DIRECT. I also tried mapping the same Block devices to raw devices (/dev/raw/rawN) and did a database load test to compare the IO speed between Block device with O_DIRECT and raw devices. Noticed that the raw character device database load was faster than the block device with DirectIO. Even though, I used the same set of devices, not sure why there is a difference in IO speed. Will the Linux kernel use different drivers for Block Devices opened with O_DIRECT and Raw character devices? Any suggestions would be greatly appreciated.

Old 08-19-2009, 10:52 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,824
Blog Entries: 15

Rep: Reputation: 1667Reputation: 1667Reputation: 1667Reputation: 1667Reputation: 1667Reputation: 1667Reputation: 1667Reputation: 1667Reputation: 1667Reputation: 1667Reputation: 1667
I can't give details but O_DIRECT and raw are certainly two different things. We've run Oracle RAC on OCFS (Oracle Cluster Filesystem) which uses O_DIRECT on RHEL3 and on ASM on raw devices on RHEL5.

Performance isn't necessarily the biggest concern however. According to later documentation raw devices are deprecated in Linux and may be removed completely in future versions of the kernel. I chose ASM on raw for my RHEL5 install or RAC because most of their documentation was written for RHEL4. It wasn't until I ran across an OCFS2 (which also does O_DIRECT) that I found a suggestion from Oracle to use that instead of ASM on raw because of the deprecation.

I'm not sure why the kernel team feels O_DIRECT is better than raw to the point they'd actually think about taking the latter option away.

By the way - in the above the O_DIRECT is on OCFS filesystems rather than simply on the block devices. I wonder if Sybase has an equivalent filesystem (or even uses the open source OCFS2) that somehow optimizes use of O_DIRECT?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Character/Raw Device Files SBN Linux - General 1 05-18-2008 04:48 PM
writing raw data to a block device nacio Linux - Software 4 05-17-2007 10:37 PM
Difference between Block device and Character device quartslove Fedora 2 11-29-2006 08:50 PM
find hex patterns in raw hdd block device dtimms Linux - Software 6 01-04-2006 05:52 AM
block device raw access rvilarl Programming 0 10-24-2004 12:53 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration