From owner-freebsd-stable@FreeBSD.ORG Thu Sep 16 09:30:01 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DE7E106566C for ; Thu, 16 Sep 2010 09:30:01 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta04.emeryville.ca.mail.comcast.net (qmta04.emeryville.ca.mail.comcast.net [76.96.30.40]) by mx1.freebsd.org (Postfix) with ESMTP id E8CF68FC0A for ; Thu, 16 Sep 2010 09:30:00 +0000 (UTC) Received: from omta22.emeryville.ca.mail.comcast.net ([76.96.30.89]) by qmta04.emeryville.ca.mail.comcast.net with comcast id 7MW01f0021vN32cA4MW0Q2; Thu, 16 Sep 2010 09:30:00 +0000 Received: from koitsu.dyndns.org ([98.248.41.155]) by omta22.emeryville.ca.mail.comcast.net with comcast id 7MVz1f0043LrwQ28iMVzP6; Thu, 16 Sep 2010 09:30:00 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 4271F9B423; Thu, 16 Sep 2010 02:29:59 -0700 (PDT) Date: Thu, 16 Sep 2010 02:29:59 -0700 From: Jeremy Chadwick To: Michael Sperber Message-ID: <20100916092959.GB16270@icarus.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-stable@freebsd.org Subject: Re: How to predict drive number change for 7.3->8.1 upgrade? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 09:30:01 -0000 On Thu, Sep 16, 2010 at 11:05:06AM +0200, Michael Sperber wrote: > I just upgraded my desktop system from 7.3 to 8.1, and the main hard > drive, which was /dev/ad6 before is now /dev/ad10. Consequently, the > initial boot failed when trying to mount the root file system from ad6. > > The desktop system is now fixed, but I also have a rented server with > only a serial console, and I worry that the upgrade is going to leave me > with a dead machine. Is there any way to predict how the drive number > changes? (Why does it change at all?) If so, what's the proper way to > tell the system the initial root device *before* rebooting? This has to do with ATA device naming schemes, and changes in the ATA driver, in addition to capabilities of the chipset. For example, FreeBSD 7.x may have seen only 2 PATA or SATA ports on your system, but with 8.x (and improved drivers) it may see 4, or possibly 2 of each (2 PATA, 2 SATA). The device numbers shift/change as a result. AFAIK, there is no failsafe way to "predict" what the device numbers will be. I've dealt with this "problem" many times, and this is how I do it: Print out or copy/paste the contents of /etc/fstab prior to upgrade. If you have serial console on your remote server, then you have little to worry about -- you know what drive name/model/size is associated with ad6 on 7.x. When you upgrade, boot the 8.x kernel and into single-user mode. While the kernel boots, you'll see the device names in the kernel output, and will then be prompted for the root filesystem. Enter the correct ufs reference string with the correct device number. After that, just mount the /usr, /tmp, and /var filesystems by hand using the correct device number. Once you have that, you should be able to edit /etc/fstab and change the device numbers (you might have to do mount -o rw -u / to make it read-writeable). Reboot the machine and go into single-user, and you should find that the root filesystem is mounted + mount -a should work fine + everything work going forward. If you find that the device numbers are changing "randomly" after every reboot, that's a separate problem and should be dealt with separately. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |