linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev rules for usb-storage devices only used once
@ 2005-01-29 18:16 Glyn Kennington
  2005-01-29 19:28 ` Kay Sievers
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Glyn Kennington @ 2005-01-29 18:16 UTC (permalink / raw)
  To: linux-hotplug

Hello,

udev appears to only be able to use my configured rules once.  After
unplugging and replugging the same device, they are ignored.  I'm using
a four-in-one flash card adaptor on my Debian system (kernel 2.6.9, udev
0.050).

In my /etc/udev/rules.d/iapp.rules:
-----------
BUS="scsi", SYSFS{vendor}="IN-WIN", SYSFS{model}="iAPP  HS-SM", NAME="%k", SYMLINK="sm%n"
-----------

Here's the relevant bits of /var/log/syslog:

Plugging in the adaptor (with a CompactFlash card in it) the first time:

Jan 29 18:04:40 abrasive kernel: usb 4-1: new high speed USB device using address 6
Jan 29 18:04:40 abrasive udevsend[8308]: udevd daemon started
Jan 29 18:04:40 abrasive usb.agent[8319]:      usb-storage: already loaded
Jan 29 18:04:40 abrasive kernel: scsi4 : SCSI emulation for USB Mass Storage devices
Jan 29 18:04:40 abrasive kernel:   Vendor: IN-WIN    Model: iAPP  HS-CF       Rev: 0.96
Jan 29 18:04:40 abrasive kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 29 18:04:40 abrasive kernel: Attached scsi removable disk sda at scsi4, channel 0, id 0, lun 0
Jan 29 18:04:40 abrasive kernel:   Vendor: IN-WIN    Model: iAPP  HS-MS       Rev: 0.96
Jan 29 18:04:40 abrasive kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 29 18:04:40 abrasive kernel: Attached scsi removable disk sdb at scsi4, channel 0, id 0, lun 1
Jan 29 18:04:40 abrasive kernel:   Vendor: IN-WIN    Model: iAPP  HS-SM       Rev: 0.96
Jan 29 18:04:40 abrasive kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 29 18:04:40 abrasive kernel: SCSI device sdc: 128000 512-byte hdwr sectors (66 MB)
Jan 29 18:04:40 abrasive kernel: sdc: Write Protect is off
Jan 29 18:04:40 abrasive kernel: sdc: Mode Sense: 03 00 00 00
Jan 29 18:04:40 abrasive kernel: sdc: assuming drive cache: write through
Jan 29 18:04:41 abrasive kernel:  sdc:<7>usb-storage: queuecommand called
Jan 29 18:04:41 abrasive kernel:  sdc1
Jan 29 18:04:41 abrasive kernel: Attached scsi removable disk sdc at scsi4, channel 0, id 0, lun 2
Jan 29 18:04:41 abrasive kernel:   Vendor: IN-WIN    Model: iAPP  HS-SD/MMC   Rev: 0.96
Jan 29 18:04:41 abrasive kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 29 18:04:41 abrasive kernel: Attached scsi removable disk sdd at scsi4, channel 0, id 0, lun 3
Jan 29 18:04:41 abrasive kernel: USB Mass Storage device found at 6
Jan 29 18:04:41 abrasive scsi.agent[8354]: disk at /devices/pci0000:00/0000:00:1d.7/usb4/4-1/4-1:1.0/host4/4:0:0:0
Jan 29 18:04:41 abrasive scsi.agent[8374]: disk at /devices/pci0000:00/0000:00:1d.7/usb4/4-1/4-1:1.0/host4/4:0:0:1
Jan 29 18:04:41 abrasive scsi.agent[8394]: disk at /devices/pci0000:00/0000:00:1d.7/usb4/4-1/4-1:1.0/host4/4:0:0:2
Jan 29 18:04:41 abrasive scsi.agent[8420]: disk at /devices/pci0000:00/0000:00:1d.7/usb4/4-1/4-1:1.0/host4/4:0:0:3
Jan 29 18:04:50 abrasive udev[8463]: configured rule in '/etc/udev/rules.d/iapp.rules' at line 3 app
lied, added symlink 'sm%n'
Jan 29 18:04:50 abrasive udev[8463]: configured rule in '/etc/udev/rules.d/iapp.rules' at line 3 app
lied, 'sdc' becomes '%k'
Jan 29 18:04:50 abrasive udev[8463]: creating device node '/dev/sdc'
Jan 29 18:04:50 abrasive udev[8469]: configured rule in '/etc/udev/rules.d/iapp.rules' at line 3 app
lied, added symlink 'sm%n'
Jan 29 18:04:50 abrasive udev[8469]: configured rule in '/etc/udev/rules.d/iapp.rules' at line 3 app
lied, 'sdc1' becomes '%k'
Jan 29 18:04:50 abrasive udev[8469]: creating device node '/dev/sdc1'
Jan 29 18:04:50 abrasive udev[8459]: creating device node '/dev/sda'
Jan 29 18:04:50 abrasive udev[8461]: creating device node '/dev/sdb'
Jan 29 18:04:50 abrasive udev[8466]: creating device node '/dev/sdd'

This creates the devices sda, sdb, sdc, sdd and sdc1 (the one partition on the
SM card), and the appropriate symlinks sm and sm1.

Without attempting to mount the card, unplug the adaptor:

Jan 29 18:07:32 abrasive udev[8504]: removing device node '/dev/sda'
Jan 29 18:07:32 abrasive udev[8527]: removing device node '/dev/sdb'
Jan 29 18:07:32 abrasive udev[8550]: removing device node '/dev/sdc1'
Jan 29 18:07:32 abrasive udev[8558]: removing device node '/dev/sdc'
Jan 29 18:07:32 abrasive udev[8581]: removing device node '/dev/sdd'
Jan 29 18:07:32 abrasive kernel: usb 4-1: USB disconnect, address 6

So far so good.  Now, plugging it in again:

Jan 29 18:08:52 abrasive kernel: hub 1-0:1.0: over-current change on port 1
Jan 29 18:08:52 abrasive kernel: hub 4-0:1.0: over-current change on port 1
Jan 29 18:08:52 abrasive kernel: usb 4-1: new high speed USB device using address 7
Jan 29 18:08:52 abrasive usb.agent[8640]:      usb-storage: already loaded
Jan 29 18:08:52 abrasive kernel: scsi5 : SCSI emulation for USB Mass Storage devices
Jan 29 18:08:52 abrasive kernel:   Vendor: IN-WIN    Model: iAPP  HS-CF       Rev: 0.96
Jan 29 18:08:52 abrasive kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 29 18:08:52 abrasive udev[8685]: creating device node '/dev/sda'
Jan 29 18:08:52 abrasive udev[8709]: creating device node '/dev/sdb'
Jan 29 18:08:52 abrasive kernel: Attached scsi removable disk sda at scsi5, channel 0, id 0, lun 0
Jan 29 18:08:52 abrasive kernel:   Vendor: IN-WIN    Model: iAPP  HS-MS       Rev: 0.96
Jan 29 18:08:52 abrasive kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 29 18:08:52 abrasive kernel: Attached scsi removable disk sdb at scsi5, channel 0, id 0, lun 1
Jan 29 18:08:52 abrasive kernel:   Vendor: IN-WIN    Model: iAPP  HS-SM       Rev: 0.96
Jan 29 18:08:52 abrasive kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 29 18:08:53 abrasive udev[8733]: creating device node '/dev/sdc'
Jan 29 18:08:53 abrasive udev[8741]: creating device node '/dev/sdc1'
Jan 29 18:08:53 abrasive udev[8765]: creating device node '/dev/sdd'
Jan 29 18:08:53 abrasive kernel: SCSI device sdc: 128000 512-byte hdwr sectors (66 MB)
Jan 29 18:08:53 abrasive kernel: sdc: Write Protect is off
Jan 29 18:08:53 abrasive kernel: sdc: Mode Sense: 03 00 00 00
Jan 29 18:08:53 abrasive kernel: sdc: assuming drive cache: write through
Jan 29 18:08:53 abrasive kernel:  sdc:<7>usb-storage: queuecommand called
Jan 29 18:08:53 abrasive kernel:  sdc1
Jan 29 18:08:53 abrasive kernel: Attached scsi removable disk sdc at scsi5, channel 0, id 0, lun 2
Jan 29 18:08:53 abrasive kernel:   Vendor: IN-WIN    Model: iAPP  HS-SD/MMC   Rev: 0.96
Jan 29 18:08:53 abrasive kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 29 18:08:53 abrasive kernel: Attached scsi removable disk sdd at scsi5, channel 0, id 0, lun 3
Jan 29 18:08:53 abrasive kernel: USB Mass Storage device found at 7
Jan 29 18:08:53 abrasive scsi.agent[8677]: disk at /devices/pci0000:00/0000:00:1d.7/usb4/4-1/4-1:1.0 /host5/5:0:0:0
Jan 29 18:08:53 abrasive scsi.agent[8700]: disk at /devices/pci0000:00/0000:00:1d.7/usb4/4-1/4-1:1.0 /host5/5:0:0:1
Jan 29 18:08:53 abrasive scsi.agent[8725]: disk at /devices/pci0000:00/0000:00:1d.7/usb4/4-1/4-1:1.0 /host5/5:0:0:2
Jan 29 18:08:54 abrasive scsi.agent[8757]: disk at /devices/pci0000:00/0000:00:1d.7/usb4/4-1/4-1:1.0 /host5/5:0:0:3


To get the renaming to work again, I have to restart udev before
plugging the adaptor in.  Any suggestions as to what's going wrong?

Glyn


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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] 7+ messages in thread

* Re: udev rules for usb-storage devices only used once
  2005-01-29 18:16 udev rules for usb-storage devices only used once Glyn Kennington
@ 2005-01-29 19:28 ` Kay Sievers
  2005-01-29 19:32 ` Glyn Kennington
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2005-01-29 19:28 UTC (permalink / raw)
  To: linux-hotplug

On Sat, 2005-01-29 at 18:16 +0000, Glyn Kennington wrote:
> udev appears to only be able to use my configured rules once.  After
> unplugging and replugging the same device, they are ignored.  I'm using
> a four-in-one flash card adaptor on my Debian system (kernel 2.6.9, udev
> 0.050).
> 
> In my /etc/udev/rules.d/iapp.rules:
> -----------
> BUS="scsi", SYSFS{vendor}="IN-WIN", SYSFS{model}="iAPP  HS-SM", NAME="%k", SYMLINK="sm%n"
> -----------

> This creates the devices sda, sdb, sdc, sdd and sdc1 (the one partition on the
> SM card), and the appropriate symlinks sm and sm1.

> To get the renaming to work again, I have to restart udev before
> plugging the adaptor in.  Any suggestions as to what's going wrong?

No idea. Maybe your tmpfs partition is too small?

What does:
  df -kh /dev

print?

Thanks,
Kay



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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] 7+ messages in thread

* Re: udev rules for usb-storage devices only used once
  2005-01-29 18:16 udev rules for usb-storage devices only used once Glyn Kennington
  2005-01-29 19:28 ` Kay Sievers
