From owner-freebsd-questions@FreeBSD.ORG Mon Sep 18 17:07:52 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6F5B16A407 for ; Mon, 18 Sep 2006 17:07:52 +0000 (UTC) (envelope-from rmarella@gmail.com) Received: from ms-smtp-02.socal.rr.com (ms-smtp-02.socal.rr.com [66.75.162.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B45F43D73 for ; Mon, 18 Sep 2006 17:07:48 +0000 (GMT) (envelope-from rmarella@gmail.com) Received: from asusamd (cpe-66-75-119-235.hawaii.res.rr.com [66.75.119.235]) by ms-smtp-02.socal.rr.com (8.13.6/8.13.6) with ESMTP id k8IH7ka6010336 for ; Mon, 18 Sep 2006 10:07:47 -0700 (PDT) Date: Mon, 18 Sep 2006 07:07:46 -1000 From: Robert Marella To: freebsd-questions@freebsd.org Message-ID: <20060918070746.057a5c02@asusamd> In-Reply-To: <450C58F7.80004@george.lbl.gov> References: <450C58F7.80004@george.lbl.gov> X-Mailer: Sylpheed-Claws 2.4.0 (GTK+ 2.8.20; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine Subject: Re: how to make fixed Direct Access device (da) ID 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: Mon, 18 Sep 2006 17:07:52 -0000 On Sat, 16 Sep 2006 13:05:11 -0700 "Jin Guojun [VFFS]" wrote: > It is awkward that dynamically and/or statically attaching SCSI hard > drive and > USB hard drive to the system will have different da IDs. > For example, boot system with a SCSI drive (SCSI = 1), will have a > da0 for this > SCSI drive. Then plugging in a USB hard drive, which will be > configured as da1. > > If boot system with both drives online, system will boot from SCSI > drive fine till > mounting root point. It fails because USB drive has da0 and SCSI > drive has da1. > > Is there anyway to configure the system to have fixed da ID for SCSI > drive or > even for USB drive regardless if they are dynamically/statically > attached to the > system? > > -Jin Hello Jin Try man (4) scsi: All devices and the SCSI busses support boot time allocation so that an upper number of devices and controllers does not need to be configured; device da0 will suffice for any number of disk drivers. The devices are either wired so they appear as a particular device unit or counted so that they appear as the next available unused unit. Units are wired down by setting kernel environment hints. This is usu- ally done either interactively from the loader(8), or automatically via the /boot/device.hints file. The basic syntax is: hint.device.unit.property="value" Individual SCSI bus numbers can be wired down to specific controllers with a config line similar to the following: hint.scbus.0.at="ahd1" This assigns SCSI bus number 0 to the ahd1 driver instance. For con- trollers supporting more than one bus, a particular bus can be assigned as follows: hint.scbus.0.at="ahc1" hint.scbus.0.bus="1" This assigns SCSI bus 0 to the bus 1 instance on ahc0. Peripheral driv- ers can be wired to a specific bus, target, and lun as so: hint.da.0.at="scbus0" hint.da.0.target="0" hint.da.0.unit="0" This assigns da0 to target 0, unit (lun) 0 of scbus 0. Omitting the tar- get or unit hints will instruct CAM to treat them as wildcards and use the first respective counted instances. These examples can be combined together to allow a peripheral device to be wired to any particular con- troller, bus, target, and/or unit instance. When you have a mixture of wired down and counted devices then the count- ing begins with the first non-wired down unit for a particular type. That is, if you have a disk wired down as device da1, then the first non- wired disk shall come on line as da2. HTH Robert