/boot running out of room, Rocky 9.5

I’ve recently been getting warnings about having only 20 MB left on /boot. Not sure what is changed to clutter it up, but I have some guesses. grub is set to retain only 3 kernels (besides the rescue kernel). I note a bunch of seemingly redundant files in /boot, however, and wonder if it is safe to remove any of them. Here’s a listing of /boot:

$ ls -lrt /boot
total 548932
drwx------. 3 root root     16384 Dec 31  1969 efi
drwxr-xr-x. 2 root root      4096 Nov 24  2022 extlinux
drwxr-xr-x. 3 root root        21 Mar  7  2023 loader
-rwxr-xr-x. 1 root root  11650240 Mar  7  2023 vmlinuz-0-rescue-f509f41455074bfeadbe1cde0a137126
-rw-------. 1 root root 124633197 Mar  7  2023 initramfs-0-rescue-f509f41455074bfeadbe1cde0a137126.img
-rw-------. 1 root root   8635936 Oct 31 10:13 System.map-5.14.0-427.42.1.el9_4.x86_64
-rw-r--r--. 1 root root    223407 Oct 31 10:13 config-5.14.0-427.42.1.el9_4.x86_64
-rwxr-xr-x. 1 root root  13617992 Oct 31 10:13 vmlinuz-5.14.0-427.42.1.el9_4.x86_64
lrwxrwxrwx. 1 root root        52 Nov  6 20:35 symvers-5.14.0-427.42.1.el9_4.x86_64.gz -> /lib/modules/5.14.0-427.42.1.el9_4.x86_64/symvers.gz
-rw-------. 1 root root   8876141 Nov 15 07:17 System.map-5.14.0-503.14.1.el9_5.x86_64
-rwxr-xr-x. 1 root root  14457672 Nov 15 07:17 vmlinuz-5.14.0-503.14.1.el9_5.x86_64
-rw-r--r--. 1 root root    226284 Nov 15 07:17 config-5.14.0-503.14.1.el9_5.x86_64
lrwxrwxrwx. 1 root root        52 Nov 19 18:01 symvers-5.14.0-503.14.1.el9_5.x86_64.gz -> /lib/modules/5.14.0-503.14.1.el9_5.x86_64/symvers.gz
-rw-------. 1 root root  95511758 Nov 19 18:05 initramfs-5.14.0-503.14.1.el9_5.x86_64.img
-rw-------. 1 root root  34950144 Nov 19 18:05 initramfs-5.14.0-427.42.1.el9_4.x86_64kdump.img
-rw-------. 1 root root  73530880 Nov 19 23:32 initramfs-5.14.0-503.14.1.el9_5.x86_64kdump.img
-rw-------. 1 root root  56652537 Nov 20 21:29 initramfs-5.14.0-427.42.1.el9_4.x86_64.img
-rw-------. 1 root root   8876723 Dec 19 08:07 System.map-5.14.0-503.19.1.el9_5.x86_64
-rw-r--r--. 1 root root    226284 Dec 19 08:07 config-5.14.0-503.19.1.el9_5.x86_64
-rwxr-xr-x. 1 root root  14461768 Dec 19 08:07 vmlinuz-5.14.0-503.19.1.el9_5.x86_64
lrwxrwxrwx. 1 root root        52 Dec 23 14:06 symvers-5.14.0-503.19.1.el9_5.x86_64.gz -> /lib/modules/5.14.0-503.19.1.el9_5.x86_64/symvers.gz
-rw-------. 1 root root  95517913 Dec 23 14:07 initramfs-5.14.0-503.19.1.el9_5.x86_64.img
drwx------. 3 root root        50 Dec 28 13:21 grub2

I wonder what the initramfs-kdump.img files are for, and noting that the initramfs files are large, I wonder if any kernel needs both the initramfs.img and initramfs*kdump.img files? Two of the kernels listed have both files.

BTW, the partition is 600 MB, and if I remember correctly from when I installed Rocky9 on this box (well over a year and a half ago) I probably let the installer choose the sizes it wanted.

I’ve looked at the partitions with gparted and in order to make /boot larger, I’d have to shrink /home (which has plenty of room)–but one is always nervous about messing with a working system…

Any advice would be much appreciated.

thanks in advance!

Fred

Oh, and I forgot to mention this is linux-raid system, and each partition is on its own raid-1 volume, using MD, not LVM. the underlying drives are 1 TB Sandisk SSDs.

given that each partition is a separate raid volume, I’m not sure how I"d go about adjusting their sizes to move some space from one to another. I’m sure that left to my own skills I’d screw it up. :blush:

In the installer there was “kdump” as distinct option. It is enabled by default.
When it is enabled, the separate initramfs*kdump.img is created along the normal image.

If kernel does crash, the kdump service could create crash dump and (re)boot the kernel with the special image that supports debugging (or something). kdump (Linux) - Wikipedia

It is possible to remove those *kdump.img files. It is also possible to disable the kdump service.
That should prevent generation of more of them.


I’m quite sure that the default for /boot is 1 GB.

You could set installonly_limit=2 in /etc/dnf/dnf.conf
That would keep only two kernels installed.

I’m reluctant to cut retained kernels to 2, so I looked up how to disable kdump, did it, then removed the two kdump.img files and did a reboot. Time will tell if that is adequate.

Thanks for the info!

Fred