Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2015 17:24:58 -0200
From:      Luiz Otavio O Souza <lists.br@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Raspberry Pi stability improved
Message-ID:  <CAB=2f8yvsFZBNHk7HMBZRUF-eDSfrBfMrmY%2BUGsi9EosvemRbw@mail.gmail.com>
In-Reply-To: <DBE5557E-81E3-42E2-8F1F-A0865E9AC477@bsdimp.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>

next in thread | previous in thread | raw e-mail | index | archive | help
On 18 January 2015 at 19:41, Warner Losh wrote:
>
>> On Jan 18, 2015, at 11:29 AM, Michael Tuexen wrote:
>>
>> On 18 Jan 2015, at 16:51, Daisuke Aoyama wrote:
>>>
>>> Hi Michael,
>>>
>>> Did you use /etc/rc.d/autosize ("option AutoSize" in crochet-freebsd)?
>> No, I used (for a year or so) the script from
>> git://github.com/daveish/freebsd-arm-tools.git
>> and did a manual resize after the system got up.
>
> If you reside with gpart, you may hit a frustratingly stupid gpart bug.
>
> 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 diffe=
rent lies (and often times
> different USB adapters tell different lies) so that screws up gpart. It a=
ssumes 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 nobo=
dy can get their story straight,
> gpart expresses its displeasure by starting the partition at a new locati=
on, effectively killing your
> filesystem which now starts at the wrong place on the disk...
>
> 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.


geom_part_bsd also fails to recognise a valid bsd partition scheme at
eMMC of beaglebone-black:

# gpart show
=3D>   1024  3750912  mmcsd0  MBR  (1.8G)
     1024     4096       1  !12  [active]  (2.0M)
     5120     3072          - free -  (1.5M)
     8192  3735552       2  freebsd  (1.8G)
  3743744     8192          - free -  (4.0M)

=3D>      0  3735552  mmcsd0s2  BSD  (1.8G)
        0  3734528         1  freebsd-ufs  (1.8G)
  3734528     1024            - free -  (512K)

that's because geom_bsd_part can't 'believe' in sectors > 255:

    407         sectors =3D le32dec(buf + 44);
    408         if (sectors < 1 || sectors > 255)
    409                 goto invalid_label;

And the lie we are pushing on this particular eMMC device says it has
1024 sectors!

Geom name: mmcsd0
Providers:
1. Name: mmcsd0
   Mediasize: 1920991232 (1.8G)
   Sectorsize: 512
   Stripesize: 524288
   Stripeoffset: 0
   Mode: r2w2e5
   descr: MMC MMC02G 3.10 SN 3026BC54 MFG 12/2012 by 254 0x004e
   ident: 3026BC54
   fwsectors: 1024
   fwheads: 183

If 1024 sectors cannot represent a valid geometry then we should tell
a better lie here (or at least make the other parts of the system
believe in our own lies).

Luiz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB=2f8yvsFZBNHk7HMBZRUF-eDSfrBfMrmY%2BUGsi9EosvemRbw>