Keep running out of space building ramfs or maybe not?

Hello,

I am new to Linux and experiencing a recurring issue for which I have no idea as to why it happens.

Every so often after an update I will ge a message saying the vlinuz img cannot be found and I have to use the previous kernel.

When I boot to the older kernel I get the following and use dracut to regenerate, I get the following:

sudo dracut -f --regenerate-all

dracut[F]: Can’t write to /boot/efi/349ff817715b4c70a3dc6c6f88c67f90/6.12.0-124.55.1.el10_1.x86_64: Directory /boot/efi/349ff817715b4c70a3dc6c6f88c67f90/6.12.0-124.55.1.el10_1.x86_64 does not exist or is not accessible.
cp: error writing ‘/boot/initramfs-6.12.0-211.16.1.el10_2.0.1.x86_64.img.tmp’: No space left on device
dracut[F]: Creation of /boot/initramfs-6.12.0-211.16.1.el10_2.0.1.x86_64.img.tmp failed
cp: error writing ‘/boot/initramfs-6.12.0-211.18.1.el10_2.x86_64.img’: No space left on device
dracut[F]: Creation of /boot/initramfs-6.12.0-211.18.1.el10_2.x86_64.img failed

When I check the space usage, this is what I see?

df -h /boot/
Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p2 960M 649M 312M 68% /boot

it doesn’t look like im at a 100%

How do I fix the issue and boot to the newer kernel? Any help, advise or guidance is appreciated.

No space left on /boot is not the same thing as /boot/efi

ahhhh ok…thank you.I have reworked the command and posted the results. Can you provide some guidance now?

rpm -q kernel

ls /boot

These are the results

rpm -q kernel
kernel-6.12.0-124.56.1.el10_1.x86_64
kernel-6.12.0-211.16.1.el10_2.0.1.x86_64
kernel-6.12.0-211.18.1.el10_2.x86_64

❯ ls /boot
config-6.12.0-124.56.1.el10_1.x86_64 loader
config-6.12.0-211.16.1.el10_2.0.1.x86_64 memtest86+x64.efi
config-6.12.0-211.18.1.el10_2.x86_64 symvers-6.12.0-124.56.1.el10_1.x86_64.xz
efi symvers-6.12.0-211.16.1.el10_2.0.1.x86_64.xz
extlinux System.map-6.12.0-124.56.1.el10_1.x86_64
grub2 System.map-6.12.0-211.16.1.el10_2.0.1.x86_64
initramfs-0-rescue-349ff817715b4c70a3dc6c6f88c67f90.img System.map-6.12.0-211.18.1.el10_2.x86_64
initramfs-6.12.0-124.56.1.el10_1.x86_64.img vmlinuz-0-rescue-349ff817715b4c70a3dc6c6f88c67f90
initramfs-6.12.0-124.56.1.el10_1.x86_64kdump.img vmlinuz-6.12.0-124.56.1.el10_1.x86_64
initramfs-6.12.0-211.16.1.el10_2.0.1.x86_64.img vmlinuz-6.12.0-211.16.1.el10_2.0.1.x86_64
initramfs-6.12.0-211.16.1.el10_2.0.1.x86_64kdump.img vmlinuz-6.12.0-211.18.1.el10_2.x86_64

I don’t see anything out of order there.

You could try deleting the oldest kernel you have installed and see if it works as expected after that.

You could try adding the following line to the [main] section in /etc/dnf/dnf.conf

installonly_limit=2

This will only keep 2 versions of the kernel/initramfs in /boot - which should save space

I did a sudo dnf remove --oldinstallonly

and edited the /etc/dnf/dnf.conf

installonly_limit=2

I tried running dracut -f --regenerate-all but still get this

