Hi guys,
I’m having to manually delete old kernel files because my boot partition is always a few megabytes too small when running dnf. I’d like some guidance on the best way to expand it. I’m using LVM.
Hi guys,
I’m having to manually delete old kernel files because my boot partition is always a few megabytes too small when running dnf. I’d like some guidance on the best way to expand it. I’m using LVM.
Hello @theorionarm,
Can we see the output of /etc/fstab
? Wouldn’t hurt to see the output of df -h /boot
as well.
Another informative command is lsblk
– particularly
lsblk -o name,size,type,fstype,uuid,mountpoint
Note also that you can most likely copy-paste output from terminal into forum post and use code tags (the </>
button) to keep it neatly readable.
Your /boot
is only 295 MB. RHEL 6 did recommend 250 MB, but since RHEL 7 the size recommendation for /boot
has been 1 GB.
The /boot
is not a LVM LV. It is on “standard” partition. That is the default. IIRC, the installer refuses to create /boot
as LV as the bootloader (GRUB) has to be able to read kernel, initramfs, etc from the filesystem and to do so it would have to support/assemble/enable LVM. While latest GRUB might have some support for LVM, the first stage of legacy boot setup (which you seem to have) most likely does not.
Practically, you cannot resize the /dev/sda1
.
If the disk had larger unnallocated block (after the PV partition), then creation of new larger partition for /boot
would be possible. I bet it has not.
It is not possible to shrink existing XFS filesystem. Therefore, you cannot make one of them smaller and shrink the PV to create unallocated space. (The XFS shrink operation is: backup, remove, create, restore.)
Well, you could remove the swap LV temporarily.
Each kernel installs the vmlinuz file and initramfs. The ‘installonly_limit’ in /etc/dnf/dnf.conf
says how many kernels to have. Defaults to 3. Could be 2, but not really less.
If package dracut-config-rescue
is installed, a copy of one kernel and a larger initramfs is also there.
If kdump is enabled, then every installed kernel has also second initramfs for kdump.
Decreasing installonly_limit, and disabling kdump and rescue kernel generation would save space, if you have not done those already.