Skip to contentSkip to conversation

initial udev foray...successes and failures...

DISCUSSION Tupshin Harper 2 participants 7 messages Dec 18, 2003 – Dec 23, 2003

lore
Share & tools
lore
#0 lore raw

As a long time devfs user and MAKEDEV hater(mostly for aesthetic reason), I decided to bite the bullet and see how close to usable udev is.

The platform:
Debian Sid
kernel 2.6.0-test11+
hotplug that comes with sid
udev 0.009 built for debian downloaded from: http://www.bofh.it/~md/debian/

The scenario:
the Debian udev package creates everything in /udev. I moved /dev out of the way, symlinked /udev to /dev and rebooted (ahhh...glorious optimism).

What worked:
Most things, including (to my surprise) lvm2 which had been running on the devfs setup.

What didn't:
1) anything that needed /dev/null
2) anything that needed /dev/random (and probably urandom...didn't check)
3) anything other that single user mode, since /dev/tty[0-9] were not present ..just /dev/tty

What was odd:
I have a number of ide hard drives in this machine(9). The first two (hda, and hdb) and their partitions showed up as symlinks to /dev/ide/host0/etc... The rest of them were not symlinks and were placed directly in /dev (e.g. /dev/hde and /dev/hde3).

Despite these oddities, I was able to manually create /dev/null, /dev/random, and /dev/tty[0-9] and everything on my machine worked.

So...given the limited information that seems to be available for udev, I have a few questions:
1) should the missing devices be created by udev? Is this a [known] problem?
2) Why are some drives symlinked and others not?
3) Does it make sense that the debian package operates on /udev and I'm testing it by creating a symlink to /dev? If not, how should things be done?

-Tupshin

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 9 lines · Tupshin Harper

As a long time devfs user and MAKEDEV hater(mostly for aesthetic reason), I decided to bite the bullet and see how close to usable udev is.

The platform:
Debian Sid
kernel 2.6.0-test11+
hotplug that comes with sid
udev 0.009 built for debian downloaded from: http://www.bofh.it/~md/debian/

Quoted 3 lines

The scenario:
the Debian udev package creates everything in /udev. I moved /dev out of the way, symlinked /udev to /dev and rebooted (ahhh...glorious optimism).

Wow, that's brave :)

Quoted 3 lines

What worked:
Most things, including (to my surprise) lvm2 which had been running on the devfs setup.

Yeah, lvm2 uses block devices, so it all should "just work". Glad to see it does.

Quoted 3 lines

What didn't:
1) anything that needed /dev/null
2) anything that needed /dev/random (and probably urandom...didn't check)

You need the misc sysfs patch that I posted to lkml and linux-hotplug-devel a while ago. That will create those nodes for you.

Quoted 2 lines

3) anything other that single user mode, since /dev/tty[0-9] were not present ..just /dev/tty

That's odd. Do you have any tty devices in /sys/class/tty/ ? That's what udev goes off of.

Quoted 6 lines

What was odd:
I have a number of ide hard drives in this machine(9). The first two (hda, and hdb) and their partitions showed up as symlinks to /dev/ide/host0/etc... The rest of them were not symlinks and were placed directly in /dev (e.g. /dev/hde and /dev/hde3).

Quoted 6 lines

Despite these oddities, I was able to manually create /dev/null, /dev/random, and /dev/tty[0-9] and everything on my machine worked.

So...given the limited information that seems to be available for udev, I have a few questions:
1) should the missing devices be created by udev? Is this a [known] problem?

Yes they should, as long as they are exported in sysfs somewhere.

Quoted 1 line

2) Why are some drives symlinked and others not?

I don't know. What kind of udev.rules file did you use for this? I think the debian package is trying to emulate devfs names, which I don't necessarily think is the best idea, as they are not LSB compliant.

Quoted 2 lines

3) Does it make sense that the debian package operates on /udev and I'm testing it by creating a symlink to /dev? If not, how should things be done?

Right now it's good to play around in /udev. When udev matures, then it will be ok to move it to use /dev. I don't think we are quite there yet.

thanks for your report.

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Tupshin Harper
Quoted 13 lines · Greg KH
Quoted 5 lines · Tupshin Harper

What didn't:
1) anything that needed /dev/null
2) anything that needed /dev/random (and probably urandom...didn't check)

You need the misc sysfs patch that I posted to lkml and linux-hotplug-devel a while ago. That will create those nodes for you.

Can't seem to find it in the archives of either list ...maybe I'm just blind...can you point me at it?

Also, is it a patch against kernel sources? Will it work against 2.6.0 final?

Quoted 11 lines
Quoted 6 lines

3) anything other that single user mode, since /dev/tty[0-9] were not present ..just /dev/tty

That's odd. Do you have any tty devices in /sys/class/tty/ ? That's what udev goes off of.

Yup...lots o stuf in /sys/class/tty: tty0-tty63 directories all containing a "dev" file. tty0 (for example) contains dev with contents 4:0

Quoted 10 lines
Quoted 10 lines

What was odd:
I have a number of ide hard drives in this machine(9). The first two (hda, and hdb) and their partitions showed up as symlinks to /dev/ide/host0/etc... The rest of them were not symlinks and were placed directly in /dev (e.g. /dev/hde and /dev/hde3).

Quoted 9 lines
Quoted 3 lines

2) Why are some drives symlinked and others not?

