Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 May 2011 13:04:50 +0400
From:      "Andrey V. Elsukov" <bu7cher@yandex.ru>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        Marcel Moolenaar <xcllnt@mac.com>, Warner Losh <imp@bsdimp.com>, freebsd-geom@FreeBSD.org
Subject:   Re: [RFC] Remove requirement of alignment to track from MBR scheme
Message-ID:  <4DDB74B2.702@yandex.ru>
In-Reply-To: <4DDB5375.6050004@FreeBSD.org>
References:  <4DDA2F0B.2040203@yandex.ru>	<D75B2856-D9D8-4BA3-BC54-8258610CEA06@xcllnt.net> <9ED563AB-7B35-40F4-A33E-015317858401@bsdimp.com> <4DDB5375.6050004@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DDB74B2.702>