From owner-freebsd-fs@FreeBSD.ORG Sun Mar 10 19:34:51 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3BBF982E for ; Sun, 10 Mar 2013 19:34:51 +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 D8282CE1 for ; Sun, 10 Mar 2013 19:34:50 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.6/8.14.6) with ESMTP id r2AJYmrI007464; Sun, 10 Mar 2013 13:34:48 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.6/8.14.6/Submit) with ESMTP id r2AJYmoi007461; Sun, 10 Mar 2013 13:34:48 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sun, 10 Mar 2013 13:34:48 -0600 (MDT) From: Warren Block To: Cody Ritts Subject: Re: Aligning MBR for ZFS boot help In-Reply-To: <513CD9AB.5080903@caltel.com> Message-ID: References: <513C1629.50501@caltel.com> <513CD9AB.5080903@caltel.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Sun, 10 Mar 2013 13:34:48 -0600 (MDT) Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Mar 2013 19:34:51 -0000 On Sun, 10 Mar 2013, Cody Ritts wrote: > So, aligning to 63MB was still tricky. I found your thread, but I could not > find step by step how to calculate the offset. Here is the procedure I had in mind: # gpart create -s mbr da0 da0 created root@lightning# gpart add -t freebsd -b 2016 da0 da0s1 added # gpart show da0 => 63 39070017 da0 MBR (18G) 63 1953 - free - (976k) 2016 39068064 1 freebsd (18G) # gpart create -s bsd da0s1 da0s1 created # gpart add -t freebsd-zfs -a 1m da0s1 da0s1a added root@lightning# gpart show da0s1 => 0 39068064 da0s1 BSD (18G) 0 32 - free - (16k) 32 39067648 1 freebsd-zfs (18G) 39067680 384 - free - (192k) The first slice starts at the last CHS-aligned block before 1M, or 2016. Misaligned, but not a problem because nothing will be reading from that location. The freebsd-zfs partition is created, letting gpart align it to 1M. gpart starts the partition at an offset of 32, making it the 1M-aligned block 2048 of the disk. gpart should also be able to install the bootcode correctly, but I have not tried it for MBR and ZFS.