<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to find the raw device file in linux in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392309#M35892</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt; In HP-UX, There is two files available for each disk &lt;BR /&gt;&lt;BR /&gt;     1) block device file "/dev/dsk/c0t5d0"&lt;BR /&gt;     2) raw device file "/dev/rdsk/c0t5d0"&lt;BR /&gt;&lt;BR /&gt;  But in linux only one file available for each disk&lt;BR /&gt;&lt;BR /&gt;    1) block device file "/dev/sda1"&lt;BR /&gt;&lt;BR /&gt;  I want answer for following questions.&lt;BR /&gt;&lt;BR /&gt;  1) is raw device file available defaultly in linux for all disks?&lt;BR /&gt;&lt;BR /&gt;  2) if yes, where it is available.&lt;BR /&gt;&lt;BR /&gt;  3) if not, how to create that file.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 01 Apr 2009 12:35:26 GMT</pubDate>
    <dc:creator>senthil_kumar_1</dc:creator>
    <dc:date>2009-04-01T12:35:26Z</dc:date>
    <item>
      <title>how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392309#M35892</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt; In HP-UX, There is two files available for each disk &lt;BR /&gt;&lt;BR /&gt;     1) block device file "/dev/dsk/c0t5d0"&lt;BR /&gt;     2) raw device file "/dev/rdsk/c0t5d0"&lt;BR /&gt;&lt;BR /&gt;  But in linux only one file available for each disk&lt;BR /&gt;&lt;BR /&gt;    1) block device file "/dev/sda1"&lt;BR /&gt;&lt;BR /&gt;  I want answer for following questions.&lt;BR /&gt;&lt;BR /&gt;  1) is raw device file available defaultly in linux for all disks?&lt;BR /&gt;&lt;BR /&gt;  2) if yes, where it is available.&lt;BR /&gt;&lt;BR /&gt;  3) if not, how to create that file.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Apr 2009 12:35:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392309#M35892</guid>
      <dc:creator>senthil_kumar_1</dc:creator>
      <dc:date>2009-04-01T12:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392310#M35893</link>
      <description>&amp;gt;&amp;gt; 1) is raw device file available defaultly in linux for all disks?&lt;BR /&gt;&lt;BR /&gt;No.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; 3) if not, how to create that file.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://magazine.redhat.com/2008/09/17/tips-and-tricks-how-do-i-add-raw-device-mapping-in-red-hat-enterprise-linux-5/" target="_blank"&gt;http://magazine.redhat.com/2008/09/17/tips-and-tricks-how-do-i-add-raw-device-mapping-in-red-hat-enterprise-linux-5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://youngcow.net/doc/oracle10g/install.102/b14203/storage.htm" target="_blank"&gt;http://youngcow.net/doc/oracle10g/install.102/b14203/storage.htm&lt;/A&gt;</description>
      <pubDate>Wed, 01 Apr 2009 12:47:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392310#M35893</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2009-04-01T12:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392311#M35894</link>
      <description>The use of /dev/raw/raw* device files is an old, deprecated interface.&lt;BR /&gt;&lt;BR /&gt;The new, recommended way to access disks in raw mode is to open the regular device file using the O_DIRECT option. This is something that must be done in the source code of the application.&lt;BR /&gt;&lt;BR /&gt;In this sense, the answer for your question 1) is "yes".&lt;BR /&gt;For your question 2) we can say that a raw device file for e.g. /dev/sda1 is /dev/sda1.&lt;BR /&gt;&lt;BR /&gt;If, for some reason, you need to use the old /dev/raw/raw* interface, Ivan's first link had instructions for that.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Wed, 01 Apr 2009 16:29:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392311#M35894</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2009-04-01T16:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392312#M35895</link>
      <description>&amp;gt;&amp;gt; 2) we can say that a raw device file for e.g. /dev/sda1 is /dev/sda1.&lt;BR /&gt;&lt;BR /&gt;I disagree partially with this. /dev/sda1 in this case is a block device. RAW devices are character devices. The access pattern is different and I had different results when doing performance tests with block and raw devices.&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Apr 2009 17:40:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392312#M35895</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2009-04-01T17:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392313#M35896</link>
      <description>indeed, afaik o_direct is used for access to the fs while bypassing the buffers/cache. this is not the same thing as raw device access.</description>
      <pubDate>Thu, 02 Apr 2009 05:18:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392313#M35896</guid>
      <dc:creator>dirk dierickx</dc:creator>
      <dc:date>2009-04-02T05:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392314#M35897</link>
      <description>Then *what* do we mean with "raw device access", exactly?&lt;BR /&gt;&lt;BR /&gt;As far as I see, there are at least three possible definitions:&lt;BR /&gt;&lt;BR /&gt;1.) - bypassing all OS buffering and accessing the disk blocks as directly as possible&lt;BR /&gt;&lt;BR /&gt;In this case, you have to observe the hardware-imposed limitations (mainly alignment requirements for DMA operations). &lt;BR /&gt;&lt;BR /&gt;In Linux 2.6.* kernels, O_DIRECT on a disk device does exactly this.&lt;BR /&gt;&lt;BR /&gt;2.) - accessing a block device like a character device or a fixed-size file&lt;BR /&gt;&lt;BR /&gt;In this case, you cannot always skip all buffering: a proper character device has no block size or data alignment requirements, but if the hardware has them, the OS must hide the restrictions by using a buffer at some level.&lt;BR /&gt;&lt;BR /&gt;I don't know how (or *if*) this can be done in Linux.&lt;BR /&gt;&lt;BR /&gt;3.) - giving raw SCSI commands to a disk device&lt;BR /&gt;&lt;BR /&gt;In Linux 2.6.* kernels, this is possible using the standard block device file, using the correct ioctls. Of course, this often requires special privileges (= being root, usually).&lt;BR /&gt;&lt;BR /&gt;-----&lt;BR /&gt;And if you think /dev/raw/raw* is somehow different from or more raw than using O_DIRECT with a block device, please let me invite you to examine the source code.&lt;BR /&gt;&lt;BR /&gt;The driver for /dev/raw devices is located in linux-&lt;VERSION&gt;/drivers/char/raw.c within the kernel source package.&lt;BR /&gt;&lt;BR /&gt;The very first function in that file is the one that handles opening and closing the /dev/raw/raw* devices. I think the comments speak for themselves:&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt; * Open/close code for raw IO.&lt;BR /&gt; *&lt;BR /&gt; * We just rewrite the i_mapping for the /dev/raw/rawN file descriptor to&lt;BR /&gt; * point at the blockdev's address_space and set the file handle to use&lt;BR /&gt; * O_DIRECT.&lt;BR /&gt; *&lt;BR /&gt; * Set the device's soft blocksize to the minimum possible.  This gives the&lt;BR /&gt; * finest possible alignment and has no adverse impact on performance.&lt;BR /&gt; */&lt;BR /&gt;static int raw_open(struct inode *inode, struct file *filp)&lt;BR /&gt;&lt;BR /&gt;If you are talking about ioctls, a bit later there is another function raw_ioctl() which just forwards any ioctls to the underlying block device.&lt;BR /&gt;&lt;BR /&gt;So *everything* you can achieve by using /dev/raw/raw*, you can also achieve by using O_DIRECT on a block device, because /dev/raw is implemented by using O_DIRECT on a block device.&lt;BR /&gt;&lt;BR /&gt;Note: in older kernels, this was implemented in a very different way.&lt;BR /&gt;&lt;BR /&gt;MK&lt;/VERSION&gt;</description>
      <pubDate>Thu, 02 Apr 2009 08:05:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392314#M35897</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2009-04-02T08:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392315#M35898</link>
      <description>pls explain me how to use O_DIRECT to get raw device files.</description>
      <pubDate>Thu, 02 Apr 2009 09:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392315#M35898</guid>
      <dc:creator>senthil_kumar_1</dc:creator>
      <dc:date>2009-04-02T09:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392316#M35899</link>
      <description>O_DIRECT is *not* a way to get additional device files. It is a special way to use the block device file so that it works the same as a raw device file.&lt;BR /&gt;&lt;BR /&gt;O_DIRECT is not a command. It is an option flag you must set in the system call you use to open the disk device. You must edit the source code of your program to use it.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Thu, 02 Apr 2009 12:00:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392316#M35899</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2009-04-02T12:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the raw device file in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392317#M35900</link>
      <description>the age old meaning of raw device access is just that, a device as it is, no FS of any type present. mostly used by databases (but i think these days there is hardly any benefit anymore to this approach).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Apr 2009 08:29:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-find-the-raw-device-file-in-linux/m-p/4392317#M35900</guid>
      <dc:creator>dirk dierickx</dc:creator>
      <dc:date>2009-04-06T08:29:04Z</dc:date>
    </item>
  </channel>
</rss>

