From owner-freebsd-questions@FreeBSD.ORG Tue Sep 22 21:43:35 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC76810656C0 for ; Tue, 22 Sep 2009 21:43:35 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) by mx1.freebsd.org (Postfix) with ESMTP id 58AC68FC18 for ; Tue, 22 Sep 2009 21:43:35 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email2.allantgroup.com (8.14.0/8.14.0) with ESMTP id n8MLhV7A001944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Sep 2009 16:43:31 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.3) with ESMTP id n8MLhVbk024611 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Sep 2009 16:43:31 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.3/Submit) id n8MLhVla024610; Tue, 22 Sep 2009 16:43:31 -0500 (CDT) (envelope-from dan) Date: Tue, 22 Sep 2009 16:43:30 -0500 From: Dan Nelson To: Brent Bloxam Message-ID: <20090922214330.GG29215@dan.emsphone.com> References: <4A4500D7.5090104@beanfield.com> <4AB93BA1.9050105@beanfield.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AB93BA1.9050105@beanfield.com> X-OS: FreeBSD 7.2-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email2.allantgroup.com [199.67.51.78]); Tue, 22 Sep 2009 16:43:31 -0500 (CDT) X-Scanned-By: MIMEDefang 2.45 Cc: freebsd-questions@freebsd.org Subject: Re: Device naming on scbus using isp X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 21:43:35 -0000 In the last episode (Sep 22), Brent Bloxam said: > Brent Bloxam wrote: > > I'm wondering about how device names are assigned on scbus, specifically > > when using the isp driver. It seems to me that there's potential when > > an HBA has access to multiple LUNs that on boot the scbus will have > > entries in /dev scrambled compared to the previous run (thus messing up > > mounts). My experience so far has been that da0 will be assigned to the > > first target scanned, da1 to the second, etc. Is this generally > > something countered with device.hints? If a LUN were to go away, but a > > device hint pointing to the target:unit remained, would that cause any > > issues on boot? > > Thought I'd follow up with a bit of information I've determined about > this, despite the lack of response from anyone on list. Maybe someone > will find it useful :) > > I can only speak for this applying to use of isp(4) with scbus(4). > > Devices that operate in target mode appear to isp(4) and are assigned a > target ID starting at 0. The order in which they appear depends on their > fcid or what's known to isp(4) as PortID. This order is ascending, so the > lower fcid takes precedence. isp(4) will then check the target to see if > any LUNs are available to it. If not, the target disappears -- and here's > the important thing to note -- but its target ID does not go away. > > Say you have 5 devices with the following fcids, 4 in target mode: > > 0x00 - target > 0x01 - target > 0x02 - another server with an HBA > 0xF0 - target with LUN > 0xF1 - target with LUN > > isp(4) is loaded at boot, and the following occurs: > > 0x00 appears, is assigned target 0, and disappears because there are no LUNs > 0x01 appears, is assigned target 1, and disappears because there are no LUNs > 0x02 appears and simply disappears because it is not a target > 0xF0 appears, is assigned target 2, and is assigned to da0 > 0xF1 appears, is assigned target 3, and is assigned to da1 > > You can see because of this example that maintaining device names using > /boot/device.hints is impossible if targets in the fabric change. If > 0x00 were to disappear, the target IDs would change and render > /boot/device.hints invalid, or worse, the wrong LUN could be given the > wrong device name. > > Ideally, there would be a way to assign target IDs by fcid, but that > does not exist presently. If you're mounting UFS filesystems, you can label them and mount them by label (see the tunefs and glabel manpages for more info). ZFS should find its pool devices automatically, but you can always manually label devices with glabel and refer to the label instead of the da## name. -- Dan Nelson dnelson@allantgroup.com