linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Udev-124, USB tape drive
@ 2008-07-10  3:03 John Huttley
  2008-07-10 22:46 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Huttley @ 2008-07-10  3:03 UTC (permalink / raw)
  To: linux-hotplug

Now my scsi tape drives are all identified nicely, (thankyou)
I'm looking at my USB tape drive.

Its st and nst incarnations are getting different /by-id/ info.

HP-C7438A-4855310710385844 -> ../../st4
HP-C7438A-HU107108XD-nst -> ../../nst4

The problem seems to be
KERNEL="st*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS="usb", 
IMPORT{program}="usb_id --export %p"


but that won't pick up nst*, as the later rules do.
Also applys to the 1394 tape drives.


Regards,

john

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

* Re: Udev-124, USB tape drive
  2008-07-10  3:03 Udev-124, USB tape drive John Huttley
@ 2008-07-10 22:46 ` Kay Sievers
  2008-07-10 23:36 ` John Huttley
  2008-07-11  8:05 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2008-07-10 22:46 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Jul 10, 2008 at 05:03, John Huttley <John@mib-infotech.co.nz> wrote:
> Now my scsi tape drives are all identified nicely, (thankyou)
> I'm looking at my USB tape drive.
>
> Its st and nst incarnations are getting different /by-id/ info.
>
> HP-C7438A-4855310710385844 -> ../../st4
> HP-C7438A-HU107108XD-nst -> ../../nst4
>
> The problem seems to be
> KERNEL="st*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS="usb",
> IMPORT{program}="usb_id --export %p"
>
>
> but that won't pick up nst*, as the later rules do.
> Also applys to the 1394 tape drives.

Care to adapt the rules to work on your box, then we can start from there?

Thanks a lot,
Kay

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

* Re: Udev-124, USB tape drive
  2008-07-10  3:03 Udev-124, USB tape drive John Huttley
  2008-07-10 22:46 ` Kay Sievers
@ 2008-07-10 23:36 ` John Huttley
  2008-07-11  8:05 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: John Huttley @ 2008-07-10 23:36 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

Ok, attached is my 60-persistent-storage-tape.rules

adding |nst*[0-9]  seems to have fixed the issue.

my tape/by-id/  looks like

HP-C7438A-4855310710385844 -> ../../st4
HP-C7438A-4855310710385844-nst -> ../../nst4
HP-Ultrium_1-SCSI-HU84H06998 -> ../../st3
HP-Ultrium_1-SCSI-HU84H06998-nst -> ../../nst3
HP-Ultrium_2-SCSI-HUL3K02633 -> ../../st2
HP-Ultrium_2-SCSI-HUL3K02633-nst -> ../../nst2
QUANTUM-DLT8000-PXB23P0605 -> ../../st1
QUANTUM-DLT8000-PXB23P0605-nst -> ../../nst1
QUANTUM-DLT8000-PXB23P0632 -> ../../st0
QUANTUM-DLT8000-PXB23P0632-nst -> ../../nst0
STK-L80-LLC02205205 ->../../sg1


which in my opinion is a huge improvement, since I can see which drive 
is which and the serial number matches up with the serial number shown 
by tapeinfo.



I think that should be the standard.


The USB drive (C7438A) is now consistent between st and nst, however the
serial number is HU107108XD  not  4855310710385844.

I have no idea how to fix that since the rules now use things like bsg 
and usb_id %p which  are entirely undocumented.

Regards,

John



Kay Sievers wrote:
> On Thu, Jul 10, 2008 at 05:03, John Huttley <John@mib-infotech.co.nz> wrote:
>> Now my scsi tape drives are all identified nicely, (thankyou)
>> I'm looking at my USB tape drive.
>>
>> Its st and nst incarnations are getting different /by-id/ info.
>>
>> HP-C7438A-4855310710385844 -> ../../st4
>> HP-C7438A-HU107108XD-nst -> ../../nst4
>>
>> The problem seems to be
>> KERNEL=="st*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb",
>> IMPORT{program}="usb_id --export %p"
>>
>>
>> but that won't pick up nst*, as the later rules do.
>> Also applys to the 1394 tape drives.
> 
> Care to adapt the rules to work on your box, then we can start from there?
> 
> Thanks a lot,
> Kay
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

