From owner-freebsd-questions@FreeBSD.ORG Mon Jun 24 03:50:04 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E274E153 for ; Mon, 24 Jun 2013 03:50:04 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id A58741B89 for ; Mon, 24 Jun 2013 03:50:04 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.7/8.14.7) with ESMTP id r5O3o1po041280; Sun, 23 Jun 2013 21:50:01 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.7/8.14.7/Submit) with ESMTP id r5O3o1Oi041277; Sun, 23 Jun 2013 21:50:01 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sun, 23 Jun 2013 21:50:01 -0600 (MDT) From: Warren Block To: Michael Sierchio Subject: Re: Boot Loader Issue In-Reply-To: Message-ID: References: <20130624011212.2481df7e.freebsd@edvax.de> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Sun, 23 Jun 2013 21:50:01 -0600 (MDT) Cc: Polytropon , "freebsd-questions@freebsd.org List" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2013 03:50:04 -0000 On Sun, 23 Jun 2013, Michael Sierchio wrote: > On Sun, Jun 23, 2013 at 4:12 PM, Polytropon wrote: >> On Sun, 23 Jun 2013 15:47:53 -0700, Doug Hardie wrote: >>> I need to alter mountroot so it tries the right partition/slice. >>> How do I do that? I couldn't find anything in the handbook on that. >> >> You need to install the GPT boot code, e. g. >> >> # gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ad0 > > Why the offset? Why 512k? Block 40 is the first 4K-aligned block after the 32 blocks occupied by the GPT. It won't hurt anything if the drive is not a 4K "Advanced Format" drive, won't really make a big difference if it is since bootcode is not really disk I/O-limited. Just good practice to keep everything aligned. 512K is the largest size of bootcode that will work. The loader loads the whole partition regardless of how large the bootcode is, and will fail with larger sizes. It's no loss of space because the first UFS partition will start at 1M. Why 1M? Because it's an unofficial standard, and aligned with 4K, 8K, 128K, and so on. This article talks about it a bit more: http://www.wonkity.com/~wblock/docs/html/ssd.html >> # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad0 > > I think it's simpler to make an entry in /boot/loader.conf: > > vfs.root.mountfrom="ufs:/dev/ada0s1a" These are different things. The command is for a GPT disk, and the boot device being set is for MBR.