From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Fri, 11 Jul 2008 08:05:52 +0000 Subject: Re: Udev-124, USB tape drive Message-Id: <1215763552.4197.12.camel@linux.site> List-Id: References: <48757C12.7020201@mib-infotech.co.nz> In-Reply-To: <48757C12.7020201@mib-infotech.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Fri, 2008-07-11 at 11:36 +1200, John Huttley wrote: > Ok, attached is my 60-persistent-storage-tape.rules >=20 > adding |nst*[0-9] seems to have fixed the issue. >=20 > my tape/by-id/ looks like >=20 > 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 >=20 >=20 > which in my opinion is a huge improvement, since I can see which drive=20 > is which and the serial number matches up with the serial number shown=20 > by tapeinfo. >=20 > 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=20 > 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=3DLogitech ID_MODEL=3DUSB-PS.2_Optical_Mouse ID_REVISION 00 ID_SERIAL=3DLogitech_USB-PS.2_Optical_Mouse ID_TYPE=3Dhid ID_BUS=3Dusb /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=3DSAMSUNG ID_MODEL=3DHM160HI ID_REVISION=EC02 ID_SERIAL=3DSAMSUNG_HM160HI_SAMSUNG_HMS10UJD0PA02660-0:0 ID_SERIAL_SHORT=3DSAMSUNG_HMS10UJD0PA02660 ID_TYPE=3Ddisk ID_INSTANCE=3D0:0 ID_BUS=3Dusb Kay