Skip to content

Cannot create efi boot entry - No space left on device #27821

Closed

Description

@johnramsden

Issue description

This is the second time this is occurring to me when trying to install. I keep getting an error message saying there's no room on my efi partition, but I i'm giving it a new one gigabyte fat32 partition which is larger than recommended. I thought it might be something to do with my Nvram, but it is only occurred so far when using the NixOS installer.

Here's the output I get:

nixos-install --root /mnt

building the system configuration...
copying NixOS/Nixpkgs sources...
finalising the installation...
Created "/boot/EFI".
Created "/boot/EFI/systemd".
Created "/boot/EFI/BOOT".
Created "/boot/loader".
Created "/boot/loader/entries".
Copied "/nix/store/xckqiwxg8la4p7ln22z7ljalbq1x70xn-systemd-232/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".
Copied "/nix/store/xckqiwxg8la4p7ln22z7ljalbq1x70xn-systemd-232/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".
Failed to create EFI Boot variable entry: No space left on device
Traceback (most recent call last):
  File "/nix/store/w9h4ljvqdff1kdd9asjql7z01bc3mf9q-systemd-boot-builder.py", line 149, in <module>
    main()
  File "/nix/store/w9h4ljvqdff1kdd9asjql7z01bc3mf9q-systemd-boot-builder.py", line 134, in main
    subprocess.check_call(["/nix/store/xckqiwxg8la4p7ln22z7ljalbq1x70xn-systemd-232/bin/bootctl", "--path=/boot", "install"])
  File "/nix/store/r7qpc32yr09l9a0d5y3b8i84kw5phx4p-python3-3.5.3/lib/python3.5/subprocess.py", line 271, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/xckqiwxg8la4p7ln22z7ljalbq1x70xn-systemd-232/bin/bootctl', '--path=/boot', 'install']' returned non-zero exit status 1

Steps to reproduce

Mount all my partitions, and install. The system is a UEFI system of course.

Create a 1GiB esp, mount to /boot

gdisk /dev/sdf
Command (? for help): n
Partition number (5-128, 17.03-v2 5):
First sector (34-488397134, 17.03-v2 = 225445888) or {+-}size{KMGTP}:
Last sector (225445888-488397134, 17.03-v2 = 488397134) or {+-}size{KMGTP}: +1G
Hex code or GUID (L to show codes, Enter = 8300): ef00
Changed type of partition to 'EFI System'

Command (? for help): w

Format

mkfs.fat -F32 /dev/sdf1
mount /dev/sdf1 /mnt/boot

Install.

Technical details

Relevant configuration:

  hardware.cpu.intel.updateMicrocode = true;

  boot = {
    tmpOnTmpfs = true;
    cleanTmpDir = true;
    loader = { # Bootloader
      efi.canTouchEfiVariables = true;
      efi.efiSysMountPoint = "/boot";
      systemd-boot.enable = true;
    };

    initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci"
                                      "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
  • System: (NixOS: 17.03.1482.1b57bf274a (Gorilla))
  • Nix version: (nix-env (Nix) 1.11.11)
  • Nixpkgs version: ("17.03.1482.1b57bf274a")
  • Sandboxing enabled: (true)

Activity

  1. changed the title [-]Cannot create boot entry[/-] [+]Cannot create efi boot entry - No space left on device[/+] on Jul 31, 2017
  2. added
    6.topic: nixos
    on Aug 1, 2017
  3. domenkozar commented on Aug 1, 2017

    @domenkozar
    Member

    what about ls -la /boot

  4. johnramsden commented on Aug 2, 2017

    @johnramsden
    MemberAuthor

    @domenkozar It lists the files normally, and there's plenty of space. Maybe it's my motherboard, I found some information that talked about if the nvram is messed up it can cause this issue. I tried seeing if removing the variables with efibootmgr would fix the issue but after I removed all of them it's still said there was no space.

    I reflashed my Motherboard BIOS which should clear the NVRAM and I'm going to see if attempting an install with something else will work, or if it will cause the same problem.

  5. johnramsden commented on Aug 3, 2017

    @johnramsden
    MemberAuthor

    @domenkozar So, after attempting an install on Arch, I was able to create entries which makes me think perhaps this is a NixOS problem.

  6. emmanuelrosa commented on Aug 4, 2017

    @emmanuelrosa
    Contributor

    Although the error suggests it's out of space on /boot, have you checked RAM usage during installation? The NixOS live CD uses a nix store with read-only (on CD media) and read-write (RAM) layers. Everything gets build in this nix store before being copied to /mnt/nix/store, so if you try to install a lot of packages nixos-install it will eat away at your RAM.

  7. cleverca22 commented on Aug 4, 2017

    @cleverca22
    Contributor
    subprocess.CalledProcessError: Command '['/nix/store/xckqiwxg8la4p7ln22z7ljalbq1x70xn-systemd-232/bin/bootctl', '--path=/boot', 'install']' returned non-zero exit status 1
    

    i think its the efi variable filesystem thats full, not the /boot filesystem
    sounds like a firmware problem

  8. emmanuelrosa commented on Aug 4, 2017

    @emmanuelrosa
    Contributor

    I was referring to the RAM-based Nix store used by the Live CD being full, not /boot. The "No space left on device" error can be misleading.

    If you suspect the EFI variable storage is full, you can try efi.canTouchEfiVariables = false in your config.

    When you installed Arch, did you use GRUB2 as the EFI boot manager or systemd-boot? The later is what NixOS uses.

  9. johnramsden commented on Aug 5, 2017

    @johnramsden
    MemberAuthor

    @emmanuelrosa I used systemd-boot, same as on NixOS.

  10. tokudan commented on Aug 29, 2017

    @tokudan
    Contributor

    @johnramsden was there any progress with the setting that emmanuelrosa suggested?

  11. johnramsden commented on Aug 29, 2017

    @johnramsden
    MemberAuthor

    @tokudan No, i'll give it a try when I get the chance.

  12. wizeman commented on Sep 18, 2017

    @wizeman
    Member

    FYI, I've been running into this problem for some time, and I also think this is a firmware problem. The workaround for me was to run this command whenever I receive the "no space left on device" error:

    rm /sys/firmware/efi/efivars/dump-*

    If you then try again nixos-install (or nixos-rebuild switch) it should work fine.

  13. wizeman commented on Sep 18, 2017

    @wizeman
    Member

    BTW, I found the above workaround in the following Arch wiki page: https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface

    Specifically, it says:

    If any userspace tool is unable to modify efi variables data, check for existence of /sys/firmware/efi/efivars/dump-* files. If they exist, delete them, reboot and retry again.

    Although for me, it isn't necessary to reboot.

  14. johnramsden commented on Sep 18, 2017

    @johnramsden
    MemberAuthor

    Interesting @wizeman, I'll give that a try when I end up doing an install on the computer I was having a problem on. For now I guess I'll close this issue, and update when I end up having time to install NixOS again

  15. nixos-discourse commented on Jun 21, 2020

    @nixos-discourse
  16. bqv commented on Jul 13, 2020

    @bqv
    Contributor

    wizeman's command fixed this for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: nixos

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions