View previous topic :: View next topic |
Author |
Message |
E001754 Guru
Joined: 01 Aug 2004 Posts: 442 Location: Paris, France
|
Posted: Thu Jan 12, 2006 11:15 pm Post subject: Questions around /sys & udev |
|
|
Hello,
Before udev, we were using the /dev folder. I was relatively happy, but suddenly, when I upgrade my Gentoo to kernel 2.6.14, I discovered that this was replaced by /sys folder (but there is still the /dev folder for compatibility reasons).
So, here are the questions :
- Were can I find documentation on how to use the /sys folder instead of /dev ? (I didn't find anything in Gentoo doc, but perhaps did I look too fast ??)
- Why should I use /sys instead of /dev ?
In fact, I got a little problem (but very little). I have a digital camera which acts as a USB mass storage.
If I plug the camera alone, the camera appears as /dev/sdb
If I plug my printer, which contains a card reader, the card reader becomes /dev/sdb and by the way, the digital camera is /dev/sdc.
If I use /sys, will it be possible to have definitely the camera known as /dev/sdc, whatever could be the state (pluged or unpluged) of my printer ???
Thanks for your help. |
|
Back to top |
|
|
adsmith Veteran
Joined: 26 Sep 2004 Posts: 1386 Location: NC, USA
|
Posted: Thu Jan 12, 2006 11:56 pm Post subject: |
|
|
Not quite.
/sys and /dev are for different purposes.
/dev is still used by udev for all devices, but now it's created on-the-fly.
/sys is something like the /proc file system, which keeps track of various system information. The /dev directory is still for all devices you access. |
|
Back to top |
|
|
widan Veteran
Joined: 07 Jun 2005 Posts: 1512 Location: Paris, France
|
Posted: Fri Jan 13, 2006 12:01 am Post subject: Re: Questions around /sys & udev |
|
|
E001754 wrote: | Before udev, we were using the /dev folder. I was relatively happy, but suddenly, when I upgrade my Gentoo to kernel 2.6.14, I discovered that this was replaced by /sys folder (but there is still the /dev folder for compatibility reasons). |
No, it was not replaced. /dev and /sys are two different things (device nodes for the first, and more or less a description of the system's devices for the second).
E001754 wrote: | - Were can I find documentation on how to use the /sys folder instead of /dev ? (I didn't find anything in Gentoo doc, but perhaps did I look too fast ??) |
As a user you probably don't need to touch /sys directly. You just let udev translate what is in /sys to normal device nodes.
E001754 wrote: | If I use /sys, will it be possible to have definitely the camera known as /dev/sdc, whatever could be the state (pluged or unpluged) of my printer ??? |
You need to tell udev about those devices, so it can create nodes for them that are independant on the order they are plugged in (although it is not a good idea to name it /dev/sdc - /dev/camera is better and has less risk of conflicts). You can look at this page for info about how to do that. |
|
Back to top |
|
|
E001754 Guru
Joined: 01 Aug 2004 Posts: 442 Location: Paris, France
|
Posted: Fri Jan 13, 2006 9:20 pm Post subject: |
|
|
Thanks for your answers, it's more clear now. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|