dracut[F]: Can’t write to /boot/efi/349ff817715b4c70a3dc6c6f88c67f90/6.12.0-124.55.1.el10_1.x86_64: Directory /boot/efi/349ff817715b4c70a3dc6c6f88c67f90/6.12.0-124.55.1.el10_1.x86_64 does not exist or is not accessible.
dracut[F]: Can’t write to /boot/efi/349ff817715b4c70a3dc6c6f88c67f90/6.12.0-124.56.1.el10_1.x86_64: Directory /boot/efi/349ff817715b4c70a3dc6c6f88c67f90/6.12.0-124.56.1.el10_1.x86_64 does not exist or is not accessible.
cp: error writing ‘/boot/initramfs-6.12.0-211.16.1.el10_2.0.1.x86_64.img.tmp’: No space left on device
dracut[F]: Creation of /boot/initramfs-6.12.0-211.16.1.el10_2.0.1.x86_64.img.tmp failed
cp: error writing ‘/boot/initramfs-6.12.0-211.18.1.el10_2.x86_64.img’: No space left on device
dracut[F]: Creation of /boot/initramfs-6.12.0-211.18.1.el10_2.x86_64.img failed

some of the images aren’t even found

rpm -q kernel
kernel-6.12.0-211.16.1.el10_2.0.1.x86_64
kernel-6.12.0-211.18.1.el10_2.x86_64

When using the --regenerate-all option, dracut will look for the files /lib/modules/*/modules.dep - maybe you have old /lib/modules directories that exist with a modules.dep file, but with no matching installed kernel ?

If I create a bogus kernel version directory under /lib/modules/ containing an empty modules.dep file, I get a similar ‘does not exist or is not accessible’ warning when running dracut --regenerate-all- although I don’t get the ‘No space left on device’ errors

What happens if you just run dracut -f ?

This is what I get but this is the current kernel that I am booting too because the .18 version of ther kernel can’t find the img file at boot

sudo dracut -f

cp: error writing ‘/boot/initramfs-6.12.0-211.16.1.el10_2.0.1.x86_64.img.tmp’: No space left on device
dracut[F]: Creation of /boot/initramfs-6.12.0-211.16.1.el10_2.0.1.x86_64.img.tmp failed

How much space do you have in /boot (df -h /boot) and what is the size of the files in /boot (ls -lh /boot) ?

Can you create an initramfs file elsewhere by running something like: dracut /tmp/initramfs

What is size of this /tmp/initramfs file ?

On a disturbingly regular basis, I run into this “all the time”. Whether it’s Rocky’s/EL’s dracut or Debian’s mkinitramfs, I end up removing the oldest kernel and retrying. That frees up enough space on /boot to have do its thing. To me, the installation defaults are inadequate, I usually override them with a 2GB ESP (/boot/efi) and a 2GB /boot. I know that doesn’t help you much now, but for the future, go nuts with space for those two areas during installations. Later on someone commented on the number of retained kernels, that too is a knob which can be turned so you don’t have to manually remove kernels then reattempt installation of the newest.

Do note how there are (usually) five files per kernel:
config, symvers, System.map, vmlinuz, and initramfs

In addition, there is a kdump version of initramfs for each kernel.
Those are unnecessary, unless one actually intends to resort to kdump to debug kernel failures.

Furthermore, there are vmlinuz-0-rescue and initramfs-0-rescue.
rpm -qa \*rescue\* should list a package that creates the rescue version.


lsblk -f and df -h /boot /boot/efi do show disk sizes.
du -d1 -h -x /boot and du -d1 -h /boot/efi do show disk usage in another way.

Thank you, I get the same no space on device error

I appreciate the conclusion and can agree.

These are my outputs

rpm -qa *rescue*
dracut-config-rescue-107-4.el10.x86_64

❯ sudo du -d1 -h -x /boot
1.1M /boot/extlinux
2.4M /boot/grub2
16K /boot/loader
606M /boot

45M /boot/efi/EFI
4.0K /boot/efi/System Volume Information
45M /boot/efi

The following has resolved it:

sudo dnf autoremove

sudo rm -f /boot/rescue

sudo rm -rf /var/crash/*

sudo dracut -f --regenerate-all