From owner-freebsd-fs@FreeBSD.ORG Mon Mar 11 19:52:39 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 A196CF48 for ; Mon, 11 Mar 2013 19:52:39 +0000 (UTC) (envelope-from nowakpl@platinum.linux.pl) Received: from platinum.linux.pl (platinum.edu.pl [81.161.192.4]) by mx1.freebsd.org (Postfix) with ESMTP id 664AFC42 for ; Mon, 11 Mar 2013 19:52:39 +0000 (UTC) Received: by platinum.linux.pl (Postfix, from userid 87) id 8520547E11; Mon, 11 Mar 2013 20:52:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on platinum.linux.pl X-Spam-Level: X-Spam-Status: No, score=-1.3 required=3.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.3.2 Received: from [10.255.1.2] (unknown [83.151.38.73]) by platinum.linux.pl (Postfix) with ESMTPA id 277D847DE8 for ; Mon, 11 Mar 2013 20:52:37 +0100 (CET) Message-ID: <513E35EC.4080309@platinum.linux.pl> Date: Mon, 11 Mar 2013 20:52:12 +0100 From: Adam Nowacki User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 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> <513D0E90.5090105@platinum.linux.pl> <513E1DD2.7030609@caltel.com> In-Reply-To: <513E1DD2.7030609@caltel.com> 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: Mon, 11 Mar 2013 19:52:39 -0000 On 2013-03-11 19:09, Cody Ritts wrote: > On 3/10/13 3:52 PM, Adam Nowacki wrote: >> I don't think zfsboot is aware of BSD disklabel (offsets other than 0 >> won't boot). Is there any reason you are using BSD disklabel and not two >> partition MBR? > > The reason is because every example I saw used labels. > I just tried it, and it does not boot. > I get: > > FreeBSD/x86 ZFS enabled bootstrap loader. Revision 1.1 > ZFS: can't find pool by guid. Then I guess zfsloader requires BSD disklabel for MBR (but zfsboot still has to be at offset 0 and 1024 sectors relative to MBR partition as it doesn't read the BSD disklabel). >> I also don't think there is any merit in aligning to 1MiB. Most ZFS IOs >> will be aligned to sector size (ashift). Unless ZFS pool is created with >> higher ashift then the 63 sector offset is as good as any. > > Aligning to the Erase block: > > http://blog.nuclex-games.com/2009/12/aligning-an-ssd-on-linux/ > Also I will be forcing ashift to 12 using the gnop trick. > > If you still feel that is not necessary, I would be interested in > knowing why? The mapping between sectors and physical flash pages/blocks is not fixed and will change on each write or internal garbage collect. http://www.devwhy.com/blog/2009/8/4/from-write-down-to-the-flash-chips.html seems to explain this nicely. Aligning to more than page size offers no benefit since this is the biggest continuous chunk of data that remains continuous all the way to physical flash. If your SSD has page size of 4KiB then align to that. This is sector 504 on FreeBSD (due to the multiple of 63 issue). ZFS pool will have to be created with ashift=12.