Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jan 2015 00:51:14 +0900
From:      "Daisuke Aoyama" <aoyama@peach.ne.jp>
To:        "Michael Tuexen" <tuexen@freebsd.org>, "freebsd-arm" <freebsd-arm@freebsd.org>
Subject:   Re: Raspberry Pi stability improved
Message-ID:  <B1DA56CBB1774BB4ACE66D69BB9A662F@ad.peach.ne.jp>
In-Reply-To: <DE1783C0-C19F-448D-92EF-A51826D7FE2B@freebsd.org>
References:  <DE1783C0-C19F-448D-92EF-A51826D7FE2B@freebsd.org>

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

Did you use /etc/rc.d/autosize ("option AutoSize" in crochet-freebsd)?
If so, try to disable it and never boot official FreeBSD image before resizing.
It will break the partition at first boot. It's a trap of the image.
Personally I didn't use autosize in my images. So not affect all my images.

The main reason is gpart/fdisk/glabel/glowfs/newfs can't handle mixed geometory.
Default crochet-freebsd uses CHS=(x,255,63) while creating but mmcsd is not!
----------------------------------------------------------------------
#diskinfo -v mmcsd0
mmcsd0
        512             # sectorsize
        31674335232     # mediasize in bytes (29G)
        61863936        # mediasize in sectors
        4194304         # stripesize
        0               # stripeoffset
        20              # Cylinders according to firmware.
        377             # Heads according to firmware.
        8192            # Sectors according to firmware.   <<< this can't be handled
        4700C511        # Disk ident.
----------------------------------------------------------------------
This is a reson why I use USB card reader before booting at
http://lists.freebsd.org/pipermail/freebsd-arm/2015-January/009935.html

For your reference, here is broken example of official image of
ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/11.0/FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20150111-r276981.img.bz2

Before booting via USB card reader:
--------------------------------------------------------------------------------------
[root@raspberry-pi ~]# diskinfo -v da0
da0
        512             # sectorsize
        15720251392     # mediasize in bytes (15G)
        30703616        # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        1911            # Cylinders according to firmware.
        255             # Heads according to firmware.
        63              # Sectors according to firmware.
                        # Disk ident.

[root@raspberry-pi ~]# gpart show da0
=>      63  30703553  da0  MBR  (15G)
        63     34776    1  !12  [active]  (17M)
     34839   1918286    2  freebsd  (937M)
   1953125  28750491       - free -  (14G)

[root@raspberry-pi ~]# fdisk da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=1911 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=1911 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
    start 63, size 34776 (16 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 2/ head 42/ sector 63
The data for partition 2 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 34839, size 1918286 (936 Meg), flag 0
        beg: cyl 2/ head 43/ sector 1;
        end: cyl 121/ head 146/ sector 62
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

Bootup:
----------------------------------------------------------------------
root@raspberry-pi:~ # uname -a
FreeBSD raspberry-pi 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r276981: Mon Jan 12 09:04:54 UTC 2015 
root@grind.freebsd.org:/usr/obj/arm.armv6/usr/src/sys/RPI-B  arm

root@raspberry-pi:~ # diskinfo -v mmcsd0
mmcsd0
        512             # sectorsize
        15720251392     # mediasize in bytes (15G)
        30703616        # mediasize in sectors
        4194304         # stripesize
        0               # stripeoffset
        20              # Cylinders according to firmware.
        187             # Heads according to firmware.
        8192            # Sectors according to firmware.
        DB242AD3        # Disk ident.

root@raspberry-pi:~ # gpart show
=>       1  30703615  mmcsd0  MBR  (15G)
         1        62          - free -  (31K)
        63     34776       1  !12  [active]  (17M)
     34839  30668777       2  freebsd  (15G)

=>       0  30668777  mmcsd0s2  BSD  (15G)
         0       105            - free -  (53K)
       105  30668672         1  freebsd-ufs  (15G)

root@raspberry-pi:~ # fdisk mmcsd0
******* Working on device /dev/mmcsd0 *******
parameters extracted from in-core disklabel are:
cylinders=20 heads=187 sectors/track=8192 (1531904 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=20 heads=187 sectors/track=8192 (1531904 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
    start 63, size 34776 (16 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 2/ head 42/ sector 63
The data for partition 2 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 34839, size 30668777 (14974 Meg), flag 0
        beg: cyl 2/ head 43/ sector 1;
        end: cyl 20/ head 7/ sector 0     <<< end is shrinked before booting!
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

root@raspberry-pi:~ # dumpfs /dev/mmcsd0s2a
dumpfs: /dev/mmcsd0s2a: could not read superblock to fill out disk

## your UFS partition is broken here ##
----------------------------------------------------------------------

Regards,
-- 
Daisuke Aoyama
 




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