Date: Tue, 29 Mar 2011 01:47:58 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Kostik Belousov <kostikbel@gmail.com> Cc: freebsd-fs@FreeBSD.org Subject: Re: tying down adaX to physical interfaces Message-ID: <20110329012951.N779@besplex.bde.org> In-Reply-To: <20110326135211.GB78089@deviant.kiev.zoral.com.ua> References: <AFDA19F9-DC78-463D-862D-6E4F3CB2C2C3@deman.com> <20110326003818.GT78089@deviant.kiev.zoral.com.ua> <20110327000956.U1316@besplex.bde.org> <20110326135211.GB78089@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 26 Mar 2011, Kostik Belousov wrote: > On Sun, Mar 27, 2011 at 12:24:03AM +1100, Bruce Evans wrote: >> To hijack this thread a little, I'll ask how people handle removable media >> changing the addresses of non-removable media. I use the following to >> prevent USB drives stealing da0 from my 1 real SCSI disk on 1 machine: >> >> hint.scbus.0.at="sym0" >> hint.da.0.at="scbus0" >> >> This works OK and is easy to manage with only 1 SCSI disk. But 1 of my >> USB drives also steals cd0 from a not-so-real ATAPI drive under atapicam, >> depending on whether the USB drive is present at boot time: >> >> USB drive not present at boot time: >> ad* (no SCSI disks on this machine) >> cd0 = acd0 (but no further ATAPI drives on this machine) >> insert USB drive: >> da1 (da0 was reserved by above) >> cd1 (phantom ATAPI drive on the USB drive. Accessing this hangs >> parts of the ata system but it doesn't get used since various >> places only point cd0) >> >> USB drive present at boot time: >> ad* >> da1 on USB >> cd0 phantom on USB >> cd1 = acd[0 or 1] (normal cd0). Accessing cd0 now hangs parts of the >> ata system and this happens too easily since various places point >> to cd0. >> >> How do people defend agains random USB drives present or not at boot time? > > Wouldn't it be cd0 on scbusX on ahciY, and cd1 on scbusZ on umass-simT ? > I believe similar hints would wire the cd0/cd1 in your case. That works of course. I was hoping for something more automatic and general. Maybe reserve lots of bus numbers for fixed devices. What seems to happen is that buses are allocated sequentially in probe order, and at least in my configuration, USB drives are probed before atapi drives, so the removable drives always renumber the fixed drives. However, the order of the probe messages is the opposite -- atapi drives before USB drives (with higher unit numbers for atapi drives!). E.g., acd0, cd1 (same physical drive as acd0), cd0 (USB drive). This is with an older kernel and usb. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110329012951.N779>