Skip to content

Commit

Permalink
disk: fix ESP and BIOS partition type IDs for dos
Browse files Browse the repository at this point in the history
The correct partition type ID for ESP is 'ef' (not 'ef00') [1].

BIOS boot partitions aren't meant for (or required) on dos partition
tables [2].  We will eventually make this a partitionless gap in the PT,
but for now let's simply use the code for 'empty'.

[1] https://tldp.org/HOWTO/Partition-Mass-Storage-Definitions-Naming-HOWTO/x190.html
[2] https://www.gnu.org/software/grub/manual/grub/html_node/BIOS-installation.html#BIOS-installation
  • Loading branch information
achilleas-k committed Dec 10, 2024
1 parent 46a85ad commit 3421926
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ const (
// Partition type ID for any native Linux filesystem on dos
DosLinuxTypeID = "83"

// Partition type ID for BIOS boot partition on dos
DosBIOSBootID = "ef02"
// Partition type ID for BIOS boot partition on dos.
// Type ID is for 'empty'.
// TODO: drop this completely when we convert the bios BOOT space to a
// partitionless gap/offset.
DosBIOSBootID = "00"

// Partition type ID for ESP on dos
DosESPID = "ef00"
DosESPID = "ef"

// Partition type ID for swap
DosSwapID = "82"
Expand Down

0 comments on commit 3421926

Please sign in to comment.