From owner-freebsd-questions@FreeBSD.ORG Thu Oct 23 15:47:49 2008 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 C7DF01065670 for ; Thu, 23 Oct 2008 15:47:49 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA02.westchester.pa.mail.comcast.net (qmta02.westchester.pa.mail.comcast.net [76.96.62.24]) by mx1.freebsd.org (Postfix) with ESMTP id 9EBDD8FC0C for ; Thu, 23 Oct 2008 15:47:47 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA07.westchester.pa.mail.comcast.net ([76.96.62.59]) by QMTA02.westchester.pa.mail.comcast.net with comcast id W9gi1a0081GhbT852Fnm1c; Thu, 23 Oct 2008 15:47:46 +0000 Received: from koitsu.dyndns.org ([69.181.141.110]) by OMTA07.westchester.pa.mail.comcast.net with comcast id WFnZ1a00V2P6wsM3TFnamq; Thu, 23 Oct 2008 15:47:46 +0000 X-Authority-Analysis: v=1.0 c=1 a=FgSrDd-3AAAA:8 a=QycZ5dHgAAAA:8 a=dGh-Jvlr1LsJXIUtrIAA:9 a=94WKAyjhR5hC7U1B7LUA:7 a=W62qbaubE9v7yhlh5SGhIJ6gpNEA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 5C12AC9432; Thu, 23 Oct 2008 08:47:33 -0700 (PDT) Date: Thu, 23 Oct 2008 08:47:33 -0700 From: Jeremy Chadwick To: Greg Larkin Message-ID: <20081023154733.GB89723@icarus.home.lan> References: <49009B62.30507@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49009B62.30507@FreeBSD.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Chris Pratt , FreeBSD-Questions Questions Subject: Re: Boot device question 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: Thu, 23 Oct 2008 15:47:50 -0000 On Thu, Oct 23, 2008 at 10:42:26AM -0500, Greg Larkin wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Chris Pratt wrote: > > I have a server with 6 hot-swap SATA slots. It was delivered > > with the first slot empty and 5 drives set up as /dev/ad4 through > > /dev/ad12. I'd never paid attention to this until I wanted to add > > a 6th, now 4 years later. When I popped it in, I realized the > > empty bay was not 6 but rather bay 1, and of course it wouldn't > > boot. Presumably /dev/ad2 had now come alive for the first time. > > I popped out the disk, rebooted and after it was up, I plugged it > > back in (hot) and ran sysinstall. It didn't see the disk so I couldn't > > fdisk it. No device files existed for it. > > > > I was thinking a right approach would be to change fstab to > > reference ad2 for all the system disk file systems, shutdown, > > move that drive to the first bay and plug the new drive into the > > 2nd bay. This seemed like more of a permanent solution. > > If those /dev/ad* files are created at boot dynamically, > > this should work. I've found docs that imply that they are > > dynamically discovered and created from FreeBSD 5 forward > > (auto-discovery?). Are they or do I need to create them prior to > > start up. > > > > The thing is, there is no easy recovery from failure here since I > > have no console monitor to let me see what's going on or to fix > > fstab if it fails (counter-intuitively, the only place I can access > > the console is from remote locations ;-)), so I just want to know > > if I'm thinking straight? The plan is: > > > > 1. Change /etc/fstab entries for ad4 filesystems to ad2 > > 2. Shutdown > > 3. Put the system disk in Bay 1 > > 4. Power up > > > > Should it boot? > > Hi Chris, > > I don't know the answer to that question, but I do know that you can > wire physical devices to specific devices files in /dev. I use the > /boot/device.hints file to do that. Check this page for more > information: > http://threads.seas.gwu.edu/cgi-bin/man2web?program=scbus§ion=4 > > Halfway down the page, you'll see directives like: > > hint.da.0.at="scbus0" > hint.da.0.target="0" > hint.da.0.unit="0" > > I believe you can do something similar with your ad devices, and force > the new drive to a different /dev/ad? device file that doesn't cause a > boot problem. AFAIK, at/target/unit are hint commands only available to da(4), at least that's what I see from the source code. I see no such support for ad(4), so I do not think this will work for him. Also, I'll remind people once more: stop modifying device.hints! The file can/will be overwritten in some cases, and you will lose your changes! You're living dangerously. Use loader.conf to do what you need; you can literally copy/paste those lines into loader.conf and achieve the same, without the risks. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |