Date: Mon, 11 Mar 2013 20:52:12 +0100 From: Adam Nowacki <nowakpl@platinum.linux.pl> To: freebsd-fs@freebsd.org Subject: Re: Aligning MBR for ZFS boot help Message-ID: <513E35EC.4080309@platinum.linux.pl> In-Reply-To: <513E1DD2.7030609@caltel.com> References: <513C1629.50501@caltel.com> <513D0E90.5090105@platinum.linux.pl> <513E1DD2.7030609@caltel.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?513E35EC.4080309>