Skip to contentSkip to conversation

udev LABEL not working: sysfs_path_is_file: stat() failed

DISCUSSION Greg KH 2 participants 6 messages Dec 22, 2003 – Dec 28, 2003

lore
Share & tools
lore

Greg KH

author
#0 lore raw
Quoted 1 line · Scott James Remnant

[I am not subscribed to linux-kernel, please Cc: me on replies.]

The linux-hotplug-devel mailing list is best place for questions about udev, not lkml...

Quoted 4 lines

I'm having a problem getting udev to honour my LABEL lines in /etc/udev/udev.rules. At the top of this I've got:

LABEL, BUS="usb", SYSFS_vendor="Fujifilm", SYSFS_model="FinePix 1400Zoom", NAME="camera"

Try changing BUS="usb" to BUS="scsi". Also make sure that the model file doesn't contain any trailing spaces. That's a very common thing on usb devices.

And you are trying to match up 2 files, right now udev only supports 1, so the last one (model) is used. The vendor rule there is ignored.

There is also a problem with udev beating the kernel. It can easily get the hotplug event before the kernel has created the sysfs file. I'm currently working on fixing this in udev, should have it done by the next release. You can tell if you are seeing this race by just running the test.block script in the test directory in udev. If your device node is created properly with that script, but not when you plug the device in, you have that problem.

And people tried to tell us that the hotplug interface was slow without ever testing it out...

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

#1 lore raw

[I am not subscribed to linux-kernel or linux-hotplug-devel, please Cc:
me on replies.]

Quoted 12 lines · Greg KH
Quoted 1 line · Scott James Remnant

I'm having a problem getting udev to honour my LABEL lines

There is also a problem with udev beating the kernel. It can easily get the hotplug event before the kernel has created the sysfs file. I'm currently working on fixing this in udev, should have it done by the next release. You can tell if you are seeing this race by just running the test.block script in the test directory in udev. If your device node is created properly with that script, but not when you plug the device in, you have that problem.

Quoted 3 lines

And people tried to tell us that the hotplug interface was slow without ever testing it out...

It looks like this is what's happening, after tracing the code I added some stuff to print out everything in the sysfs directory at the time udev was running, and it is devoid of the vendor & model files which turn up shortly afterwards.

On the slower laptop, it works as expected.

One question though, it only ever seems to create a device for the actual usb-storage disk and not the partition. Is there some magic to create the partition device instead?

Scott

Signature · 2 lines
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
author
#2 lore raw
In reply to Greg KH
Quoted 3 lines · Scott James Remnant

One question though, it only ever seems to create a device for the actual usb-storage disk and not the partition. Is there some magic to create the partition device instead?

Do you have a partition show up in /sys/block? If not, then udev will not create it. It works here for my usb-storage devices that have partitions on them.

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

#3 lore raw
In reply to Greg KH
Quoted 9 lines · Greg KH
Quoted 3 lines · Scott James Remnant

One question though, it only ever seems to create a device for the actual usb-storage disk and not the partition. Is there some magic to create the partition device instead?

Do you have a partition show up in /sys/block? If not, then udev will not create it. It works here for my usb-storage devices that have partitions on them.

Yes, /dev/block/sdb/sdb1 certainly does appear, as does /udev/sdb1 -- the LABEL rule only seems to match "sdb" though.

Scott

Signature · 2 lines
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
author
#4 lore raw
In reply to Greg KH
Quoted 7 lines · Scott James Remnant
Quoted 5 lines · Greg KH
Quoted 3 lines · Scott James Remnant

One question though, it only ever seems to create a device for the actual usb-storage disk and not the partition. Is there some magic to create the partition device instead?

Quoted 6 lines
Quoted 4 lines

Do you have a partition show up in /sys/block? If not, then udev will not create it. It works here for my usb-storage devices that have partitions on them.

Yes, /dev/block/sdb/sdb1 certainly does appear, as does /udev/sdb1 -- the LABEL rule only seems to match "sdb" though.

That's odd, what is the rule? They should both match.

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

#5 lore raw
In reply to Greg KH
Quoted 8 lines · Greg KH
Quoted 7 lines · Scott James Remnant
Quoted 5 lines · Greg KH
Quoted 3 lines · Scott James Remnant

One question though, it only ever seems to create a device for the actual usb-storage disk and not the partition. Is there some magic to create the partition device instead?

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Do you have a partition show up in /sys/block? If not, then udev will not create it. It works here for my usb-storage devices that have partitions on them.

Yes, /dev/block/sdb/sdb1 certainly does appear, as does /udev/sdb1 -- the LABEL rule only seems to match "sdb" though.

That's odd, what is the rule? They should both match.

Had omitted the %n in the NAME, so only the disk was showing up. udev-011 fixes the original problem too, thanks.

Scott

Signature · 2 lines
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?