From owner-freebsd-questions@FreeBSD.ORG Wed Oct 31 17:58:58 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C15F1319 for ; Wed, 31 Oct 2012 17:58:58 +0000 (UTC) (envelope-from freebsd@johnea.net) Received: from mail.johnea.net (johnea.net [70.167.123.7]) by mx1.freebsd.org (Postfix) with ESMTP id 9FCCE8FC0C for ; Wed, 31 Oct 2012 17:58:58 +0000 (UTC) Received: from [192.168.100.239] (vhost.johnea.net [192.168.100.239]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.johnea.net (Postfix) with ESMTPSA id D99B173F188B for ; Wed, 31 Oct 2012 10:58:57 -0700 (PDT) Message-ID: <509166E1.1010105@johnea.net> Date: Wed, 31 Oct 2012 10:58:32 -0700 From: freebsd@johnea.net User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: 9.1 and gmirror with GPT? References: <20121029105905.GA358@icarus.home.lan> In-Reply-To: <20121029105905.GA358@icarus.home.lan> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Wed, 31 Oct 2012 17:58:58 -0000 On 2012-10-29 03:58, Jeremy Chadwick wrote: > If you're truly using 4096-byte sectors disks -- specifically MECHANICAL > hard disks (MHDDs) -- use of 4KByte alignment is fine. > > But if you ever plan on using an SSD the future, you need to align > things to 1MBytes or 2MBytes. > > This is why Windows Vista and Windows 7 aligns its partitions to 1MByte > boundaries. > > ...and quite honestly FreeBSD should too. I am aware 9.1-RELEASE > supposedly addresses this -- however I have not determined if the > alignment size chosen by the committer was 4096 or 1MB/2MB. I have a > gut feeling it's the former, and that's bad. > > With 1MByte or 2MByte alignment, performance on 512-byte MHDDs would be > fine, performance on 4096-byte MHDDs would be fine, and performance on > SSDs would be fine. > > Next: in case it's not made clear to readers from Warren's statements: > the magical "8" divisor he's using comes from 4096/512 ("how many 512 > bytes are there in a 4096-byte sector"). Thus, for 1MByte alignment the > value would be 1048576/512 or 2048. For 2MByte alignment the value > would be 2097152/512 or 4096. > Thank You Jeremy! In an effort to bring concluding info from the original thread, on some MRB partitioned drives (spinning media in this case) gpart seems unable to align the containing "-t freebsd" slice to 4K boundaries. However subsequent creation of "-t freebsd-ufs" and "-t freebsd-swap" partitions within the slice align correctly. To make this alignment on 1M boundaries instead of 4K boundaries the "-a 1M" should be used instead of "-a 4K". Example gpart commands for MBR partition table aligned to 1M sector size for SSD: gpart create -s MBR mirror/gm0 gpart add -t freebsd -a 1M mirror/gm0 # ignore possible warning "mirror/gm0s1 added, but partition is not aligned" # create the bsdlabel partitions in slice 1 (s1) gpart create -s BSD mirror/gm0s1 gpart add -t freebsd-swap -a 1M -s 8g mirror/gm0s1 gpart add -t freebsd-ufs -a 1M mirror/gm0s1 # put bootcode on the MBR and mark the first slice active gpart bootcode -b /boot/mbr mirror/gm0 gpart set -a active -i 1 mirror/gm0 # put bootcode on the bsdlabel gpart bootcode -b /boot/boot mirror/gm0s1