From owner-freebsd-fs@FreeBSD.ORG Sun Mar 10 19:47:54 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CB72D928 for ; Sun, 10 Mar 2013 19:47:54 +0000 (UTC) (envelope-from cr@caltel.com) Received: from mail1.caltel.com (mail1.caltel.com [66.102.144.6]) by mx1.freebsd.org (Postfix) with ESMTP id 4066CD3B for ; Sun, 10 Mar 2013 19:47:53 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEACziPFFCZpCq/2dsb2JhbABCwWCCYYFgdIImAQEEAThABgsLGAkWDwkDAgECAUUTCAEBiAkGu12PFRaDKgOIco1jhWeLDoMqHA X-IPAS-Result: AqAEACziPFFCZpCq/2dsb2JhbABCwWCCYYFgdIImAQEEAThABgsLGAkWDwkDAgECAUUTCAEBiAkGu12PFRaDKgOIco1jhWeLDoMqHA X-IronPort-AV: E=Sophos;i="4.84,819,1355126400"; d="scan'208";a="16947068" Received: from host-170.a66-102-144.caltel.com (HELO codys-mac.local) ([66.102.144.170]) by smtp.caltel.com with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 10 Mar 2013 12:47:53 -0700 Message-ID: <513CE369.4030303@caltel.com> Date: Sun, 10 Mar 2013 12:47:53 -0700 From: Cody Ritts Organization: CalTel User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Subject: Re: Aligning MBR for ZFS boot help References: <513C1629.50501@caltel.com> <513CD9AB.5080903@caltel.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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:47:54 -0000 Yeah, just for clarity: > root@lightning# gpart show da0s1 > => 0 39068064 da0s1 BSD (18G) > 0 32 - free - (16k) > 32 39067648 1 freebsd-zfs (18G) > 39067680 384 - free - (192k) and > dd if=/boot/zfsboot of=/dev/da0s1 count=1 > dd if=/boot/zfsboot of=/dev/da0s1a skip=1 seek=1024 will not boot. and will result in: > zfsboot: No ZFS Pools located, can't boot The freebsd-zfs slice cannot have an offset. I tried it several different ways first, since it was the easiest to align, and as soon as I added that offset, the boot strap process would break. Thanks Cody On 3/10/13 12:34 PM, Warren Block wrote: > 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. >