NetBSD-Bugs archive

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

install/59484: sysinst is confused by hybrid MBR



>Number:         59484
>Category:       install
>Synopsis:       sysinst is confused by hybrid MBR
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 24 22:50:00 +0000 2025
>Originator:     Valery Ushakov
>Release:        NetBSD 10.1
>Organization:
>Environment:
>Description:
sysinst on x86 unconditionally calls `gpt biosboot` in
md_gpt_post_write(), but gpt(8) seems to be confused and unhappy about
hybrid MBR.  So if you a trying to install NetBSD on such a disk, the
installation fails after partitioning with

   Status: Command failed
  Command: gpt biosboot -b 0123456789

and no further details that provide a clue as to what went wrong.

>How-To-Repeat:
Try to install NetBSD on a disk that already has a Linux on it, to
dual boot.  My scenario was:

1) Install Ubuntu, erasing the disk and using the whole disk (yes, I
   was lazy :).

   That actually creates GPT partition with the normal protective MBR.

2) Use gparted to reduce the size of the Linux partition and to pre
   create GPT partitions for NetBSD in a nice point-and-click
   partition editor (did I mention I was lazy?).

   This is where it seems to go wrong.  gparted as shipped with the
   Ubuntu 24.04 install/live image makes the disk switch to hybrid MBR

3) Try to install NetBSD on that same disk.  Observe installation fail
   immediately after you configure it to use existing partitions and
   start the actual installation.

>Fix:
You can boot with a Linux live image and re-create protective MBR with

  # gdisk /dev/...
  x
  n
  w

where `x` switches to the expert mode, `n` recreates the protective
MBR, and `w` writes back the changes.

Looking at the manual page, I guess sysinst should probably invoke
gpt(8) with `-H` for that `biosboot` to ignore hybrid MBR (haven't
tried it myself, dunno, if it would be enough).

May be teach gpt(8) to re-create protective MBR?  Though that
probably requires additional interaction with the user.



Home | Main Index | Thread Index | Old Index