@ 2005-01-29 19:32 ` Glyn Kennington
  2005-01-29 20:27 ` Kay Sievers
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Glyn Kennington @ 2005-01-29 19:32 UTC (permalink / raw)
  To: linux-hotplug

Kay Sievers wrote:
> > To get the renaming to work again, I have to restart udev before
> > plugging the adaptor in.  Any suggestions as to what's going wrong?
> 
> No idea. Maybe your tmpfs partition is too small?
> 
> What does:
>   df -kh /dev
> 
> print?

Filesystem            Size  Used Avail Use% Mounted on
none                  5.0M  2.7M  2.4M  53% /dev

The Debian default udev.conf has

	tmpfs_size="5M"

so I'd assumed that would be a sensible size.

Glyn


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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] 7+ messages in thread

* Re: udev rules for usb-storage devices only used once
  2005-01-29 18:16 udev rules for usb-storage devices only used once Glyn Kennington
  2005-01-29 19:28 ` Kay Sievers
  2005-01-29 19:32 ` Glyn Kennington
@ 2005-01-29 20:27 ` Kay Sievers
  2005-01-29 21:54 ` Glyn Kennington
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2005-01-29 20:27 UTC (permalink / raw)
  To: linux-hotplug

On Sat, 2005-01-29 at 19:32 +0000, Glyn Kennington wrote:
> Kay Sievers wrote:
> > > To get the renaming to work again, I have to restart udev before
> > > plugging the adaptor in.  Any suggestions as to what's going wrong?
> > 
> > No idea. Maybe your tmpfs partition is too small?
> > 
> > What does:
> >   df -kh /dev
> > 
> > print?
> 
> Filesystem            Size  Used Avail Use% Mounted on
> none                  5.0M  2.7M  2.4M  53% /dev
> 
> The Debian default udev.conf has
> 
> 	tmpfs_size="5M"
> 
> so I'd assumed that would be a sensible size.

