Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
johnramsden opened this issue Jul 31, 2017 · 15 comments
Closed

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

johnramsden opened this issue Jul 31, 2017 · 15 comments
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@johnramsden
Copy link
Member

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)
@johnramsden johnramsden changed the title Cannot create boot entry Cannot create efi boot entry - No space left on device Jul 31, 2017
@FRidh FRidh added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Aug 1, 2017
@domenkozar
Copy link
Member

what about ls -la /boot

@johnramsden
Copy link
Member Author

@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.

@johnramsden
Copy link
Member Author

johnramsden commented Aug 3, 2017

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

@emmanuelrosa
Copy link
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.

@cleverca22
Copy link
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

@emmanuelrosa
Copy link
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.

@johnramsden
Copy link
Member Author

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

@tokudan
Copy link
Contributor

tokudan commented Aug 29, 2017

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

@johnramsden
Copy link
Member Author

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

@wizeman
Copy link
Member

wizeman commented Sep 18, 2017

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.

@wizeman
Copy link
Member

wizeman commented Sep 18, 2017

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.

@johnramsden
Copy link
Member Author

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

@srghma
Copy link
Contributor

srghma commented Feb 3, 2018

@wizeman

[root@nixos:~]# rm /sys/firmware/efi/efivars/dump-*
rm: cannot remove '/sys/firmware/efi/efivars/dump-*': No such file or directory

my steps #34508 (comment)

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/20-03-uefi-installation-problem-vs-instructions/7783/1

@bqv
Copy link
Contributor

bqv commented Jul 13, 2020

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
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

No branches or pull requests

10 participants