[-- Attachment #2: 60-persistent-storage-tape.rules --]
[-- Type: text/plain, Size: 1461 bytes --]

# do not edit this file, it will be overwritten on update

# persistent storage links: /dev/tape/{by-id,by-path}

ACTION!="add|change", GOTO="persistent_storage_tape_end"

# type 8 devices are "Medium Changers"
KERNEL=="sg[0-9]*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --page=0x80 --export --whitelisted -d $tempnode", SYMLINK+="tape/by-id/$env{ID_VENDOR}-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}"

SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end"

KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"

KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", ENV{BSG_DEV}="$root/bsg/$id"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", WAIT_FOR="$env{BSG_DEV}", IMPORT="scsi_id --page=0x80 --whitelisted --export --device=$env{BSG_DEV}", ENV{ID_BUS}="scsi"

KERNEL=="st*[0-9]",  ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_VENDOR}-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}"
KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_VENDOR}-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}-nst"

# by-path (shortest physical path)
KERNEL=="st*[0-9]", IMPORT{program}="path_id %p"
KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}"

LABEL="persistent_storage_tape_end"

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

* Re: Udev-124, USB tape drive
  2008-07-10  3:03 Udev-124, USB tape drive John Huttley
  2008-07-10 22:46 ` Kay Sievers
  2008-07-10 23:36 ` John Huttley
@ 2008-07-11  8:05 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2008-07-11  8:05 UTC (permalink / raw)
  To: linux-hotplug

On Fri, 2008-07-11 at 11:36 +1200, John Huttley wrote:
> Ok, attached is my 60-persistent-storage-tape.rules
> 
> adding |nst*[0-9]  seems to have fixed the issue.
> 
> my tape/by-id/  looks like
> 
> HP-C7438A-4855310710385844 -> ../../st4
> HP-C7438A-4855310710385844-nst -> ../../nst4
> HP-Ultrium_1-SCSI-HU84H06998 -> ../../st3
> HP-Ultrium_1-SCSI-HU84H06998-nst -> ../../nst3
> HP-Ultrium_2-SCSI-HUL3K02633 -> ../../st2
> HP-Ultrium_2-SCSI-HUL3K02633-nst -> ../../nst2
> QUANTUM-DLT8000-PXB23P0605 -> ../../st1
> QUANTUM-DLT8000-PXB23P0605-nst -> ../../nst1
> QUANTUM-DLT8000-PXB23P0632 -> ../../st0
> QUANTUM-DLT8000-PXB23P0632-nst -> ../../nst0
> STK-L80-LLC02205205 ->../../sg1
> 
> 
> which in my opinion is a huge improvement, since I can see which drive 
> is which and the serial number matches up with the serial number shown 
> by tapeinfo.
> 
> I think that should be the standard.

Thanks! I've added the nst* matches. We currently prefix all links with
the bus, to keep the id's unique. I left that in for now, we better
should not break _all_ currently used links. :) Why are you using
ID_SERIAL_SHORT? scsi_id already does all the needed logic to produce a
unique id, right?

> The USB drive (C7438A) is now consistent between st and nst, however the
> serial number is HU107108XD  not  4855310710385844.

It's the USB serial number from the USB device. I guess that's fine.

> I have no idea how to fix that since the rules now use things like bsg 
> and usb_id %p which  are entirely undocumented.

/dev/bsg/* is just like sg*, only with a newer protocol version. sg will
eventually go away, and in the longer term we will fix bsg to show up
before the tape/disk/... nodes, so the WAIT_FOR rule can go.

usb_id just tries to extract persistent data from the USB device
strings/descriptors. It's a bit magic, but does basically just what the
command line output shows:
  /lib/udev/usb_id --export /devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/input/input10/mouse1
  ID_VENDOR=Logitech
  ID_MODEL=USB-PS.2_Optical_Mouse
  ID_REVISION 00
  ID_SERIAL=Logitech_USB-PS.2_Optical_Mouse
  ID_TYPE=hid
  ID_BUS=usb

  /lib/udev/usb_id --export /devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb
  ID_VENDOR=SAMSUNG
  ID_MODEL=HM160HI
  ID_REVISIONì02
  ID_SERIAL=SAMSUNG_HM160HI_SAMSUNG_HMS10UJD0PA02660-0:0
  ID_SERIAL_SHORT=SAMSUNG_HMS10UJD0PA02660
  ID_TYPE=disk
  ID_INSTANCE=0:0
  ID_BUS=usb

Kay


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

end of thread, other threads:[~2008-07-11  8:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-10  3:03 Udev-124, USB tape drive John Huttley
2008-07-10 22:46 ` Kay Sievers
2008-07-10 23:36 ` John Huttley
2008-07-11  8:05 ` 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).