Hello!

> The OpenBSD installer partitioning does not accept more than 15 partitions
> with GPT (partitions 'c' and 'i' are already defined in advance by the
> installer). It limits from partition 'a' to 'p', but GPT partitions must
> support up to 128 partitions.


It is actually more restricted:
- yes, total amount of disklabel slices is 16 - 'a' to 'p'

BUT:
- only first 8 slices are reserved for OpenBSD slices inside single GPT partition with OpenBSD ID. Where 'b' is reserved for swap, and 'c' is always whole disk. So only 6 slices are available for slices inside OpenBSD partition - another 8 slices are automatically used to map other GPT partitions. So you can access from OpenBSD up to 8 others partitions in GPT.

Later mechanism is done by function spoofgpt() in /usr/src/sys/kern/subr_disk.c - see https://cvsweb.openbsd.org/src/sys/kern/subr_disk.c?rev=1.272&content-type=text/x-cvsweb-markup


To fully understand it, here is complex example of my GPT disk partitioning (note that I actually use BIOS mode, which is not officially supported on OpenBSD, but it works fine using Linux + GRUB to load OpenBSD kernel).

GPT partitions as seen by OpenBSD fdisk:

isk: sd0       Usable LBA: 34 to 937703054 [937703088 Sectors]
   #: type                                 [       start:         size ]
------------------------------------------------------------------------
   0: BIOS Boot                            [          34:         2014 ]
   1: EFI Sys                              [        2048:      2097152 ]
   2: Linux LVM                            [     2099200:    312473601 ]
   3: EFI Sys                              [   314574848:       204800 ]
   4: OpenBSD                              [   314779648:    102400000 ]
   5: NetBSD                               [   417181696:    100663296 ]
   6: 49f48d32-b10e-11dc-b99b-0019d1879648 [   517844992:     16777216 ]
   7: 83bd6b9d-7f41-11dc-be0b-001560b84f0f [   534622208:         1024 ]
   8: 516e7cb6-6ecf-11d6-8ff8-00022d09712b [   534623232:    104856576 ]
   9: 516e7cb5-6ecf-11d6-8ff8-00022d09712b [   639479808:     16777216 ]
  10: Linux files*                         [   656257024:    104857600 ]


And here is disklabel (omitted header):

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  a:         98205696        314779648  4.2BSD   2048 16384 12960 # /
  b:          4194304        412985344    swap                    # none
  c:        937703088                0  unused
  i:             2014               34    boot
  j:          2097152             2048   MSDOS
  k:        312473601          2099200 unknown
  l:           204800        314574848   MSDOS
  m:        100663296        417181696 unknown
  n:         16777216        517844992 unknown
  o:             1024        534622208 unknown
  p:        104856576        534623232 unknown

Note that:
- slices 'a' to 'h' are usable for OpenBSD, however 'a' should be root filesystem, 'b' should be swap, and 'c' is synthetic entry covering whole disk. All these slices are always inside single GPT partition of type OpenBSD - in this case: 4: OpenBSD - slices from 'i' to 'p' are automatically mapped other GPT partitions. You can see (matching offset), that
- slice 'i' is GPT partition 0: BIOS Boot
- ... slice 'p': is GPT partition: 8: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
- however it means that additional GPT partitions (starting from 9) are simply NOT accessible from OpenBSD.

So briefly:
- there are total 16 slices ('a' to 'p') available
- first 8 slices are used to map OpenBSD slices inside single OpenBSD GPT partition (but 'a', 'b', 'c' have special meaning as described above) - remaining 8 slices are automatically mapped remaining GPT partitions so they can be accessed from OpenBSD (through device in /dev/)


Hopefully it will make things more clear.

Best regards
  --Henryk Paluch




On 12/18/23 17:15, spnti wrote:
Hello guys!

The OpenBSD installer partitioning does not accept more than 15 partitions
with GPT (partitions 'c' and 'i' are already defined in advance by the
installer). It limits from partition 'a' to 'p', but GPT partitions must
support up to 128 partitions.

Thank you for your attention and help.

Reply via email to