From: gerald.hotplug@sysmatrix.net Date: Sat, 11 Aug 2007 21:25:34 +0000 Subject: Statically nameing a SCSI device Message-Id: <1240.65.170.133.237.1186867534.squirrel@webmail.sysmatrix.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org I know this was discussed recently here: I wasn't on the list at the time so I'm starting a new thread. I have a rather unique situation. I have a machine with 20 drive bays. 16 SCSI-SCA and 4 SATA. The architecture does not know about the SATA controller until the Linux kernel takes over so they cannot be used as boot devices. They need to stay at the "end of the device tree". I would like to give them persistent names of /dev/sdw, /dev/sdx, /dev/sdy, and /dev/sdz. But, all of the programs that udev uses to get unique identifying information about drives to use in naming rules seem to require that you know the kernel name first. Why does nothing in udev seem to allow one to use standard SCSI host,channel,device,lun nomenclature to query a device? The 4 SATA bays will have drives in all of them long before I fill up 16 SCA bays. But, every time I add and SCA drive to the primary controller all of the SATA drives have their kernel name shifted up one letter so I can't use the kernel name to query the device for its serial number. These drives are for data storage only but they will probably be formatted using LVM so I can create one big mount point without having a symlink farm growing so I need to keep stable /dev/sd'x' names for LVM to keep track of them. Anyone have any idea of what I can use to create a uniquely identifying rule for each of these drives so that I can assign static /dev/sd'x' NAMES to them at boot time even when the kernel name has changed? Or, can anyone point me to documentation of a clear way to do this in kernel space. Eg., to have the kernel always assign the same kernel name to a device in a certain range (sdw, sdx, sdy, sdz) based on it's SCSI loaction ID (4,0,0,0 -- 4,0,1,0 -- etc.)? Thanks, Gerald P.S. Wait a sec, I'm re-reading my message before posting and getting an idea but I have too little udev experience to implement it. Can I write a set of rules in a 20-local.rules file that will run scsi_id -g -s /block/sd'x' for every value of 'x' looking for "SATA WDC WD2500YS-01 WD-WCANY1955037" And then assigning NAME=3D"sdw" ?? ------------------------------------------------------------------------- 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