udev and raw support
Hey folks,
I don't see a "linux-hotplug-users" list anywhere, so I'm posting to linux-hotplug-devel and hoping this is an acceptable question.
Does udev have support for raw devices? After a handful of googling, I don't see any clear answers to that question.
Thanks...
--
Phil Dibowitz [email protected] Freeware and Technical Pages Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759
Quoted 7 lines · Phil Dibowitz
Hey folks,
I don't see a "linux-hotplug-users" list anywhere, so I'm posting to linux-hotplug-devel and hoping this is an acceptable question.
Does udev have support for raw devices? After a handful of googling, I don't see any clear answers to that question.
Yes. Should work just fine. What problems are you having?
thanks,
greg k-h
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Greg KH
Quoted 7 lines · Phil Dibowitz
Hey folks,
I don't see a "linux-hotplug-users" list anywhere, so I'm posting to linux-hotplug-devel and hoping this is an acceptable question.
Does udev have support for raw devices? After a handful of googling, I don't see any clear answers to that question.
Yes. Should work just fine. What problems are you having?
I have found little information on raw devices in linux, so I may be missing something else basic here...
But the rawctl device isn't there:
[phil@rider ~]$ sudo raw /dev/raw/raw1 /dev/hdc
Cannot open master raw device '/dev/rawctl' (No such file or directory) [phil@rider ~]$
Signature · 7 lines
Phil Dibowitz [email protected] Freeware and Technical Pages Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/ "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, 1759
Quoted 12 lines · Phil Dibowitz
Quoted 10 lines · Greg KH
Quoted 7 lines · Phil Dibowitz
Hey folks,
I don't see a "linux-hotplug-users" list anywhere, so I'm posting to linux-hotplug-devel and hoping this is an acceptable question.
Does udev have support for raw devices? After a handful of googling, I don't see any clear answers to that question.
Yes. Should work just fine. What problems are you having?
Quoted 8 lines
I have found little information on raw devices in linux, so I may be missing something else basic here...
But the rawctl device isn't there:
[phil@rider ~]$ sudo raw
/dev/raw/raw1/dev/hdc
Cannot open master raw device '/dev/rawctl' (No such file or directory) [phil@rider ~]$
Is the raw module loaded?
thanks,
greg k-h
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 7 lines · Greg KH
Quoted 5 lines
But the rawctl device isn't there:
[phil@rider ~]$ sudo raw
/dev/raw/raw1/dev/hdc
Cannot open master raw device '/dev/rawctl' (No such file or directory) [phil@rider ~]$Is the raw module loaded?
Doh, didn't know there was one (as I said, new to raw). Silly me. OK, well, now it's loaded and I get:
[root@rider dev]# raw /dev/raw/raw1 /dev/hdc
Cannot locate raw device '/dev/raw/raw1' (No such file or directory)
--
Phil Dibowitz [email protected] Freeware and Technical Pages Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759
Quoted 7 lines · Phil Dibowitz
Quoted 6 lines · Greg KH
Quoted 5 lines
But the rawctl device isn't there:
[phil@rider ~]$ sudo raw
/dev/raw/raw1/dev/hdc
Cannot open master raw device '/dev/rawctl' (No such file or directory) [phil@rider ~]$
Quoted 7 lines
Quoted 1 line
Is the raw module loaded?
Doh, didn't know there was one (as I said, new to raw). Silly me. OK, well, now it's loaded and I get:
[root@rider dev]# raw
/dev/raw/raw1/dev/hdc
Cannot locate raw device '/dev/raw/raw1' (No such file or directory)
What distro are you using? In order to have udev and raw working together, you need a new version of the raw userspace program (sorry, forgot about this until right now.) I know SuSE ships it in their distro, don't know about everyone else.
Also, why use raw at all? It's depreciated, nasty code, which no one likes at all, and has no real-world use. It is also going to be ripped out of the kernel entirely one of these days. The only people who like it are people who want to create useless benchmarks...
thanks,
greg k-h
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 5 lines · Greg KH
What distro are you using? In order to have udev and raw working together, you need a new version of the raw userspace program (sorry, forgot about this until right now.) I know SuSE ships it in their distro, don't know about everyone else.
Debian unstable.
/sbin/raw seems to be part of util-linux which is at version 2.12p-4 in debian unstable - i.e. 2.12p with 4 local debian revisions which may or may not include code from later util-linux releases.
Quoted 4 lines
Also, why use raw at all? It's depreciated, nasty code, which no one likes at all, and has no real-world use. It is also going to be ripped out of the kernel entirely one of these days. The only people who like it are people who want to create useless benchmarks...
I've never used it in linux, only in Solaris... but I'm told that it will provide better DVD Video read performance. Many of the DVD players out there provide support for raw devices, and in fact recommend using them.
Since even on my high-end system I don't get the DVD playback that I get on my living room DVD player, I decided to give it a shot.
Why is it depricated? What's wrong with using raw devices?
--
Phil Dibowitz [email protected] Freeware and Technical Pages Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759
Quoted 7 lines · Phil Dibowitz
Quoted 5 lines · Greg KH
What distro are you using? In order to have udev and raw working together, you need a new version of the raw userspace program (sorry, forgot about this until right now.) I know SuSE ships it in their distro, don't know about everyone else.
Quoted 5 lines
Debian unstable.
/sbin/rawseems to be part of util-linux which is at version 2.12p-4 in debian unstable - i.e. 2.12p with 4 local debian revisions which may or may not include code from later util-linux releases.
I really don't know if they got that patch or not, sorry.
Quoted 8 lines
Quoted 4 lines
Also, why use raw at all? It's depreciated, nasty code, which no one likes at all, and has no real-world use. It is also going to be ripped out of the kernel entirely one of these days. The only people who like it are people who want to create useless benchmarks...
I've never used it in linux, only in Solaris... but I'm told that it will provide better DVD Video read performance. Many of the DVD players out there provide support for raw devices, and in fact recommend using them.
For Linux? Just use O_DIRECT and it should work the same.
Quoted 2 lines
Since even on my high-end system I don't get the DVD playback that I get on my living room DVD player, I decided to give it a shot.
My crappy, slow, no-memory, 2+ year old laptop gives great dvd playback, perhaps you have some other issues with your system (sorry, I'm not going to be able to help out here, as I don't know anything about video playback other than it "works for me")
Quoted 1 line
Why is it depricated? What's wrong with using raw devices?
Because you should use O_DIRECT to access block devices directly, which properly uses the kernel io subsystems. raw goes around all of that, and thinks it is smarter than the kernel. In the end, it is wrong, and can be slower.
Anyway, you can get around this by creating the device node by hand if you really want. I suggest you file a debian bug to get them to fix the raw program to work properly with udev.
Good luck,
greg k-h
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 1 line · Greg KH
I really don't know if they got that patch or not, sorry.
What version of util-linux has that patch, do you know?
Well http://www.kernel.org/pub/linux/utils/util-linux/ only goes up to q, so I'm guess that's it. I'll file a bug report, thanks.
Quoted 4 lines
Because you should use
O_DIRECTto access block devices directly, which properly uses the kernel io subsystems. raw goes around all of that, and thinks it is smarter than the kernel. In the end, it is wrong, and can be slower.
Fair enough. Wouldn't it make sense to make a simple raw module that simply was equivalent to opening the block device with O_DIRECT if for no other reason than, erm, "backwards" compatiblity with other unices - for ease of the writers of mplayer/xine/ogle/etc.?
Quoted 3 lines
Anyway, you can get around this by creating the device node by hand if you really want. I suggest you file a debian bug to get them to fix the raw program to work properly with udev.
I would be interested to experiment, even though I'm sure you're right... but I think I'm missing something... don't the major/minor number need to be the same:
[phil@rider rc2.d]$ sudo mknod /dev/raw/raw1 c 22 0 [phil@rider rc2.d]$ sudo raw /dev/raw/raw1 /dev/hdc Device '/dev/raw/raw1' is not a raw dev [phil@rider rc2.d]$ ls -l /dev/raw/raw1 /dev/hdc brw-rw---- 1 root cdrom 22, 0 Apr 25 21:36 /dev/hdc crw-r--r-- 1 root root 22, 0 Apr 25 23:08 /dev/raw/raw1
--
Phil Dibowitz [email protected] Freeware and Technical Pages Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759
Quoted 10 lines · Phil Dibowitz
Quoted 4 lines · Greg KH
Because you should use
O_DIRECTto access block devices directly, which properly uses the kernel io subsystems. raw goes around all of that, and thinks it is smarter than the kernel. In the end, it is wrong, and can be slower.Fair enough. Wouldn't it make sense to make a simple raw module that simply was equivalent to opening the block device with
O_DIRECTif for no other reason than, erm, "backwards" compatiblity with other unices - for ease of the writers of mplayer/xine/ogle/etc.?
No, raw creates a char device. O_DIRECT is a block device. Two totally different interfaces.
And hey, just prod those "other unices" to offer O_DIRECT support if you need that kind of compatibility :)
Quoted 9 lines
Quoted 3 lines
Anyway, you can get around this by creating the device node by hand if you really want. I suggest you file a debian bug to get them to fix the raw program to work properly with udev.
I would be interested to experiment, even though I'm sure you're right... but I think I'm missing something... don't the major/minor number need to be the same:
[phil@rider rc2.d]$ sudo mknod
/dev/raw/raw1c 22 0
I think raw1 should be 22 1, not 22 0. Isn't 22 0 rawctl? Oops, no rawctl is 162 0, so shouldn't raw1 be 162 1?
Major 22 char device is reserved for a Digi serial card, which I don't think you are trying to use :)
Yup, making the device node by hand here, on a gentoo box which does not have an updated raw command worked just fine.
See Documentation/devices.txt for more info on what you should be using for major/minor numbers here.
thanks,
greg k-h
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 11 lines · Greg KH
I think raw1 should be 22 1, not 22 0. Isn't 22 0 rawctl? Oops, no rawctl is 162 0, so shouldn't raw1 be 162 1?
Major 22 char device is reserved for a Digi serial card, which I don't think you are trying to use :)
Yup, making the device node by hand here, on a gentoo box which does not have an updated raw command worked just fine.
See
Documentation/devices.txtfor more info on what you should be using for major/minor numbers here.
Ah. I see. Works now.
Thanks Greg...
--
Phil Dibowitz [email protected] Freeware and Technical Pages Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759