Talk:Map Custom Device Entries with udev

From ArchWiki
Revision as of 14:49, 19 December 2005 by Brain0 (Talk | contribs) (confusion about rules - partitioned devices)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Hi there, I often thought about changing this, but I'm not sure yet. This article suggests two rules for a task which only requires one rule. There has also been confusion about this on the forums. Example:

# Symlink multi-part device
BUS=="usb", SYSFS{serial}=="1730C13B18000B84", KERNEL=="sd?", NAME="%k", SYMLINK+="usbdisk", GROUP="storage"
BUS=="usb", SYSFS{serial}=="1730C13B18000B84", KERNEL=="sd?[1-9]", NAME="%k", SYMLINK+="usbdisk%n", GROUP="storage"

This can be done by one single rule (it works here, at least), like this:

BUS=="usb", SYSFS{serial}=="1730C13B18000B84", KERNEL=="sd*", NAME="%k", SYMLINK+="usbdisk%n", GROUP="storage"

Also, for simplicity, you can omit the GROUP and NAME statements, because they are already set in udev.rules, so the rule would be

BUS=="usb", SYSFS{serial}=="1730C13B18000B84", KERNEL=="sd*", SYMLINK+="usbdisk%n"

This rule will create usbdisk, usbdisk1, usbdisk2 etc. and it will leave NAME and GROUP to the defaults set in udev.rules.

Is there a reason that the wiki page suggests 2 rules here and adds redundancy to GROUP and NAME statements? Does anyone know a case where this doesn't work? brain0 09:49, 19 December 2005 (EST)