From owner-freebsd-hackers@FreeBSD.ORG Sun May 20 19:50:13 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8EBE7106564A for ; Sun, 20 May 2012 19:50:13 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 65A708FC08 for ; Sun, 20 May 2012 19:50:13 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q4KJo7c6025106; Sun, 20 May 2012 19:50:07 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id xvquy4kj7fuwv3n788r8if5jhn; Sun, 20 May 2012 19:50:06 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <4fb7e819.6968700a.7a7f.ffff9153@mx.google.com> Date: Sun, 20 May 2012 12:50:06 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <4fb7dfd6.736a980a.186d.ffff902f@mx.google.com> <20120519180901.GA1264@tiny> <4fb7e819.6968700a.7a7f.ffff9153@mx.google.com> To: Rozhuk.IM@gmail.com X-Mailer: Apple Mail (2.1257) Cc: 'User Wojtek' , 'Matthias Apitz' , freebsd-hackers@freebsd.org Subject: Geom_mbr vs. SSD disks (was: proper newts options for SSD disks) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 19:50:13 -0000 On May 19, 2012, at 11:36 AM, rozhuk.im@gmail.com wrote: > Do not use MBR (or manually do all to align). > 63 - not 4k aligned. Right now, the "-a" alignment option for "gpart add" is broken when used with MBR partitions. It looks like the gpart command uses it to correctly align the start/end, but then the actual MBR geom code does another alignment pass that rounds the start/size to a multiple of gpt_sectors, which defaults to 63. This seems problematic. It's tempting to change sys/geom/part/g_part_mbr.c so that it skips this additional alignment when the geometry has defaulted. Something like this: Index: sys/geom/part/g_part_mbr.c =================================================================== --- part/g_part_mbr.c (revision 235597) +++ part/g_part_mbr.c (working copy) @@ -211,6 +211,7 @@ start = gpp->gpp_start; size = gpp->gpp_size; + if (sectors != 63 || basetable->gpt_heads != 255) { if (size < sectors) return (EINVAL); if (start % sectors) { @@ -221,6 +222,7 @@ size = size - (size % sectors); if (size < sectors) return (EINVAL); + } if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); I'm not really certain I understand all of the implications of this change, though. Tim