Skip to content

When /boot is full, system rebuilds fail #23926

@joepie91

Description

@joepie91

Issue description

When the /boot partition is entirely full (eg. when old generations have not been removed for a long time), any kind of nixos-rebuild command will fail if a new kernel is attempted to be installed.

Deleting old generations and garbage-collecting does not fix the issue, because garbage collection doesn't touch the /boot partition, and nixos-rebuild will only try to remove obsolete images after having placed the new initrd in /boot. Since it's full, the new image cannot be copied over:

cannot copy /nix/store/8i1ixqycplb4wc812wkxxf432424jxh5-initrd/initrd to /boot/kernels/8i1ixqycplb4wc812wkxxf432424jxh5-initrd-initrd.tmp
warning: error(s) occurred while switching to the new configuration

... which means the "remove old images" routine never occurs, and the user is stuck.

I've worked around this by manually moving a very old image out of the /boot partition into /root, then running nixos-rebuild boot, then moving back the moved image after cleanup and running nixos-rebuild boot again to ensure that it wasn't a necessary image after all.

Steps to reproduce

  1. Have a /boot with no space left.
  2. Try to rebuild the system with a new kernel build.

Technical details

  • System: 16.09.1836.067e66a (Flounder)
  • Nix version: nix-env (Nix) 1.11.7
  • Nixpkgs version: 16.09.1836.067e66a

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions