From mboxrd@z Thu Jan 1 00:00:00 1970 From: reg@dwf.com Date: Wed, 17 Mar 2004 08:48:01 +0000 Subject: What does /udev think its doing? Message-Id: <200403170848.i2H8m1Sg005927@orion.dwf.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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_id70&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