How to manage the size of the /boot partition

Sorry to necrobump this, but coming across this several times in the past weeks. But how do you guys manage the size of the /boot partition? Because the default 500M, doesn’t even let me have more than two versions of the kernel.

❯ ls -lah /boot/kernels
total 483M
drwxr-xr-x 2 root root 8.0K Jul 24 12:18 .
drwxr-xr-x 5 root root  16K Dec 31  1969 ..
-rwxr-xr-x 1 root root  76M Jul 24 12:18 ankpypvb1v17skaf1x9yv9p3cwjv991q-initrd-linux-6.12.39-initrd.tmp
-rwxr-xr-x 1 root root 192M Jul 21 20:30 h2a9qyqy72qz1hvg0bjpjk2mbpv7pi6m-initrd-linux-6.12.36-initrd
-rwxr-xr-x 1 root root 192M Jul 12 13:54 k7j5kzk7mdqi033wl03q8d7mnlwm43h1-initrd-linux-6.12.36-initrd
-rwxr-xr-x 1 root root  12M Jul 12 13:54 zgqxpykja3qfqcx3l2y3zrg505g44l8z-linux-6.12.36-bzImage
-rwxr-xr-x 1 root root  12M Jul 24 12:18 zhzgknmb62fclc0yd2hl24br7mhmfmbk-linux-6.12.39-bzImage

Is it normal for those to be 192M long? Should I repartition my system to be a larger boot partition to avoid coming across this so often?

Same for me when using unstable branch, I plan to do manual partitioning in a future reinstall (since I’m not sure how to increase the existing partition without breaking my system ^^).

I checked and unfortunately calamares (the installer used by NixOS) don’t allow to resize the partition when using “erase disk” option.

1 Like

Using alternatives than the calamares installer is the easiest here.

One can use disko for declarative disk management, or just the normal manual install from the iso (which has serves a long time a good job before people added calamares).

[rant about adding calamares, no need to continue reading here]

I personally dont like our calamares images, as i have the feeling its not well maintained and dont serve sane defaults (like your example here) and IMHO it gives a very wrong impression to the new users how to handle nixos. If one wants to install nixos they should either already be very familar with consoles or become familiar very very fast.

Hiding the installation behind a graphical tooling that does a bad (IMHO) job is a very big trap.

Its the same to throw users into a gentoo system with a UI and then let them tinker with USE-Flags…

Its like giving a shotgun to a person and then wondering why they shoot their feet.

Providing a graphical live medium is a different story, so that one can easily research questions they dont understand without aborting their installation customizations, but that was already a thing before calamares.

Your initrd is unusually large. I think that’s part of the reason you are running into space issues.

I have initrd networking set up with OpenSSH and mine is generally in the 25-35 MiB region.

2 Likes

I was thinking the same thing. Because when I first install this system I got like several generations without any issues until some change I introduced. How would I come to troubleshoot why is it this large?

Anything below boot.initrd might be relevant.

The dracut package provides a program called lsinitrd that you can use to see what’s in those initrd files. Normally, it’s a very small subset of nixos, but yours has a lot of extra stuff in it. Usually this is caused by using one of the boot.initrd.* options to refer to a program by its regular path rather than copying it with copy_bin_and_libs in a boot.initrd.extraUtilsCommands script. Using its regular path copies its entire nix closure instead of just the program.

1 Like

Hey, thanks for the recommendation. Seems like nvidia drivers are the culprit of the size increase:

-r--r--r-- 1 root root 28.14M Dec 31 1969 nix/store/1y8qmgnbmci3b8wygn4s2mvm4m8myqam-linux-6.12.39-modules-shrunk/lib/firmware/nvidia/575.64.03/gsp_tu10x.bin
-r--r--r-- 1 root root 58.91M Dec 31 1969 nix/store/1y8qmgnbmci3b8wygn4s2mvm4m8myqam-linux-6.12.39-modules-shrunk/lib/modules/6.12.39/misc/nvidia-uvm.ko
-r--r--r-- 1 root root 71.09M Dec 31 1969 nix/store/1y8qmgnbmci3b8wygn4s2mvm4m8myqam-linux-6.12.39-modules-shrunk/lib/firmware/nvidia/575.64.03/gsp_ga10x.bin
-r--r--r-- 1 root root 149.30M Dec 31 1969 nix/store/1y8qmgnbmci3b8wygn4s2mvm4m8myqam-linux-6.12.39-modules-shrunk/lib/modules/6.12.39/misc/nvidia.ko

I guess the only thing I can do it’s to reinstall with a bigger boot partition or better yet use btrfs.