How can I clean up /boot, without a reboot

I have garbage cleaned, but I imagine /boot needs a reboot?

df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3,2G     0  3,2G   0% /dev
tmpfs            32G  149M   32G   1% /dev/shm
tmpfs            16G  7,8M   16G   1% /run
tmpfs            32G  720K   32G   1% /run/wrappers
/dev/dm-1       220G   70G  139G  34% /
/dev/sda1       511M  511M     0 100% /boot
tmpfs           6,3G   41M  6,3G   1% /run/user/1000
//thunar/share  952G  172G  780G  19% /home/b0ef/mnt/thunar-share
[b0ef@ximian:~]$

I can’t build anything, cause it needs space on /boot, but I don’t want to reboot.

Any pointers as to what I can do?:wink:

This is a long-standing nixos-rebuild bug: When /boot is full, system rebuilds fail · Issue #23926 · NixOS/nixpkgs · GitHub

What you need to do in this case is to manually remove one or two old kernel+initrds that were part of the GC’d generations.

Then you can run nixos-rebuild boot again. It’ll first copy over the current generation’s kernel+initrd and then clear out the rest of the GC’d generations’ files from /boot/ automatically.

3 Likes