On Thu, 17 Nov 2005, Dirk Heinrichs wrote:

> Am Donnerstag, 17. November 2005 10:26 schrieb ext Jorge Almeida:
> 
> > I have a USB memory stick and an external USB box with an IDE disk.
> > I configured udev to assign device names to both items, or so I thought.
> > The external box is plugged, the memory stick isn't.
> > The problem is: the device for the box is not created, and the memstick
> > device exists but represents the box, not the stick. I read
> 
> Some questions:
> 
> What's your udev and kernel version?
> 
sys-fs/udev-070-r1
2.6.13-gentoo-r3

> Did you configure your kernel to use USB storage (if in doubt, post your 
> kernel config)?

Yes, and I can use the devices (write and read files...).

        CONFIG_USB_STORAGE=y
        (...)
        # SCSI device support
        #
        CONFIG_SCSI=y
        CONFIG_SCSI_PROC_FS=y
        
        #
        # SCSI support type (disk, tape, CD-ROM)
        #
        CONFIG_BLK_DEV_SD=y
        
> 
> Does the system detect the devices when you plug them in (post the last few 
> lines of dmesg output after plugging in each device)
> 
ipt_recent v0.3.1: Stephen Frost <[EMAIL PROTECTED]>.
http://snowman.net/projects/ipt_recent/
spurious 8259A interrupt: IRQ7.
EXT3 FS on hda6, internal journal
usb 1-3: new high speed USB device using ehci_hcd and address 3
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
  Vendor: Maxtor 6  Model: L250R0            Rev: BAH4
    Type:   Direct-Access                      ANSI SCSI revision: 00
    SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
    sda: assuming drive cache: write through
    SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
    sda: assuming drive cache: write through
     sda: unknown partition table
     Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
     usb-storage: device scan complete
     SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
     sda: assuming drive cache: write through
      sda: sda1
      SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
      sda: assuming drive cache: write through
       sda: sda1
       kjournald starting.  Commit interval 5 seconds
       EXT3 FS on sda1, internal journal
       EXT3-fs: mounted filesystem with ordered data mode.
       kjournald starting.  Commit interval 5 seconds
       EXT3 FS on sda1, internal journal
       EXT3-fs: mounted filesystem with ordered data mode.
       kjournald starting.  Commit interval 5 seconds
       EXT3 FS on sda1, internal journal
       EXT3-fs: mounted filesystem with ordered data mode.
       FAT: "conv=auto" option is obsolete, not supported now
       FAT: "posix" option is obsolete, not supported now
       FAT: bogus number of reserved sectors
       VFS: Can't find a valid FAT filesystem on dev sda1.
       kjournald starting.  Commit interval 5 seconds
       EXT3 FS on sda1, internal journal
       EXT3-fs: mounted filesystem with ordered data mode.
       kjournald starting.  Commit interval 5 seconds
       EXT3 FS on sda1, internal journal
       EXT3-fs: mounted filesystem with ordered data mode.

The memstick has a vfat in it (original). The external disk has 1
partition with ext3.
The line in /etc/fstab corresponding to the memstick (the disk doesn't
have one, yet):
        /dev/plextor_memstick1          /mnt/pen        vfat 
noauto,user,noexec,nodev,rw,noatime,conv=auto,uni_xlate,posix   0 0

Now I plugged the memstick. dmesg says:

        usb 1-7: new high speed USB device using ehci_hcd and address 4
        usb 1-7: device descriptor read/64, error -71
        scsi1 : SCSI emulation for USB Mass Storage devices
        usb-storage: device found at 4
        usb-storage: waiting for device to settle before scanning
        usb 1-7: reset high speed USB device using ehci_hcd and address 4
          Vendor: PLEXTOR   Model: PlexFlash-2       Rev: 5.02
            Type:   Direct-Access                      ANSI SCSI revision: 00
            usb 1-7: reset high speed USB device using ehci_hcd and address 4
            usb 1-7: reset high speed USB device using ehci_hcd and address 4
            usb 1-7: reset high speed USB device using ehci_hcd and address 4
            usb 1-7: reset high speed USB device using ehci_hcd and address 4
            usb 1-7: reset high speed USB device using ehci_hcd and address 4
            usb 1-7: reset high speed USB device using ehci_hcd and address 4
            sdb: Write Protect is on
            sdb: Mode Sense: 45 00 80 08
            sdb: assuming drive cache: write through
            Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
            usb-storage: device scan complete
            

> What does udevinfo -a -p $(udevinfo -q path -n /dev/sdX) tell you (replace X 
> with the appropriate letter for each device)?
> 
$ udevinfo -a -p $(udevinfo -q path -n /dev/sda)

udevinfo starts with the device the node belongs to and then walks up the
device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule,
to match the device for which the node will be created.

device '/sys/block/sda' has major:minor 8:0
  looking at class device '/sys/block/sda':
    KERNEL=="sda"
    SUBSYSTEM=="block"
    SYSFS{dev}=="8:0"
    SYSFS{range}=="16"
    SYSFS{removable}=="0"
    SYSFS{size}=="490234752"
    SYSFS{stat}=="     105      547     1975      616     5584   619494  
1250606  3500080        0    25620  3500696"

follow the "device"-link to the physical device:
  looking at the device chain at 
'/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host0/target0:0:0/0:0:0:0':
    BUS=="scsi"
    ID=="0:0:0:0"
    DRIVER=="sd"
    SYSFS{device_blocked}=="0"
    SYSFS{iocounterbits}=="32"
    SYSFS{iodone_cnt}=="0x1642"
    SYSFS{ioerr_cnt}=="0x0"
    SYSFS{iorequest_cnt}=="0x1642"
    SYSFS{max_sectors}=="240"
    SYSFS{model}=="L250R0          "
    SYSFS{queue_depth}=="1"
    SYSFS{queue_type}=="none"
    SYSFS{rev}=="BAH4"
    SYSFS{scsi_level}=="3"
    SYSFS{state}=="running"
    SYSFS{timeout}=="30"
    SYSFS{type}=="0"
    SYSFS{vendor}=="Maxtor 6"

  looking at the device chain at 
'/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host0/target0:0:0':
    BUS==""
    ID=="target0:0:0"
    DRIVER=="unknown"

  looking at the device chain at 
'/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host0':
    BUS==""
    ID=="host0"
    DRIVER=="unknown"

  looking at the device chain at 
'/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0':
    BUS=="usb"
    ID=="1-3:1.0"
    DRIVER=="usb-storage"
    SYSFS{bAlternateSetting}==" 0"
    SYSFS{bInterfaceClass}=="08"
    SYSFS{bInterfaceNumber}=="00"
    SYSFS{bInterfaceProtocol}=="50"
    SYSFS{bInterfaceSubClass}=="06"
    SYSFS{bNumEndpoints}=="02"
    SYSFS{modalias}=="usb:v067Bp3507d0100dc00dsc00dp00ic08isc06ip50"

  looking at the device chain at 
'/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3':
    BUS=="usb"
    ID=="1-3"
    DRIVER=="usb"
    SYSFS{bConfigurationValue}=="1"
    SYSFS{bDeviceClass}=="00"
    SYSFS{bDeviceProtocol}=="00"
    SYSFS{bDeviceSubClass}=="00"
    SYSFS{bMaxPacketSize0}=="64"
    SYSFS{bMaxPower}=="100mA"
    SYSFS{bNumConfigurations}=="1"
    SYSFS{bNumInterfaces}==" 1"
    SYSFS{bcdDevice}=="0100"
    SYSFS{bmAttributes}=="c0"
    SYSFS{configuration}==""
    SYSFS{devnum}=="3"
    SYSFS{idProduct}=="3507"
    SYSFS{idVendor}=="067b"
    SYSFS{manufacturer}=="Prolific Technology Inc."
    SYSFS{maxchild}=="0"
    SYSFS{product}=="Mass Storage Device"
    SYSFS{serial}=="0"
    SYSFS{speed}=="480"
    SYSFS{version}==" 2.00"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.7/usb1':
    BUS=="usb"
    ID=="usb1"
    DRIVER=="usb"
    SYSFS{bConfigurationValue}=="1"
    SYSFS{bDeviceClass}=="09"
    SYSFS{bDeviceProtocol}=="01"
    SYSFS{bDeviceSubClass}=="00"
    SYSFS{bMaxPacketSize0}=="8"
    SYSFS{bMaxPower}=="  0mA"
    SYSFS{bNumConfigurations}=="1"
    SYSFS{bNumInterfaces}==" 1"
    SYSFS{bcdDevice}=="0206"
    SYSFS{bmAttributes}=="e0"
    SYSFS{configuration}==""
    SYSFS{devnum}=="1"
    SYSFS{idProduct}=="0000"
    SYSFS{idVendor}=="0000"
    SYSFS{manufacturer}=="Linux 2.6.13-gentoo-r3 ehci_hcd"
    SYSFS{maxchild}=="8"
    SYSFS{product}=="Intel Corporation 82801EB/ER _ICH5/ICH5R_ USB2 EHCI 
Controller"
    SYSFS{serial}=="0000:00:1d.7"
    SYSFS{speed}=="480"
    SYSFS{version}==" 2.00"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.7':
    BUS=="pci"
    ID=="0000:00:1d.7"
    DRIVER=="ehci_hcd"
    SYSFS{class}=="0x0c0320"
    SYSFS{device}=="0x24dd"
    SYSFS{irq}=="10"
    SYSFS{local_cpus}=="1"
    SYSFS{modalias}=="pci:v00008086d000024DDsv00001462sd00007280bc0Csc03i20"
    SYSFS{subsystem_device}=="0x7280"
    SYSFS{subsystem_vendor}=="0x1462"
    SYSFS{vendor}=="0x8086"

  looking at the device chain at '/sys/devices/pci0000:00':
    BUS==""
    ID=="pci0000:00"
    DRIVER=="unknown"
 
After plugging the memstick:

        $ udevinfo -a -p $(udevinfo -q path -n /dev/sdb)
        no record for 'sdb' in database
        udevinfo: option requires an argument -- p
        Usage: udevinfo [-anpqrVh]
          (etc)
> Maybe we can sort this out.
> 
> Bye...
> 
>       Dirk
> 
Thanks.


Jorge 
-- 
gentoo-user@gentoo.org mailing list

Reply via email to