Gentoo Archives: gentoo-user

From: Dirk Heinrichs <ext-dirk.heinrichs@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] confused udev?
Date: Thu, 17 Nov 2005 14:08:15
Message-Id: 200511171454.37956.ext-dirk.heinrichs@nokia.com
In Reply to: Re: [gentoo-user] confused udev? by Jorge Almeida
1 Am Donnerstag, 17. November 2005 13:43 schrieb ext Jorge Almeida:
2
3 > CONFIG_USB_STORAGE=y
4 > (...)
5
6 Did you also enable the sub options?
7
8 > # SCSI device support
9 > #
10 > CONFIG_SCSI=y
11 > CONFIG_SCSI_PROC_FS=y
12 >
13 > #
14 > # SCSI support type (disk, tape, CD-ROM)
15 > #
16 > CONFIG_BLK_DEV_SD=y
17
18 Looks good.
19
20 dmesg output for the HD looks good, too.
21
22 > usb 1-7: new high speed USB device using ehci_hcd and address 4
23 > usb 1-7: device descriptor read/64, error -71
24 > scsi1 : SCSI emulation for USB Mass Storage devices
25 > usb-storage: device found at 4
26 > usb-storage: waiting for device to settle before scanning
27 > usb 1-7: reset high speed USB device using ehci_hcd and address 4
28 > Vendor: PLEXTOR Model: PlexFlash-2 Rev: 5.02
29 > Type: Direct-Access ANSI SCSI revision: 00
30 > usb 1-7: reset high speed USB device using ehci_hcd and address 4
31 > usb 1-7: reset high speed USB device using ehci_hcd and address 4
32 > usb 1-7: reset high speed USB device using ehci_hcd and address 4
33 > usb 1-7: reset high speed USB device using ehci_hcd and address 4
34 > usb 1-7: reset high speed USB device using ehci_hcd and address 4
35 > usb 1-7: reset high speed USB device using ehci_hcd and address 4
36 > sdb: Write Protect is on
37 > sdb: Mode Sense: 45 00 80 08
38 > sdb: assuming drive cache: write through
39 > Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
40 > usb-storage: device scan complete
41
42 I'm a bit confused about all those resets.
43
44 > > What does udevinfo -a -p $(udevinfo -q path -n /dev/sdX) tell you
45 > > (replace X with the appropriate letter for each device)?
46 >
47 > $ udevinfo -a -p $(udevinfo -q path -n /dev/sda)
48 >
49 > udevinfo starts with the device the node belongs to and then walks up the
50 > device chain, to print for every device found, all possibly useful
51 > attributes in the udev key format.
52 > Only attributes within one device section may be used together in one
53 > rule, to match the device for which the node will be created.
54
55 OK, here's the interesting part:
56
57 >0:0:0:0': BUS=="scsi"
58 > ID=="0:0:0:0"
59 > DRIVER=="sd"
60 > SYSFS{device_blocked}=="0"
61 > SYSFS{iocounterbits}=="32"
62 > SYSFS{iodone_cnt}=="0x1642"
63 > SYSFS{ioerr_cnt}=="0x0"
64 > SYSFS{iorequest_cnt}=="0x1642"
65 > SYSFS{max_sectors}=="240"
66 > SYSFS{model}=="L250R0 "
67 > SYSFS{queue_depth}=="1"
68 > SYSFS{queue_type}=="none"
69 > SYSFS{rev}=="BAH4"
70 > SYSFS{scsi_level}=="3"
71 > SYSFS{state}=="running"
72 > SYSFS{timeout}=="30"
73 > SYSFS{type}=="0"
74 > SYSFS{vendor}=="Maxtor 6"
75
76 That would give the following rule (all in one line):
77
78 BUS=="usb", KERNEL=="sd*", SYSFS{model}=="L250R0 ",
79 SYSFS{vendor}=="Maxtor 6", NAME="usb/disk%n"
80
81 Note the spaces in the model part, don't know wether the wildcard "*" works
82 here, too. Feel free to change the name part to whatever you like :-)
83
84 >
85 > After plugging the memstick:
86 >
87 > $ udevinfo -a -p $(udevinfo -q path -n /dev/sdb)
88 > no record for 'sdb' in database
89 > udevinfo: option requires an argument -- p
90 > Usage: udevinfo [-anpqrVh]
91 > (etc)
92
93 Hmm, this is strange. Did you check if /dev/sdb is really there? I currently
94 have no idea what could be wrong. If not already done, could you recompile
95 your kernel with all sub options of CONFIG_USB_STORAGE and see if this
96 makes any difference with the stick?
97
98 Bye...
99
100 Dirk
101 --
102 Dirk Heinrichs | Tel: +49 (0)162 234 3408
103 Configuration Manager | Fax: +49 (0)211 47068 111
104 Capgemini Deutschland | Mail: dirk.heinrichs@×××××××××.com
105 Hambornerstraße 55 | Web: http://www.capgemini.com
106 D-40472 Düsseldorf | ICQ#: 110037733
107 GPG Public Key C2E467BB | Keyserver: www.keyserver.net

Replies

Subject Author
Re: [gentoo-user] confused udev? Jorge Almeida <jalmeida@××××××××××××.pt>