On 2014-11-04, Jonathan Thornburg <[email protected]> wrote:

> It's as if the 'a' partition I created (which started at offset 64) was
> actually overlapping the disklabel metadata!

Well, it does.

On architectures that use the MBR partition scheme, the disklabel
is located in the second sector of the OpenBSD area.  (The first
sector holds biosboot(8) on x86.)  Typically, sd0a starts on the
first sector of the OpenBSD area.

So why doesn't the disklabel interfere with a filesystem in sd0a?
FFS leaves a small part at the start of a partition unused (8kB for
FFS1, 64kB for FFS2), exactly in order to leave space for disklabels
and bootstrap code.

Here's a sketch:

                   biosboot
                      :
    MBR               : disklabel
     :                :     :
  0  :  1          64 :  65 :  66
  |=====|==========|=====|=====|=========|==========|==================>
  |                |
  |                +-- sd0a -------------+----------+--------->
  |                |       (unused)      (superblock)   ...
  |                |
  |                +-- OpenBSD area ----------------------------------->
  |
  +-- sd0c ------------------------------------------------------------>


-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to