Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Feb 2010 08:34:05 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        freebsd-hackers@freebsd.org, Peter Steele <psteele@maxiscale.com>
Subject:   Re: How can I force boot from alternate drive with boot.config?
Message-ID:  <201002110834.05651.jhb@freebsd.org>
In-Reply-To: <4B73AC28.2000402@elischer.org>
References:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B2699@MBX03.exg5.exghost.com> <201002100838.11381.jhb@freebsd.org> <4B73AC28.2000402@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 11 February 2010 2:05:12 am Julian Elischer wrote:
> John Baldwin wrote:
> 
> > I think the unit number is largely ignored now.  The kernel used to believe it 
> > for finding /, but the loader now reads /etc/fstab and sets a variable in kenv 
> > to tell the kernel where to find /.
> 
> One of the most annoying "improvements" for the decade from my 
> perspective..

You can't communicate anything non-trivial like using a gmirror or
software-RAID for / otherwise.  The boothowto structure is very limited
in the root device hinting it can provide.

> because if / is not going to be where the loader thinks / is (because
> that is a different F with a different /etc/fstab) then you need to
> do lots of fancy footwork to undo the damage.

Generally the fix for that is to boot to the right partition in the first
place so that the loader reads the right /etc/fstab.  You are already
using the wrong kernel and modules if you are reading the wrong /etc/fstab.

> Oh and it's not terribly well documented how to get around it.
> (that I've found)

Just set vfs.mountroot.from to the device you want to use for / in
loader.conf.  The loader doesn't set the variable if it is already set.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002110834.05651.jhb>