From: Kay Sievers Date: Thu, 03 Aug 2006 07:38:24 +0000 Subject: Re: Identical USB devices rules Message-Id: <1154590704.8439.4.camel@min.off.vrfy.org> List-Id: References: <200608021809.13802.James@Finnall.net> In-Reply-To: <200608021809.13802.James@Finnall.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Wed, 2006-08-02 at 18:09 -0400, James Finnall wrote: > New to the list and searched the archives some but unable to locate somet= hing=20 > on identical hotplug devices for writing rules. I am running udev and I = had=20 > a custom rule for an external drive enclosure as follows: >=20 > SYSFS{idVendor}=3D"0402", SYSFS{idProduct}=3D"5642", NAME=3D"disk/drv%n" >=20 > This works as desired for either of my devices that are identical when on= ly=20 > one is attached. But today I had a need to clone one drive to another us= ing=20 > both devices at the same time. I found that udev assigned the device=20 > assignments to the 2nd drive unit as the first drive. >=20 > The kernel originally used /dev/sde and /dev/sdf for each of the drives w= hen=20 > they were connected. And of course these could change depending on what = else=20 > may be connected at any given time by USB or IEEE1394. Being unable to=20 > identify them separately in a rule to be sequential, I could only remark = out=20 > the rule above and then proceed with the kernel names that were assigned. >=20 > Is there a way to sequentially assign the drives using the name conventio= n=20 > above as in /dev/disk1/drv%n and /dev/disk2/drv%n when using multiple dev= ices=20 > that are identical? Almost all recent distros ship the persistent disk links maintained by udev which create /dev/disk/by-{id,label,uuid,path} directories and put symlinks in there. If you clone disks you copy uuid and label, which breaks by-label and by-uuid, but by-path should still work. If your drive enclosure is not one of the real cheap ones, you get a serial number there, which should make by-id work. Kay ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ 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