● UK tech experts · info@vividrepairs.co.uk
Vivid Repairs
Linux terminal on a dark monitor showing partition layout and df command output on a technician workbench
Fix It Yourself · Troubleshooting

How to increase boot partition size on Linux

Updated 8 November 202613 min read
As an Amazon Associate, we may earn from qualifying purchases. Our ranking is independent.

Your /boot partition on Linux is full, and kernel updates fail with "No space left on device". You may be able to fix it by removing old kernels or shrinking the initramfs. If /boot is simply too small, it has to be resized from a live USB or moved to a bigger partition. The steps here are for traditional Ubuntu, Debian, Fedora and RHEL installations that use apt or dnf. Fedora Atomic desktops such as Silverblue and Kinoite use rpm-ostree instead, so follow Fedora's documentation for those.

What Causes the /boot Partition to Fill Up?

/boot holds the Linux kernel, its initramfs (the small image that starts the system) and the GRUB files. Each kernel update adds a new kernel and initramfs, and old ones are meant to be removed.

Old kernels pile up. If automatic removal isn't set up, or an upgrade was interrupted, old kernels stay. Each one with its initramfs can take tens of megabytes or more.

A small /boot from install time. Older installers and some cloud images made /boot only a few hundred megabytes. Kernels and initramfs images have grown since, so it fills sooner.

Large initramfs images. By default, Ubuntu and Debian build an initramfs with most drivers in it, which makes each one big. Changing that can free a lot of space.

Rescue images. On Fedora and RHEL, a rescue kernel and initramfs, usually named vmlinuz-0-rescue-MACHINE-ID and initramfs-0-rescue-MACHINE-ID.img, can take a large share of a small /boot. Removing the dracut-config-rescue package stops new ones being made.

Layout limits. /boot often sits at the start of the disk with the root partition, an LVM volume or an encrypted volume straight after it, so there's no free space next to it to grow into.

The EFI System Partition. On UEFI systems a separate small partition is mounted at /boot/efi. It fills for different reasons, such as leftover bootloaders from other installs, and a full one gives similar errors.

Start by checking. Run df -h /boot /boot/efi to see how full each is, and lsblk -f to see the layout.

To see what's taking the space, run ls -lh /boot. Each kernel has a vmlinuz file and an initrd or initramfs file with the same version number. Add the two together for the newest kernel, and allow for at least three kernels when you decide how big /boot needs to be.

Quick routeStart here

Increase Boot Partition Size: Quick Fix by Removing Old Kernels

Before touching partitions, clear the space you don't need. Always keep the kernel you're running (uname -r shows it), the newest installed kernel if it differs, and a known-good fallback.

1

Remove Old Kernels With the Package Manager Easy

  1. Ubuntu and Debian.
    Run sudo apt autoremove --purge and read the package list before you confirm. Only go ahead if it keeps the running kernel, the newest installed kernel if it differs, and a known-good fallback.
  2. See what's left.
    Run dpkg -l 'linux-image-*' | grep ^ii to list installed kernel packages. It also lists kernel meta-packages, such as linux-image-generic or linux-image-amd64. Don't remove those, because they bring in future kernel updates. To remove a specific old image, run sudo apt purge linux-image-VERSION with its exact version. Never remove the version shown by uname -r, the newest installed version if it differs, or your known-good fallback.
  3. Fedora and RHEL.
    Run sudo dnf remove --oldinstallonly to remove old kernels beyond the limit, or remove a specific one with sudo dnf remove kernel-core-VERSION.
  4. Check the space.
    Run df -h /boot again, then finish any update that failed.
If /boot now has room for the next kernel, roughly the size of the newest kernel and initramfs together, you can update again.
Don't delete files in /boot by hand with rm. The package manager then thinks they're still installed, GRUB may list kernels that aren't there, and later updates can fail.
2

Recover an Upgrade That Failed Halfway Medium

  1. Know the signs.
    On Ubuntu and Debian, apt refuses to do anything and suggests apt --fix-broken install, which also fails because /boot is full.
  2. Purge one old kernel with dpkg.
    Find an old image package whose name contains the exact old kernel version, not a kernel meta-package such as linux-image-generic or linux-image-amd64. Then run sudo dpkg --purge linux-image-VERSION only for a version that is neither running nor the newest installed one. Keep a known-good fallback. If dpkg reports a dependency error, don't purge linux-modules-VERSION first. Choose another old image, or stop and get help.
  3. Finish the upgrade.
    Run sudo apt -f install, then sudo apt autoremove --purge.
  4. Check GRUB updated.
    Run sudo update-grub so the menu matches the kernels you have.
3

