Raspberry Pi stability improved

Luiz Otavio O Souza lists.br at gmail.com
Wed Jan 21 19:25:00 UTC 2015


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 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...
>
> That’s what’s killing the autoresize. :( Sadly, I have no fix for this, but it is a problem I hit about 6-9 months
> ago… I talked about the problem then, but I can’t recall if it was on a public mailing list or just private
> email to part’s author.


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

# gpart show
=>   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)

=>      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 = 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


More information about the freebsd-arm mailing list