From owner-freebsd-questions@FreeBSD.ORG Wed Mar 26 21:59:29 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E380EE2 for ; Wed, 26 Mar 2014 21:59:29 +0000 (UTC) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 13F711B8 for ; Wed, 26 Mar 2014 21:59:28 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.8/8.14.8) with ESMTP id s2QLxQ2J051082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 26 Mar 2014 15:59:26 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.8/8.14.8/Submit) with ESMTP id s2QLxQ7j051079; Wed, 26 Mar 2014 15:59:26 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Wed, 26 Mar 2014 15:59:26 -0600 (MDT) From: Warren Block To: Andrea Venturoli Subject: Re: Partition alignment In-Reply-To: <53333669.7000802@netfence.it> Message-ID: References: <53333669.7000802@netfence.it> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Wed, 26 Mar 2014 15:59:26 -0600 (MDT) Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 21:59:29 -0000 On Wed, 26 Mar 2014, Andrea Venturoli wrote: >> root@:~ # gpart show /dev/mfid0 >> => 63 1751949249 mfid0 MBR (835G) >> 63 1751936382 1 freebsd [active] (835G) >> 1751936445 12867 - free - (6.3M) > >> root@:~ # gpart show /dev/mfid0s1 >> => 0 1751936382 mfid0s1 BSD (835G) >> 0 16777216 4 freebsd-ufs (8.0G) >> 16777216 33554432 2 freebsd-swap (16G) >> 50331648 67108864 5 freebsd-ufs (32G) >> 117440512 33554432 6 freebsd-ufs (16G) >> 150994944 536870912 7 freebsd-ufs (256G) >> 687865856 536870912 8 freebsd-ufs (256G) >> 1224736768 33554432 1 freebsd-ufs (16G) >> 1258291200 493645182 - free - (235G) > > AFAICT the partition are correctly aligned within the slice, but I'm not sure > about the slice itself. No. The starting blocks of the slice and partition are added together to determine the actual start block of the partition: The first partition begins at 63+0, or 63. 63*512 = 32256, not evenly divisible by 4K. Or just divide the block number by 8, same thing. When creating the partitions, use gpart's -a option, and it will add an offset so the slice is aligned: gpart add -t freebsd-ufs -a4k -s8g mfid0s1 That will make the first partition start at the first aligned offset in the slice, probably block 1 or 9. Use GPT if you can, it simplifies this by not needing the partition with a partition scheme.