I don't know. What kind of udev.rules file did you use for this? I think the debian package is trying to emulate devfs names, which I don't necessarily think is the best idea, as they are not LSB compliant.

Ahhh...udev.rules only contains ide entries for hda-hdd. hda is:
NUMBER, BUS="ide", ID="0.0", NAME="ide/host0/bus0/target0/lun0/%D", SYMLINK="hda%n"

Should there be one line for every conceivable IDE device?

-Tupshin

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Tupshin Harper
Quoted 11 lines · Tupshin Harper
Quoted 9 lines · Greg KH
Quoted 5 lines · Tupshin Harper

What didn't:
1) anything that needed /dev/null
2) anything that needed /dev/random (and probably urandom...didn't check)

Quoted 6 lines
Quoted 4 lines

You need the misc sysfs patch that I posted to lkml and linux-hotplug-devel a while ago. That will create those nodes for you.

Can't seem to find it in the archives of either list ...maybe I'm just blind...can you point me at it?

ok, will post them over again to lkml and linux-hotplug-devel in a minute.

Quoted 11 lines
Quoted 9 lines
Quoted 4 lines

3) anything other that single user mode, since /dev/tty[0-9] were not present ..just /dev/tty

That's odd. Do you have any tty devices in /sys/class/tty/ ? That's what udev goes off of.

Yup...lots o stuf in /sys/class/tty: tty0-tty63 directories all containing a "dev" file. tty0 (for example) contains dev with contents 4:0

Hm, so if you run the 'test.all' script in the test directory with the 'add' paramater, does it create the tty nodes? Check to see if debian has a initscript that properly catches all of the dev nodes in sysfs (look at the one in the udev release, or the test.all script for an example of how to do this properly without having to know what kinds of devices are in sysfs.)

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines

What was odd:
I have a number of ide hard drives in this machine(9). The first two (hda, and hdb) and their partitions showed up as symlinks to /dev/ide/host0/etc... The rest of them were not symlinks and were placed directly in /dev (e.g. /dev/hde and /dev/hde3).

Quoted 9 lines
Quoted 3 lines

2) Why are some drives symlinked and others not?

I don't know. What kind of udev.rules file did you use for this? I think the debian package is trying to emulate devfs names, which I don't necessarily think is the best idea, as they are not LSB compliant.

Quoted 5 lines

Ahhh...udev.rules only contains ide entries for hda-hdd. hda is:
NUMBER, BUS="ide", ID="0.0", NAME="ide/host0/bus0/target0/lun0/%D", SYMLINK="hda%n"

Should there be one line for every conceivable IDE device?

If you want to name them something different from the kernel name, yes. If not, the default kernel name will be used, which should work just like without devfs or udev.

Hope this helps,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Tupshin Harper
Quoted 12 lines · Greg KH
Quoted 4 lines · Tupshin Harper

Can't seem to find it in the archives of either list ...maybe I'm just blind...can you point me at it?

ok, will post them over again to lkml and linux-hotplug-devel in a minute.

Thanks.

Quoted 5 lines
Quoted 4 lines

Yup...lots o stuf in /sys/class/tty: tty0-tty63 directories all containing a "dev" file. tty0 (for example) contains dev with contents 4:0

Quoted 9 lines

Hm, so if you run the 'test.all' script in the test directory with the 'add' paramater, does it create the tty nodes? Check to see if debian has a initscript that properly catches all of the dev nodes in sysfs (look at the one in the udev release, or the test.all script for an example of how to do this properly without having to know what kinds of devices are in sysfs.)

Bug in debian's version...not present in stock udev-009.

Quoted 9 lines
Quoted 3 lines

Should there be one line for every conceivable IDE device?

If you want to name them something different from the kernel name, yes. If not, the default kernel name will be used, which should work just like without devfs or udev.

What are your thoughts on the fact that this naming scheme limits you to 26 devices? I recall that one reason for the devfs /dev/ide/... approach is that it didn't introduce any arbitrary device limitations. The structure of /sys/bus/ide doesn't impose this limitation. Where does the mapping from /sys/bus/ide/devices to /dev/hd? take place?

-Tupshin

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Tupshin Harper
Quoted 2 lines · Tupshin Harper

What are your thoughts on the fact that this naming scheme limits you to 26 devices?

Do you have more than 26 ide devices in your system? The scsi names can handle many more than 26 devices, if you have a lot of disks I suggest you use scsi instead :)

Anyway, that's not a udev issue, sorry.

Quoted 4 lines

I recall that one reason for the devfs /dev/ide/... approach is that it didn't introduce any arbitrary device limitations. The structure of /sys/bus/ide doesn't impose this limitation. Where does the mapping from /sys/bus/ide/devices to /dev/hd? take place?

In your udev.rules file. The kernel calls the device hd? and then your udev.rules file tries to map that to a /dev/ide/... mapping.

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to Tupshin Harper
Quoted 13 lines · Greg KH
Quoted 4 lines · Tupshin Harper

What are your thoughts on the fact that this naming scheme limits you to 26 devices?

Do you have more than 26 ide devices in your system? The scsi names can handle many more than 26 devices, if you have a lot of disks I suggest you use scsi instead :)

No...only 10 today. ;-)

Quoted 3 lines

Anyway, that's not a udev issue, sorry.

Fair enough.

-Tupshin

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel