Subject: newfs trashes MBR/disklabel?
To: None <port-amd64@NetBSD.org, netbsd-help@NetBSD.org>
From: Dieter <netbsd@sopwith.solgatos.com>
List: port-amd64
Date: 08/27/2005 19:02:01
This is my first system that uses a "MBR" type partition table
plus BSD disklabel rather than just a BSD disklabel.  Most likely
I have made some MBR newbie error.

Install says:

We now have your BSD-disklabel partitions as:
 This is your last chance to change them.

    Start sec   End sec  Size sec FS type    Newfs Mount Mount point
    --------- --------- --------- ---------- ----- ----- -----------
 a:        63    204862    204800 FFSv1            Yes   /
 b: 477911408 488397167  10485760 swap
 c:        63    204862    204800 NetBSD partition
 d:         0 488397167 488397168 Whole disk
 e:    204863  10690622  10485760 FFSv1            Yes
 f:  10690623 344562094 333871472 Linux Ext2
 g: 344562095 348756398   4194304 Linux Ext2
 h: 363436463 363641262    204800 FFSv1            Yes
 i: 363641263 367835566   4194304 FFSv1            Yes   /usr
 j: 367835567 378321326  10485760 FFSv1            Yes   /var
>k: 378321327 382515630   4194304 FFSv1            Yes   /home
 l: 382515631 386709934   4194304 FFSv1            Yes
 m: 386709935 397195694  10485760 FFSv1            Yes
 n: 397195695 398219694   1024000 FFSv1            Yes
 o: 398219695 414996910  16777216 FFSv1            Yes
 p: 414996911 477911407  62914497 FFSv1            Yes
 q: Change input units (sectors/cylinders/MB)
 x: Partition sizes ok

There are (were?) two more Linux partitions between g & h in the
MBR version, but disklabel would not allow more than 16 partitions
and c & d get wasted.

It seemed happy with this.  Then it said that fsck failed so
I went back to the shell and ran newfs on a, i, j, & k by
hand.

Now it is unhappy.

# fdisk wd1
fdisk: extended partition table invalid, no magic in sector 363641515
fdisk: Extended partition table is corrupt

Disk: /dev/rwd1d
NetBSD disklabel disk geometry:
cylinders: 484521, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 488397168

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 488397168

Partition table:
0: NetBSD (sysid 169)
    bootmenu: netbsd
    start 63, size 204800 (100 MB, Cyls 0-12/191/51), Active
1: Linux native (sysid 131)
    bootmenu: spare
    start 204863, size 10485760 (5120 MB, Cyls 12/191/51-665/117/28)
2: Linux native (sysid 131)
    bootmenu: big
    start 10690623, size 333871472 (163023 MB, Cyls 665/117/28-21447/254/39)
3: Ext. partition - LBA (sysid 15)
    start 344562095, size 143835073 (70232 MB, Cyls 21447/254/39-30401/81/1)
    Extended partition table:
    0: Linux native (sysid 131)
        bootmenu: linuxusr
        start 344562158, size 4194304 (2048 MB, Cyls 21447/254/39-21709/21/55)
    1: Extended partition (sysid 5)
        start 348756462, size 10485823 (5120 MB, Cyls 21709/21/55-22361/203/32)
        Extended partition table:
        0: Linux native (sysid 131)
            bootmenu: linuxvar
            start 348756525, size 10485760 (5120 MB, Cyls 21709/21/55-22361/203/32)
        1: Extended partition (sysid 5)
            start 359242285, size 4194367 (2048 MB, Cyls 22361/203/32-22622/225/48)
            Extended partition table:
            0: Linux native (sysid 131)
                bootmenu: lin home
                start 359242348, size 4194304 (2048 MB, Cyls 22361/203/32-22622/225/48)
            1: Extended partition (sysid 5)
                start 363436652, size 204863 (100 MB, Cyls 22622/225/48-22635/162/35)
                Extended partition table:
                0: NetBSD (sysid 169)
                    bootmenu: bsd root
                    start 363436715, size 204800 (100 MB, Cyls 22622/225/48-22635/162/35)
                1: Extended partition (sysid 5)
                    start 363641515, size 4194367 (2048 MB, Cyls 22635/162/35-22896/184/51)
                    Extended partition table:
fdisk: extended partition table invalid, no magic in sector 363641515
                2: <UNUSED>
                3: <UNUSED>
            2: <UNUSED>
            3: <UNUSED>
        2: <UNUSED>
        3: <UNUSED>
    2: <UNUSED>
    3: <UNUSED>
Extended partition table is corrupt
Bootselector disabled.
# 

What did I do wrong?