NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Sysinst creates gaps between GPT partitions - why?



Hello,

recently I observed some sysinst behaviour which led to some confusion afterwards.

When using sysinst to create GPT partitions on a fresh disk, it seems to create gaps between the partitions:

ganymed# gpt show wd0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34        2014         Unused
        2048      262144      1  GPT part - EFI System
      264192        2048         Unused
      266240    33554432      2  GPT part - NetBSD FFSv1/FFSv2
    33820672        2048         Unused
    33822720    16623616      3  GPT part - NetBSD swap
    50446336  3856582799         Unused
  3907029135          32         Sec GPT table
  3907029167           1         Sec GPT header

This leds to a particular unexpected behavior if one tries to create another partition afterwards, using all unused space:

ganymed# gpt add -t linux-lvm -l lvm wd0
/dev/rwd0: Partition 4 added: e6d6d379-f507-44c2-a23c-238f2a3df928 34 2014

Instead of using the large free space at the end of the disk, the gap between the PMBR and the EFI system partition is used:

ganymed# gpt show wd0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34        2014      4  GPT part - Linux LVM
        2048      262144      1  GPT part - EFI System
      264192        2048         Unused
      266240    33554432      2  GPT part - NetBSD FFSv1/FFSv2
    33820672        2048         Unused
    33822720    16623616      3  GPT part - NetBSD swap
    50446336  3856582799         Unused
  3907029135          32         Sec GPT table
  3907029167           1         Sec GPT header

I can workaround this by using the -b option of gpt to specify the beginning block number of the partition to be created. Anyway - this seems not to be as intuitive as it should. Assuming partitioning is a one time effort only, the priority is not that high. I would still like to understand why the gaps are existing (maybe for alignment?) and if the reported behavior of the gpt command is as expected.

ganymed# gpt add -b 50446336 -t linux-lvm -l lvm wd0
/dev/rwd0: Partition 4 added: e6d6d379-f507-44c2-a23c-238f2a3df928 50446336 3856582799

ganymed# gpt show wd0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34        2014         Unused
        2048      262144      1  GPT part - EFI System
      264192        2048         Unused
      266240    33554432      2  GPT part - NetBSD FFSv1/FFSv2
    33820672        2048         Unused
    33822720    16623616      3  GPT part - NetBSD swap
    50446336  3856582799      4  GPT part - Linux LVM
  3907029135          32         Sec GPT table
  3907029167           1         Sec GPT header

Kind regards
Matthias

p.s. this is on NetBSD 9.0 Release


Home | Main Index | Thread Index | Old Index