Ok, don't know why there is a limit at all, but anyway...

What does:
  udevtest /block/sdc/sdc1

print at the time you don't get the rule applied?

Kay



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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] 7+ messages in thread

* Re: udev rules for usb-storage devices only used once
  2005-01-29 18:16 udev rules for usb-storage devices only used once Glyn Kennington
                   ` (2 preceding siblings ...)
  2005-01-29 20:27 ` Kay Sievers
@ 2005-01-29 21:54 ` Glyn Kennington
  2005-01-29 23:22 ` Greg KH
  2005-01-30 10:01 ` Glyn Kennington
  5 siblings, 0 replies; 7+ messages in thread
From: Glyn Kennington @ 2005-01-29 21:54 UTC (permalink / raw)
  To: linux-hotplug

Kay Sievers wrote:
> What does:
>   udevtest /block/sdc/sdc1
> 
> print at the time you don't get the rule applied?

$ udevtest /block/sdc/sdc1
version 050
looking at '/block/sdc/sdc1'
opened class_dev->name='sdc1'
configured rule in '/etc/udev/rules.d/iapp.rules' at line 3 applied, added symlink 'sm%n'
configured rule in '/etc/udev/rules.d/iapp.rules' at line 3 applied, 'sdc1' becomes '%k'
creating device node '/dev/sdc1', major = '8', minor = '33', mode = '060660', uid = '0', gid = '6'

The output is exactly the same when the rule is applied correctly.

Oh, in case it's relevant, this isn't the stock 2.6.9 kernel - I have
the supermount-ng and fbsplash patches applied.

Glyn


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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] 7+ messages in thread

* Re: udev rules for usb-storage devices only used once
  2005-01-29 18:16 udev rules for usb-storage devices only used once Glyn Kennington
                   ` (3 preceding siblings ...)
  2005-01-29 21:54 ` Glyn Kennington
@ 2005-01-29 23:22 ` Greg KH
  2005-01-30 10:01 ` Glyn Kennington
  5 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2005-01-29 23:22 UTC (permalink / raw)
  To: linux-hotplug

On Sat, Jan 29, 2005 at 09:54:16PM +0000, Glyn Kennington wrote:
> Kay Sievers wrote:
> > What does:
> >   udevtest /block/sdc/sdc1
> > 
> > print at the time you don't get the rule applied?
> 
> $ udevtest /block/sdc/sdc1
> version 050
> looking at '/block/sdc/sdc1'
> opened class_dev->name='sdc1'
> configured rule in '/etc/udev/rules.d/iapp.rules' at line 3 applied, added symlink 'sm%n'
> configured rule in '/etc/udev/rules.d/iapp.rules' at line 3 applied, 'sdc1' becomes '%k'
> creating device node '/dev/sdc1', major = '8', minor = '33', mode = '060660', uid = '0', gid = '6'
> 
> The output is exactly the same when the rule is applied correctly.
> 
> Oh, in case it's relevant, this isn't the stock 2.6.9 kernel - I have
> the supermount-ng and fbsplash patches applied.

Can you try it with a stock 2.6.9 (or preferably a 2.6.10) kernel?  The
supermount-ng crud might be getting in the way somehow.

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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] 7+ messages in thread

* Re: udev rules for usb-storage devices only used once
  2005-01-29 18:16 udev rules for usb-storage devices only used once Glyn Kennington
                   ` (4 preceding siblings ...)
  2005-01-29 23:22 ` Greg KH
@ 2005-01-30 10:01 ` Glyn Kennington
  5 siblings, 0 replies; 7+ messages in thread
From: Glyn Kennington @ 2005-01-30 10:01 UTC (permalink / raw)
  To: linux-hotplug

Greg KH wrote:
> > Oh, in case it's relevant, this isn't the stock 2.6.9 kernel - I have
> > the supermount-ng and fbsplash patches applied.
> 
> Can you try it with a stock 2.6.9 (or preferably a 2.6.10) kernel?  The
> supermount-ng crud might be getting in the way somehow.

I'd hoped it wouldn't come to that...

[some hours later]

With 2.6.10 stock (and 2.6.10+fbsplash), the devices are all created
properly.  Looks like I'll have to go back to using automount for
removable devices.  Thankyou for your help.

Glyn


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2005-01-30 10:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-29 18:16 udev rules for usb-storage devices only used once Glyn Kennington
2005-01-29 19:28 ` Kay Sievers
2005-01-29 19:32 ` Glyn Kennington
2005-01-29 20:27 ` Kay Sievers
2005-01-29 21:54 ` Glyn Kennington
2005-01-29 23:22 ` Greg KH
2005-01-30 10:01 ` Glyn Kennington

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).