Bug 34546 - No detection, avoidance nor message that /boot get full during kernel install.
Summary: No detection, avoidance nor message that /boot get full during kernel install.
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-07 16:22 CEST by Morgan Leijström
Modified: 2026-01-10 21:41 CET (History)
3 users (show)

See Also:
Source RPM: drakxtools / urpmi, drakxtools-backend, bootloader-utils
CVE:
Status comment:


Attachments

Description Morgan Leijström 2025-08-07 16:22:11 CEST
Description of problem:

When installing kernels, it do not detect that /boot get full.
To the user, it looks like the process ends successfully.

In the log you find i.e:

[morgan@svarten ~]$ journalctl -b | grep 'No space left'
jul 28 22:26:36 svarten.tribun plasmashell[240543]: cp: error writing '/boot/initrd-6.12.39-desktop-1.stable.mga9.img': No space left on device
jul 28 22:27:30 svarten.tribun plasmashell[251350]: cp: error writing '/boot/initrd-6.6.100-desktop-1.mga9.img': No space left on device


How reproducible:
It have been like this forever i think, i got used to it...
Still it is serious.
Comment 1 katnatek 2025-08-09 06:01:54 CEST
Did you install remove old kernels ? 
Is just a workaround but is something
Comment 2 Morgan Leijström 2025-08-09 11:18:11 CEST
Regardless of anything else, any install errors should be reported to user.


rok only uninstalls kernels when it is run - manually or by cron.

Example: On my workstation I did not intend to do much kernel testing, but now I test all three standard flavours plus backport.  Updating brings in three or four new kernels. My half gig  /boot is about half full with four kernels, a full standard update of all and it fail.  So the standard setting of rok do not help.  That said having a separate /boot is not default install either.

Bottom line - report any fail to the user.
Comment 3 katnatek 2025-08-09 19:23:48 CEST
A simple test like

LC_ALL=C df /boot --output=avail|grep -v Avail 

and compare the value with the initrd image will help

LC_ALL=C before df is a mandatory to not complicate the command with the possible translations

LC_ALL=C df /boot --output=avail|grep -v Avail
  25G

df /boot --output=avail|grep -v Disp
  25G

In my system
Comment 4 Morgan Leijström 2025-08-09 21:35:04 CEST
Yes the tool should perform that test
On my system, separate /boot partition:

$ LC_ALL=C df /boot --output=avail
Avail
 216M
Comment 5 Morgan Leijström 2026-01-06 12:45:48 CET
Stupid me hit it again though I did not think so :(
Also I reported similar ten years ago Bug 18915...

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=18915

Comment 6 Giuseppe Ghibò 2026-01-06 13:26:34 CET
Time passes, a decade literally!

You need at least 1GB /boot or more when playing with cauldron kernels...

But now dracut emits the error about no spaces left? Maybe we should hightlight that error in "red" in a color terminal.

CC: (none) => ghibomgx

Comment 7 Morgan Leijström 2026-01-06 14:21:26 CET
/
 I did not intend to play with kernels on this machine...
Bought used, and put in a used small SSD, to have a "casual" laptop.
But because the keyboard on my old thinkpads are the nicest of all computers i own, it have become a favourite.

It was not enough to remove some elder kernels and run
  dracut --regenerate-all --force
-I had to remove and reinstall the last kernel. (both latest to be sure)
/

No normal user keep an eye of dracut lines scrolling by.

Dracut should *stop* with an *error message* when there is no room.
(maybe also remove any failed files)

It should not make entries in grub for failed kernel installs.

All our graphical tools should pop up a message, instead of now silently *hiding* any failure like everything went OK.

I cant even tell from system log afterwards if it had failed.
Comment 8 Giuseppe Ghibò 2026-01-06 16:31:18 CET
but what should the logic with dracut --regenerate-all process on errors? It regenerates all the initramfs, but should it stop at first fail of any partition full? Or should continue with other kernels? E.g. it would be better to not stop at first error. Because, for instance it could not only fail for disk full but also for other errors (e.g. a wrong config). Also it might fail on one kernel but not on others, and also as overwriting an initramfs of a sequence of a certain number of kernels, it could also free some space for other iniramfs (e.g. consider a previous image was wrong or huge for some reason, you overwrite and get smaller, so there could be free space for next kernels initramfs).
Comment 9 Bruno Cornec 2026-01-06 16:34:28 CET
So, without having looked at the code, shouldn't dracut on errors verify first whether there is enough room on the FS and if not, exit (as whatever type of operation it tries it will very probably fail), and if there is enough room, then emit the usual warning and on on ?

I guess this is an upstream bug, not Mageia specific right ?

CC: (none) => bruno

Comment 10 Morgan Leijström 2026-01-06 17:37:21 CET
Well dracut do spit out "error"..."no space left on device", i think our tools should act on "error", and display the while message in a popup.

Tell kernel did not get installed properly.

Recover in a sane way.
I.e debris cleaned up and no entry for it in grub.
I did not have enough patience today to check *why* i needed to reinstall kernels - but it was *not* enough to remove elder kernels and rerun dracut.

Yes maybe it should not *stop* on error, per reasoning from Giuseppe in Comment 8.

Around it all, optimally a check for space before, possibly a dialogue, optimally with option to try anyway.
Comment 11 Pascal Terjan 2026-01-09 18:52:57 CET
I believe this would help if installkernel failed:

Index: SPECS/kernel.spec
===================================================================
--- SPECS/kernel.spec	(revision 2308771)
+++ SPECS/kernel.spec	(working copy)
@@ -1982,9 +1982,9 @@
     fi
 fi
 %if %{versionednamingscheme}
-/sbin/installkernel %{kversion}-$kernel_flavour-%{buildrpmrel}
+/sbin/installkernel %{kversion}-$kernel_flavour-%{buildrpmrel} || exit 1
 %else
-/sbin/installkernel %{kversion}-$kernel_flavour-%{rpmrel}
+/sbin/installkernel %{kversion}-$kernel_flavour-%{rpmrel} || exit 1
 %endif
 pushd /boot > /dev/null
 %if %{versionednamingscheme}

However looking at the code it does not check for errors in many places where I believe it should:

    cp -f $vmlinuz $boot/vmlinuz-$version
    cp -f $map_file $boot/System.map-$version
[...]
    bootloader-config --kernel-version $version --initrd-options "$INITRDOPTS" $options

but anyway it does not fail when failing to rebuild an initrd, which I guess makes sense when the rebuild is to update bootsplash image but not when building a new one for the first time:

sub rebuild_initrd { 
    my ($kernel_version, $bootloader, $entry, $initrd) = @_;
    
    my $old = $::prefix . $entry->{initrd} . '.old';
    unlink $old;
    rename "$::prefix$initrd", $old; 
    if (!mkinitrd($kernel_version, $bootloader, $entry, $initrd)) {
        log::l("rebuilding initrd failed, putting back the old one");
        rename $old, "$::prefix$initrd";
    }
}

I guess this code could be made to fail if there is no .old to restore.

CC: (none) => pterjan

Giuseppe Ghibò 2026-01-10 21:41:04 CET

Source RPM: drakxtools / urpmi => drakxtools / urpmi, drakxtools-backend, bootloader-utils


Note You need to log in before you can comment on or make changes to this bug.