From: "Gerald V. Livingston II" Date: Sun, 12 Aug 2007 16:58:58 +0000 Subject: Re: Statically nameing a SCSI device Message-Id: <2381.65.170.133.237.1186937938.squirrel@webmail.sysmatrix.net> List-Id: References: <1240.65.170.133.237.1186867534.squirrel@webmail.sysmatrix.net> In-Reply-To: <1240.65.170.133.237.1186867534.squirrel@webmail.sysmatrix.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sun, August 12, 2007 11:29, Kay Sievers said: > On 8/12/07, Gerald V. Livingston II wrote: >> On Sun, August 12, 2007 7:24, Kay Sievers said: >> >> > On 8/12/07, gerald.hotplug@sysmatrix.net >> >> > wrote: >> >> >> >> Now, that being said, it will be a lot easier for *ME* if I always >> know >> >> exactly where the SATA drives are located in the plain-old /dev tree >> and >> >> if I can call them /dev/sdw or /dev/sdz rather than >> >> /dev/disk/by-id/ata-WDC_WD2500YS-01S-WD-WCANY1955037 >> >> >> >> I added this to my local.rules and udevtest says it works great for >> the >> >> first drive I already have installed: >> >> >> >> KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode" >> >> KERNEL="sd*[!0-9]", >> >> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", NAME="sdw" >> >> >> >> As I add the other 3 drives I just need to add lines to identify >> their >> >> serial numbers and set them at sdx, sdy, and sdz. >> > >> > If you change the default name of the nodes, you will never find the >> > disk a possible error log from the kernel belongs to. You should only >> > use symlinks. >> > >> > /dev/disk/* has probably all you need already without any custom rule. >> >> So, better would be: >> >> KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode" >> KERNEL="sd*[!0-9]", >> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", SYMLINK+="sdw" > > Yes, symlinks are better in almost all cases. Still, make sure that > nobody will ever connect a whole bunch of USB sticks. :) And hope the > SCSI error handler will hang and repeated connect/disconnect of a > single block device will produce a real "sdw" device in the kernel. > It's a kind of a dangerous game to allocate names from the kernel > namespace. > >> The disks will all be the same model so the info in /dev/disk will be >> the >> same except for a number or two. Too easy to mix them up if I'm looking >> for something specific while moving hardware around. > > If you use rules later than 60-*.rules, ENV{ID_SERIAL} is already set > by udev's persistent rules, and there is no need to run scsi_id again. > > Kay On my Debian system install persistent.rules runs at "z20" so I've moved my SATA rules file to z22_my.sata.rules. Since nothing on the SYSTEM (only my brain) seems to require /dev/sd"x" to be static I've also changed the persistent symlinks to be more descriptive for me. The z22_my.sata.rules file is currently a single line: KERNEL="sd*[!0-9]", ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", SYMLINK+="sata1" This is a Sun E450 Server class machine with hardware plugged into it that Sun never intended when they built it in the '90s. I haven't decided if I want to try getting a USB controller installed. ;-) Gerald ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ 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