Updated: 28 September 2026 · Applies to: GRUB 2 on AlmaLinux and Rocky Linux 9 and 10 and RHEL 9 and 10 (BIOS and UEFI)

A separate /boot partition holds the kernels and the boot loader's files. You may need a new or bigger one when /boot is too small for current kernels (updates fail with "not enough space on /boot"), or after moving the system to a new disk. This is a delicate change: a mistake leaves the server unable to boot. Do it only with console access (IPMI, KVM or your VPS panel's console) and a tested backup.

First check: is a bigger /boot really needed?

Often it is enough to remove old kernels. Current releases keep three by default:

df -h /boot
dnf remove --oldinstallonly --setopt installonly_limit=2

AlmaLinux, Rocky Linux and RHEL 9 and 10 recommend at least 1 GiB for /boot.

Create and fill the new /boot partition

  1. Create a partition of at least 1 GiB on a disk the firmware can boot from, and a file system on it (see how to partition and mount a new disk):
    mkfs.xfs -L boot /dev/sdb1
  2. Copy the current contents with all attributes, leaving out the contents of the EFI partition (on UEFI systems /boot/efi is its own small partition and stays where it is; only the empty folder is copied):
    mkdir /mnt/newboot
    mount /dev/sdb1 /mnt/newboot
    rsync -aAX --exclude='/efi/*' /boot/ /mnt/newboot/
  3. Get the new partition's UUID with blkid /dev/sdb1, and in /etc/fstab replace the UUID on the /boot line with the new one (keep a copy of the old file).
  4. Switch over and restore SELinux labels:
    umount /mnt/newboot
    umount /boot/efi 2>/dev/null
    umount /boot
    mount /boot
    mount /boot/efi 2>/dev/null
    restorecon -Rv /boot
  5. Make the boot loader use the new partition. On BIOS servers, install GRUB to the boot disk and regenerate its menu:
    grub2-install /dev/sdb
    grub2-mkconfig -o /boot/grub2/grub.cfg
    On UEFI servers, do not run grub2-install. The small grub.cfg in the EFI partition finds /boot by its file system UUID, so write a new one for the new partition, then regenerate the menu:
    gen_grub_cfgstub /boot/grub2 /boot/efi/EFI/almalinux
    grub2-mkconfig -o /boot/grub2/grub.cfg
    Use your distribution's folder name under /boot/efi/EFI/ (for example rocky or redhat). gen_grub_cfgstub comes with the grub2-efi package and reads the new UUID itself; check the result with cat /boot/efi/EFI/almalinux/grub.cfg.
  6. Reboot and check with findmnt /boot and cat /proc/cmdline. Keep the old /boot partition untouched until the server has booted from the new one several times.

If the server does not boot, use the rescue steps in how to reinstall GRUB2 from rescue mode, and switch /etc/fstab back to the old UUID.

Official documentation: Reinstalling GRUB (Red Hat).

Byla tato odpověď nápomocná?

Stále potřebujete pomoc? Otevřete tiket