Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2015 22:33:58 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Jia-Shiun Li <jiashiun@gmail.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Raspberry Pi stability improved
Message-ID:  <54A211A3-3B38-4CD3-BE18-2579E1FB6EBE@bsdimp.com>
In-Reply-To: <CAHNYxxPrNB842wmGc2jREZZZ2QoO=Rk7vJsPx3yYie4sgO0meA@mail.gmail.com>
References:  <DE1783C0-C19F-448D-92EF-A51826D7FE2B@freebsd.org> <B1DA56CBB1774BB4ACE66D69BB9A662F@ad.peach.ne.jp> <DB7CB7F1-79A7-4F0D-8C99-8A62AFC74D6A@freebsd.org> <DBE5557E-81E3-42E2-8F1F-A0865E9AC477@bsdimp.com> <CAHNYxxPrNB842wmGc2jREZZZ2QoO=Rk7vJsPx3yYie4sgO0meA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Jan 21, 2015, at 10:02 PM, Jia-Shiun Li <jiashiun@gmail.com> wrote:
>=20
> On Mon, Jan 19, 2015 at 5:41 AM, Warner Losh <imp@bsdimp.com> wrote:
>=20
> If you reside with gpart, you may hit a frustratingly stupid gpart =
bug.
>=20
> We tell a lie about the CHS of the SD cards. This lie works its way =
into the alignment of the partitions.
> The md and da devices also lie about the CHS of SD cards. They tell =
different lies (and often times
> different USB adapters tell different lies) so that screws up gpart. =
It assumes that the CHS is The Truth
> and The One True Way to create partitions is to have them cylinder =
group sized and aligned, even when
> resizing an existing partition. However, since the CHS is a lie, and =
nobody can get their story straight,
> gpart expresses its displeasure by starting the partition at a new =
location, effectively killing your
> filesystem which now starts at the wrong place on the disk...
>=20
> That=E2=80=99s what=E2=80=99s killing the autoresize. :( Sadly, I have =
no fix for this, but it is a problem I hit about 6-9 months
> ago=E2=80=A6 I talked about the problem then, but I can=E2=80=99t =
recall if it was on a public mailing list or just private
> email to part=E2=80=99s author.
>=20
>=20
> for md, is it sufficient to give -x -y arguments when creating md =
images and partitioning on them? Not sure about official release and =
snapshot images, but crochet-build just give -x 63 -y 255 =
unconditionally. Aligning to a more modern value, say 4K or 1M, should =
be reasonable. Better if matched that on physical devices to be written =
to later.

Aligning to 1M is easy and likely catches most of the cases we care =
about.

However, there is no way to know the final values in crochet.

> as for CHS, is it still relevant beyond FAT family partitions, after =
20 years of LBA? If not probably CHS alignment should only be followed =
when handling FAT partitions. I understand gpart wants to keep it =
generalized but in reality FAT/CHS is becoming more and more a specific =
case comparing with others.

gpart can choose to do this rounding or not. CHS alignment hasn=E2=80=99t =
been required for FAT partitions in about 25 maybe 30 years.

Warner
> =20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54A211A3-3B38-4CD3-BE18-2579E1FB6EBE>