Skip to content

Commit

Permalink
distro/rhel9: Make /boot 600 MiB big on RHEL 9.3+
Browse files Browse the repository at this point in the history
Changes in xfsprogs in 9.3 caused XFS partitions have less available space
(due to more space reserved for the log section).

We discovered that this causes issues with kernel updates. When 3 kernels are
already installed and dnf wants to install a new one (and replace the oldest
one), /boot must contain 4 kernels for a brief period of time, which
doesn't fit on the small partition. This causes the transation test to fail,
and dnf refuses to perform such a transaction.

There's a workaround: Remove one of the kernels manually using `dnf remove`
before running an update.

This is however quite surprising and annoying, thus this commits bumps the
size of /boot to 600 MiB starting from 9.3 (and on CentOS Stream).
  • Loading branch information
ondrejbudai authored and achilleas-k committed Oct 23, 2023
1 parent aa474f5 commit 857e8f4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
10 changes: 8 additions & 2 deletions pkg/distro/rhel9/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ func azureRhuiPackageSet(t *imageType) rpmmd.PackageSet {
// PARTITION TABLES

func azureRhuiBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
// RHEL >= 9.3 needs to have a bigger /boot, see RHEL-7999
bootSize := uint64(600) * common.MebiByte
if common.VersionLessThan(t.arch.distro.osVersion, "9.3") && t.arch.distro.isRHEL() {
bootSize = 500 * common.MebiByte
}

switch t.platform.GetArch() {
case platform.ARCH_X86_64:
return disk.PartitionTable{
Expand All @@ -198,7 +204,7 @@ func azureRhuiBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
{
Size: 500 * common.MebiByte,
Size: bootSize,
Type: disk.FilesystemDataGUID,
UUID: disk.FilesystemDataUUID,
Payload: &disk.Filesystem{
Expand Down Expand Up @@ -307,7 +313,7 @@ func azureRhuiBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
{
Size: 500 * common.MebiByte,
Size: bootSize,
Type: disk.FilesystemDataGUID,
UUID: disk.FilesystemDataUUID,
Payload: &disk.Filesystem{
Expand Down
14 changes: 10 additions & 4 deletions pkg/distro/rhel9/partition_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import (
)

func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
// RHEL >= 9.3 needs to have a bigger /boot, see RHEL-7999
bootSize := uint64(600) * common.MebiByte
if common.VersionLessThan(t.arch.distro.osVersion, "9.3") && t.arch.distro.isRHEL() {
bootSize = 500 * common.MebiByte
}

switch t.platform.GetArch() {
case platform.ARCH_X86_64:
return disk.PartitionTable{
Expand Down Expand Up @@ -34,7 +40,7 @@ func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
{
Size: 500 * common.MebiByte,
Size: bootSize,
Type: disk.XBootLDRPartitionGUID,
UUID: disk.FilesystemDataUUID,
Payload: &disk.Filesystem{
Expand Down Expand Up @@ -81,7 +87,7 @@ func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
},
},
{
Size: 500 * common.MebiByte,
Size: bootSize,
Type: disk.XBootLDRPartitionGUID,
UUID: disk.FilesystemDataUUID,
Payload: &disk.Filesystem{
Expand Down Expand Up @@ -119,7 +125,7 @@ func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
Bootable: true,
},
{
Size: 500 * common.MebiByte,
Size: bootSize,
Payload: &disk.Filesystem{
Type: "xfs",
Mountpoint: "/boot",
Expand Down Expand Up @@ -148,7 +154,7 @@ func defaultBasePartitionTables(t *imageType) (disk.PartitionTable, bool) {
Type: "dos",
Partitions: []disk.Partition{
{
Size: 500 * common.MebiByte,
Size: bootSize,
Payload: &disk.Filesystem{
Type: "xfs",
Mountpoint: "/boot",
Expand Down

0 comments on commit 857e8f4

Please sign in to comment.