This document describes your manual and effective method for clearing space in the
/boot partition on Fedora using the Midnight Commander utility (mc).
Manual Method to Free Up Space in the /boot Partition on Fedora
This procedure leverages the Midnight Commander (mc) file manager to safely identify and remove old kernel versions, ensuring system updates can proceed without “out of space” errors.
Use the code with care.
Prerequisites
- Access to a terminal (such as
terminator).
- Superuser privileges (
sudo).
Detailed Steps
- Install Midnight Commander (mc)
First, install mc to facilitate navigating and deleting files within the terminal:
bash
sudo dnf install mc -y
Use the code with care.
- Verify the Current Running Kernel Version
It is crucial to know which kernel version the system is currently using right now to ensure you do not accidentally delete it:
bash
uname -a
Use the code with care.
Example Output:
Linux hostname 6.17.12-300.fc43.x86_64 ...
Note down the exact version number. In this example, the version to be kept is 6.17.12-300.fc43.x86_64.
- Manage Files in the
/boot Partition with mc
Open mc directly in the /boot directory using root privileges:
bash
sudo mc /boot
Use the code with care.
- Delete Old Kernels (While Keeping Essentials)
Inside mc, navigate through the files and use the F8 key to mark files for deletion.
What must be kept (do not delete):
Keep all files that contain the kernel version number noted in Step 2 (e.g., 6.17.12-300). This includes:
vmlinuz-* (and corresponding System.map, config, symvers, initramfs files)
Furthermore, always retain the rescue files:
- Any file containing the word
rescue in the name.
IMPORTANT SAFETY NOTE:
The ideal practice is to always keep at least two functional kernels (the current one in use and the immediate previous one), in addition to the rescue image. This serves as a contingency plan: if the primary kernel fails after an update or for any other reason, you can reboot using the previous kernel or the rescue image to diagnose and fix the problem.
What should be deleted:
Delete all files belonging to older kernel versions that exceed the minimum number of safe kernels you wish to retain.
Use F8 to delete the old files. mc will ask for confirmation before deletion.
- Reboot the System (Optional, but Recommended)
After freeing up space, you can proceed with your system updates. When it is time to reboot, you will know exactly which entry to select in the GRUB menu to ensure a safe boot:
- Select the Rescue option;
- Select the entry that lists the specific kernel version you kept (
6.17.12-300);
- Or select the previous kernel version you chose to keep as a backup.