From owner-freebsd-geom@FreeBSD.ORG Tue May 24 09:04:59 2011 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A769106564A; Tue, 24 May 2011 09:04:59 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward4.mail.yandex.net (forward4.mail.yandex.net [77.88.46.9]) by mx1.freebsd.org (Postfix) with ESMTP id B08C78FC08; Tue, 24 May 2011 09:04:58 +0000 (UTC) Received: from smtp2.mail.yandex.net (smtp2.mail.yandex.net [77.88.46.102]) by forward4.mail.yandex.net (Yandex) with ESMTP id EE7C05020D9; Tue, 24 May 2011 13:04:56 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1306227897; bh=wLFtAv2mpWEMTh1XXSOTUUtmENq7X0g9fuMqTriUGsM=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=XNwJCbmPWWqFThXHf1ZL6VvjzywJDdlMJKFdX6Pns9JiKigzILwGbUi2uOl0v85wb SKSa8aOn0XfrJqj4+GVHO/kHbqGLDEK+CHlB8AHgeG7FvBc8m8fojDkXFWorWh7lOt HZB6swRpuloql8VBGSTBghep7slNdFgje86R2QBk= Received: from [127.0.0.1] (mail.kirov.so-cdu.ru [77.72.136.145]) by smtp2.mail.yandex.net (Yandex) with ESMTPSA id 89EDB5D100D1; Tue, 24 May 2011 13:04:56 +0400 (MSD) Message-ID: <4DDB74B2.702@yandex.ru> Date: Tue, 24 May 2011 13:04:50 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Andriy Gapon References: <4DDA2F0B.2040203@yandex.ru> <9ED563AB-7B35-40F4-A33E-015317858401@bsdimp.com> <4DDB5375.6050004@FreeBSD.org> In-Reply-To: <4DDB5375.6050004@FreeBSD.org> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF71682544821A7544380DDF5" X-Yandex-Spam: 1 Cc: Marcel Moolenaar , Warner Losh , freebsd-geom@FreeBSD.org Subject: Re: [RFC] Remove requirement of alignment to track from MBR scheme X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 09:04:59 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF71682544821A7544380DDF5 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 24.05.2011 10:43, Andriy Gapon wrote: >> On May 23, 2011, at 10:35 AM, Marcel Moolenaar wrote: >>> I think we've had enough rushed and ill thought-out changes going >>> in already and I can see that not aligning MBR partitions on a track >>> boundary is potentially perceived as a PITA violation. >=20 > _PITA_ violation? :-) > As to POLA - yeah, I can see people getting astonished that finally Fre= eBSD got > its sh*t together and did the right thing, years after all other OSes (= even > Winddows) had done it. >=20 >> I can understand only generating MBRs on a track boundary. >=20 > No. E.g. I wanted to create a 4KB aligned MBR slice, but our tools ins= isted on > using a 63 sector alignment. In fact, the value that I provided was si= lently > rounded to the value that gpart thought was best for me. > Really, if a user says to gpart "do whatever alignment you want", then = I could > see using geometry-based values, but I still think that we should not d= o that > even in that case, I think we would be better off using some nice 2^N a= lignment. > If a user says "use this alignment or slice start", then the tool shoul= d just > shut up and do exactly what the user told it. There are several operations which can/should be changed: 1. MBR detection. All users want keep their partitions accessible. But with r221788 it is now problematic. I can revert r221788, but for me it seems right and instead reverting MBR support should be changed: a) table->gpt_last should not be aligned to track boundary; b) table->gpt_first can be aligned to track for compatibility, but if there is already some partition starts from inside first track, table->gpt_first should be set to 1. 2. MBR creating. a) table->gpt_last should not be aligned to track boundary; b) table->gpt_first can be aligned to track for compatibility. 3. Creating partitions. Users should choose alignment method, not the ker= nel. and they can do it: Align to 4k: # gpart add -t freebsd -a 4k -s 5g ada0 =09 Align according to disk geometry: # gpart add -t freebsd -g -s 5g ada0 So, patch is here: http://people.freebsd.org/~ae/mbr_geometry.diff Examples: # gpart create -s mbr md0 md0 created # gpart show md0 =3D> 63 4294967232 md0 MBR (5.5T) 63 4294967232 - free - (2T) # gpart add -t freebsd -s 10g -a 4k md0 md0s1 added # gpart show md0 =3D> 63 4294967232 md0 MBR (5.5T) 63 1 - free - (512B) 64 20971520 1 freebsd (10G) 20971584 4273995711 - free - (2T) # gpart add -t freebsd -s 10g -g md0 md0s2 added # gpart show md0 =3D> 63 4294967232 md0 MBR (5.5T) 63 1 - free - (512B) 64 20971520 1 freebsd (10G) 20971584 45 - free - (22k) 20971629 20971503 2 freebsd (10G) 41943132 4253024163 - free - (2T) --=20 WBR, Andrey V. Elsukov --------------enigF71682544821A7544380DDF5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJN23S2AAoJEAHF6gQQyKF6rq0H/RRaCS8VMYqYX6kSlE/G921J PwmElExTTopQDbmf3zAQpT6W9ievyvTqSF0DmYmnthmYhbDWy9rbSBPxGsHUoofz hiTI6z/r1X+sLLHHi2awjICUnToUvlkaa2zQ4SN4x3mgUcyJ56wZsrakwitS8K7S OAX9Ra1Tz/Tp8PzN/eB2PV8bL8ohklKCMpdV/LddubKPv23nMUagxygJr8nVl+0g eUw+cy6ygyTEKuCnbx/E3IwtYeC++f5LyvNXXQm+1PGrqlfzMMKU7f/NJpzwDoX1 zDdoeI95xR8T6ycr7sJFrTcuFEr8r/wruI9oKPXOL5tq8am9dmP9RJFCqWcZAjs= =tJ5w -----END PGP SIGNATURE----- --------------enigF71682544821A7544380DDF5--