Subject: mbrlabel and *BSD partitions
To: None <tech-userlevel@NetBSD.org>
From: Klaus Heinz <k.heinz.jul.sechs@onlinehome.de>
List: tech-userlevel
Date: 07/12/2006 21:55:05
Hi,

with a new disk I observed that mbrlabel sets the size of MBR partitions
of type 169 to a fixed size of 16384 blocks:

  $ mbrlabel wd1
  ...
  Found 4.2BSD partition; size 8032437 (3922 MB), offset 77561883
  adding 4.2BSD partition to slot h.
  ...
   h:     16384  77561883     4.2BSD   1024  8192    16  # (Cyl.76946*-  76962*)

This behaviour is not a bug as I first thought, it is hardwired in
mbrlabel.c:
                switch (npe.p_fstype) {
                case FS_BSDFFS:
                case FS_APPLEUFS:
                        npe.p_size = 16384;     /* XXX */
                        npe.p_fsize = 1024;
                        npe.p_frag = 8; 
                        npe.p_cpg = 16;
                        break;

Why does mbrlabel use the information from the MBR in the new disklabel
for all the other partition types but not for BSD partitions?

ciao
     Klaus