linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What does /udev think its doing?
@ 2004-03-17  8:48 reg
  2004-03-17 12:40 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: reg @ 2004-03-17  8:48 UTC (permalink / raw)
  To: linux-hotplug

OK, Im confused, what does /udev think its doing here.
This is udev-021.

the appropriate rule in udev.rules is

    BUS="scsi", SYSFS{vendor}="IC25N020", NAME{all_partitions}="usb_disk"

The result of a ls -lai of /udev/usb is

449164 brw-------  1 root root 8,  2 Mar 17 01:17 /udev/usb_disk
449165 brw-------  1 root root 8,  3 Mar 17 01:17 /udev/usb_disk1
449174 brw-------  1 root root 8, 12 Mar 17 01:17 /udev/usb_disk10
449175 brw-------  1 root root 8, 13 Mar 17 01:17 /udev/usb_disk11
449176 brw-------  1 root root 8, 14 Mar 17 01:17 /udev/usb_disk12
449177 brw-------  1 root root 8, 15 Mar 17 01:17 /udev/usb_disk13
449178 brw-------  1 root root 8, 16 Mar 17 01:17 /udev/usb_disk14
449179 brw-------  1 root root 8, 17 Mar 17 01:17 /udev/usb_disk15
449166 brw-------  1 root root 8,  4 Mar 17 01:17 /udev/usb_disk2
449167 brw-------  1 root root 8,  5 Mar 17 01:17 /udev/usb_disk3
449168 brw-------  1 root root 8,  6 Mar 17 01:17 /udev/usb_disk4
449169 brw-------  1 root root 8,  7 Mar 17 01:17 /udev/usb_disk5
449170 brw-------  1 root root 8,  8 Mar 17 01:17 /udev/usb_disk6
449171 brw-------  1 root root 8,  9 Mar 17 01:17 /udev/usb_disk7
449172 brw-------  1 root root 8, 10 Mar 17 01:17 /udev/usb_disk8
449173 brw-------  1 root root 8, 11 Mar 17 01:17 /udev/usb_disk9

notice that /udev/usb_disk is offset to device (8,2).
If I try doing a /sbin/fdisk on /udev/usb_disk I get garbage, viz

[root@orion reg]# /sbin/fdisk /udev/usb_disk
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF 
disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /udev/usb_disk: 4005 MB, 4005711360 bytes
255 heads, 63 sectors/track, 487 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

         Device Boot      Start         End      Blocks   Id  System

Command (m for help): 

---

while doing the same on /dev/sda , which is correctly device (8,0)
shows:

root@orion reg]# /sbin/fdisk /dev/sda

The number of cylinders for this disk is set to 2432.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 20.0 GB, 20003880960 bytes
255 heads, 63 sectors/track, 2432 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         487     3911796    c  W95 FAT32 (LBA)
/dev/sda2             488         974     3911827+  83  Linux
/dev/sda3             975        1097      987997+  82  Linux swap
/dev/sda4            1098        2432    10723387+  83  Linux

Command (m for help): 

---

So why are the minor device numbers returned by /udev offset by 2?

---

Using the rule
    BUS="usb", SYSFS{product}="USB 2.0 Storage Adaptor", \
                  NAME{all_partitions}="usb_disk"

gives equally bizarre results, with the root device being set to (8,19),
then after unplugging/replugging (8,18), then again (8,19) (sigh)


    
-- 
                                        Reg.Clemens
                                        reg@dwf.com




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: What does /udev think its doing?
  2004-03-17  8:48 What does /udev think its doing? reg
@ 2004-03-17 12:40 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2004-03-17 12:40 UTC (permalink / raw)
  To: linux-hotplug

On Wed, 2004-03-17 at 09:48, reg@dwf.com wrote:
> OK, Im confused, what does /udev think its doing here.
> This is udev-021.
> 
> the appropriate rule in udev.rules is
> 
>     BUS="scsi", SYSFS{vendor}="IC25N020", NAME{all_partitions}="usb_disk"
> 
> The result of a ls -lai of /udev/usb is
> 
> 449164 brw-------  1 root root 8,  2 Mar 17 01:17 /udev/usb_disk

Please try:

  BUS="scsi", KERNEL="*[!0-9]", SYSFS{vendor}="IC25N020", NAME{all_partitions}="usb_disk"

it will catch the main device only. It looks like your rule applies
to all partitions and the result in the same name which is replaces
the former with every match?

If this doesn't work, please tell what you get with:

  BUS="scsi", SYSFS{vendor}="IC25N020", NAME{all_partitions}="usb_disk%n"


thanks,
Kay



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-17 12:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-17  8:48 What does /udev think its doing? reg
2004-03-17 12:40 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).