Talk:Raw device
![]() | This article is rated Stub-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||
|
terms rawdevice and blockdevice are confused.
in linux eg a rawdevice<===> is a special method for accessing blockdevices without using the caching mechanisms of the operating system. database systems tend to implement caching by themselves and prefer raw device access.
==========================
editIs a raw device a block device?
I just had the pleasure of setting up raw devices in FC5 and it's a procedure that, to say the least, is poorly documented.
First you have to compile the kernel with raw support. There seem to be two ways, via a kernel module, or by setting CONFIG_RAW_DRIVER=y in .config. That'll get you /dev/rawctl.
Next, you need the raw command, which is missing in FC5. It's supposed to be part of the linux-utils package, but it's not part of the FC5 linux-utils package. You need to compile linux-utils from source to get /sbin/raw or wherever it's supposed to be. I think I put it in /bin.
Next, you need to make the /dev/raw/raw1 ... rawxx devices. And these are character devices.
[root@ raw]# mkdir /dev/raw [root@ raw]# mknod /dev/raw/raw1 c 162 1 [root@ raw]# mknod /dev/raw/raw2 c 162 2 [root@ raw]# ls -l /dev/raw/* crw-r--r-- 1 root root 162, 1 Aug 22 11:31 /dev/raw/raw1 crw-r--r-- 1 root root 162, 2 Aug 22 11:32 /dev/raw/raw2 [root@ raw]# raw /dev/raw/raw1 /dev/sdb /dev/raw/raw1: bound to major 8, minor 16 [root@ raw]#
So is a raw device character or block? 67.111.73.2 16:25, 23 August 2007 (UTC)Rich
===========================
editraw devices are not linux-specific
editRaw devices are in no way Linux-specific (quite the contrary). This article should be rewritten in the broader Unix context. jhawkinson (talk) 15:45, 14 January 2008 (UTC)
It looks like Linux raw devices are, once again, going to be deprecated
editI can't enter a link to the discussion at patchwork.kernel.org because it contains an "@" sign and Wikipedia erroneously treats that as a not allowed email address, but you can find the discussion by searching for "remove the raw driver" at site:patchwork.kernel.org. They said:
On Mon, May 31, 2021 at 10:24:33AM +0200, Hannes Reinecke wrote: > On 5/31/21 10:21 AM, Arnd Bergmann wrote: > > On Mon, May 31, 2021 at 9:38 AM Greg KH <gregkh at linuxfoundation.org> wrote: > > > > > > On Mon, May 31, 2021 at 10:25:26AM +0300, Christoph Hellwig wrote: > > > > The raw driver used to provide direct unbuffered access to block devices > > > > before O_DIRECT was invented. It has been obsolete for more than a > > > > decade. > > > > > > What? Really? We can finally do this? Yes! > > > > > > For some reason, I thought there was some IBM userspace tools that > > > relied on this device, if not, then great! > > > > > > > Signed-off-by: Christoph Hellwig <hch at lst.de> > > > > > > Acked-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org> > > > > Acked-by: Arnd Bergmann <arnd at arndb.de> > > Link: https://lore.kernel.org/lkml/Pine.LNX.4.64.0703180754060.6605 at CPE00045a9c397f-CM001225dbafb6/ > > > > The discussion from 2007 is the last one I could find on lore that has > > useful information on when and why this was not removed in the past. > > The driver was scheduled from a 2005 removal in 2004, but not removed > > because both Red Hat and SuSE relied on the feature in their distros. > > > > From what I could find out, this continued to be the case in Red Hat > > Enterprise Linux 6 and SUSE Linux Enterprise server 11 that were > > supported between 2009 and 2020, but the following versions dropped > > the support. > > > Which I can confirm for SUSE. Thanks, I've queued this up now. greg k-h