how to make fixed Direct Access device (da) ID
Robert Marella
rmarella at gmail.com
Mon Sep 18 10:07:52 PDT 2006
On Sat, 16 Sep 2006 13:05:11 -0700
"Jin Guojun [VFFS]" <jin at george.lbl.gov> 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
More information about the freebsd-questions
mailing list