Clear Space on a Full EFI Partition Medium

  1. See what's using it.
    If df -h /boot/efi is the full one, run sudo du -sh /boot/efi/EFI/*. Each folder belongs to a bootloader, such as ubuntu, fedora, Microsoft or BOOT.
  2. Back it up.
    Copy the EFI files first: sudo cp -a /boot/efi ~/efi-backup.
  3. Remove only what's gone.
    If a folder belongs to a system you've removed from this disk, delete that folder. Never delete the Microsoft folder on a dual-boot PC, or BOOT, or the one for the system you're running.
Intermediate routeKeep going if needed

Increase Boot Partition Size with a Partition Manager (Recommended)

Clearing old kernels isn't always enough on a small /boot. If it's still nearly full, make each kernel smaller first, then make /boot itself bigger.

4

Shrink the Initramfs Medium

  1. Ubuntu and Debian.
    Edit /etc/initramfs-tools/initramfs.conf and change MODULES=most to MODULES=dep, so only the drivers this machine needs are included.
  2. Use stronger compression.
    In the same file, COMPRESS=xz is the option to try if you need a smaller image. Don't assume zstd will save space, and use only a method your installed kernel supports.
  3. Rebuild.
    Run sudo update-initramfs -u -k "$(uname -r)", then df -h /boot. Restart and test that kernel before rebuilding any others.
  4. Keep a fallback.
    Leave an older kernel's existing initramfs unchanged until the rebuilt kernel has booted successfully. If it won't boot, choose that older kernel from GRUB's Advanced options and change the setting back.
MODULES=dep builds the image for the current hardware. If you move the disk to a different machine, set it back to most and run sudo update-initramfs -u -k all before you move it.
5

Resize /boot Using GParted From a Live USB Hard

Back up everything first. A power cut or mistake while partitions are moving can lose data. On a laptop, keep it plugged in.
  1. Boot live media.
    Write the GParted Live ISO, or your distribution's live ISO, to a USB stick and boot from it. Running from live media keeps the partitions out of use while you shrink and move them.
  2. Make room next to /boot.
    In GParted, shrink the partition after /boot from its start, leaving free space directly after /boot. Moving the start of a big partition rewrites much of it and can take a long time; don't interrupt it.
  3. Grow /boot.
    Resize /boot into the free space. Aim for at least 2 GiB (2,048 MiB), and allow more if you keep many kernels or have large initramfs images. GParted grows the ext4 filesystem with it.
  4. Apply and check.
    Click Apply, wait for it to finish, reboot into your system and run df -h /boot.
If the system boots and /boot shows the new size, you're done. Partition UUIDs don't change in a resize, so fstab needs nothing.

If the partition after /boot is an LVM physical volume or LUKS-encrypted, don't use the generic shrink step above. GParted can resize supported LVM and LUKS layouts, but a LUKS mapping must be open to resize it and closed to move it. Back up first, read the current GParted manual, or move /boot instead.

Advanced routeChange one thing at a time

Advanced: Increase Boot Partition Size by Migrating to a New Partition

When the free space is elsewhere on the disk rather than next to /boot, /boot can't grow into it. Create a bigger partition there instead and move /boot across.

6

Move /boot to a New, Larger Partition Hard

Back up first, and keep the live USB to hand until the system has booted from the new /boot several times. Use your own device names: lsblk -f shows them, and on NVMe drives they look like /dev/nvme0n1p2.
  1. Create and format the partition.
    From the live USB, create a partition of at least 2 GiB (2,048 MiB) in free space with GParted, and format it ext4, for example sudo mkfs.ext4 -L boot /dev/sdX3.
  2. Copy /boot across.
    Mount the old and new partitions, for example at /mnt/oldboot and /mnt/newboot, and run sudo rsync -aHAX /mnt/oldboot/ /mnt/newboot/. The trailing slashes copy the contents.
  3. Point fstab at it.
    Get the new UUID with sudo blkid /dev/sdX3. Mount the root partition at /mnt, open /mnt/etc/fstab and replace the first field on the /boot line with UUID=NEW-UUID for the new partition.
  4. Reinstall GRUB on Ubuntu or Debian.
    Mount the new /boot at /mnt/boot and, on UEFI, the EFI partition at /mnt/boot/efi. Bind-mount /dev, /proc and /sys, then run sudo chroot /mnt. On BIOS, run grub-install /dev/sdX. On UEFI, boot the live USB in UEFI mode, then run grub-install with no disk. Run update-grub and exit the chroot. Fedora and RHEL need their release-specific vendor repair procedure, especially with Secure Boot.
  5. Test before removing the old one.
    Reboot, check df -h /boot shows the new partition, and boot a few times before deleting the old /boot partition.
If the system boots and the new /boot is mounted, kernel updates will now have room.
7

Virtual Machines and LVM Hard

  1. Back up the VM.
    Make a tested backup or export first. A snapshot or checkpoint can help with a short-term rollback, but it isn't a backup.
  2. Grow the virtual disk.
    Follow your hypervisor's current disk-expansion procedure. It may require the VM to be shut down or checkpoints to be merged first. Then use the new unallocated space at the end of the disk for a new /boot, as in fix 6.
  3. LVM with free space.
    Free space in a volume group is inside its physical volumes, so it can't be used directly for a normal /boot partition. Reducing a physical volume and its partition may need data moved first and can lose data. Back up first. If you can't map the layers confidently, use another disk for /boot or get help.
When to stop. If lsblk shows a layout you don't recognise, such as encryption, RAID, several disks or a Windows dual boot, stop before moving partitions and get help. If the system won't boot after a change, don't keep trying fixes; boot the live USB and copy your data off first. On a work server, follow your change process.

The GNU parted manual and the Arch Linux wiki on parted explain partition types and flags if you need them.

Preventing /boot From Filling Up Again

With room on /boot again, these stop it filling up.

  • Remove old kernels automatically. On Ubuntu, unattended-upgrades can remove unused kernels (Remove-Unused-Kernel-Packages); otherwise run sudo apt autoremove --purge after updates. On Fedora, keep installonly_limit in /etc/dnf/dnf.conf at 3.
  • Keep the initramfs small. On Ubuntu and Debian, MODULES=dep and a suitable compression method can keep each kernel update from eating space. Fedora and RHEL use dracut, so use their documented dracut settings instead.
  • Size /boot generously. On a new install, at least 2 GiB (2,048 MiB) for /boot leaves room for growth. Many installers now put /boot on the root filesystem unless encryption or the layout needs it separate.
  • Watch it. Check df -h /boot now and then, especially on servers and VMs that update automatically.
  • Restart after kernel updates. Until you restart, the old kernel is still running, and autoremove keeps it, so space isn't freed.
  • Back up before disk work. Keep a current backup before any resize or move.

Increase Boot Partition Size: Summary

When /boot is full, check it with df -h /boot and remove old kernels with apt or dnf, keeping the running kernel, the newest installed version if it differs, and a known-good fallback. If an upgrade broke halfway, use dpkg to purge only an old kernel that is neither running nor the newest installed, then run sudo apt -f install. A smaller initramfs frees more.

If /boot is still too small, back up, boot a live USB and enlarge it with GParted, or create a new partition, copy /boot across, update fstab and reinstall GRUB. Test the new /boot before removing the old one.

Frequently Asked Questions

At least 2 GiB (2,048 MiB) is a safer size now and leaves room for several kernels. Systems with large initramfs images or many kernels may need more. Older 200 to 500 MB partitions fill quickly.

Not safely. Back up first, then boot a live USB such as GParted Live, so /boot and the partitions next to it aren't in use, and resize there.

Not after a resize in place, because the partition and its UUID stay the same. Moving /boot is different. Back up first, and once it's moved, update fstab. On Ubuntu or Debian, boot the live USB in UEFI mode on UEFI systems, then reinstall GRUB and run update-grub from a chroot. Fedora and RHEL need their release-specific vendor procedure, especially on UEFI systems with Secure Boot.

Back up first. If the next partition is a normal supported filesystem, shrink it from its start in GParted, which moves data and takes time. If it's LVM or LUKS-encrypted, don't use this shortcut. Create a new /boot partition in free space elsewhere and move /boot there, or get help.

Yes, with the package manager, as long as you keep the running kernel, the newest installed version if it differs, and a known-good fallback. Don't delete files in /boot by hand.

It can mean /boot is full, often with old kernels. On Ubuntu or Debian, run uname -r and dpkg -l 'linux-image-*' | grep ^ii. Purge only an image that is neither running nor the newest installed, while keeping a known-good fallback: sudo dpkg --purge linux-image-VERSION. Then run sudo apt -f install and sudo apt autoremove --purge.

Not always. Many installs keep /boot on the root filesystem, which avoids the problem. A separate /boot is still common with full-disk encryption, some LVM layouts and older setups. Changing it on an existing system is a bigger job than enlarging it.

A small temporary filesystem the kernel loads first, with the drivers and tools needed to find and open the real root filesystem. Each installed kernel has its own, which is why /boot holds a pair of files per kernel.

No. GRUB and the package manager expect them in /boot. Remove old kernels with the package manager. If you might need a particular version later, check it's still available from your configured repositories before you remove it.

Run uname -r. Keep that version, the newest installed version if it differs, and at least one older kernel that you know boots.