-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
grub efi fails on latest nixos-unstable #61718
Comments
Hi gnidorah, A See #27821 for more info. This is how I restored my system:
This is all I had to do. However, for now I also disabled I hope this helps, |
@TomSmeets Unfortunately its not the case. My config is the following: fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/58D0-2B0F";
fsType = "vfat";
options = [ "defaults,noauto" ];
};
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.grub = {
efiSupport = true;
device = "nodev";
}; So fat partition only stores
While system partition (/boot folder) stores everything else so I never run into #23926 |
Also a small hint. If you use recent NixOS installation usb stick, then you could boot from it, choose refind in menu, then choose bootx64 entry it will load directry to your nixos installation, so there is no real need for nixos-enter tricks |
Done bisect. This is the commit that broke my layout: |
I have this error as well. I had to boot from a stick and rescue my system about a week ago. |
Follow up: If you run into this issue in the future follow these steps:
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = "/boot";
};
|
@BadDecisionsAlex
Sorry, but no. I want to keep EFI partition as small as possible and I also want to run garbage collection as seldom as possible. For now I just reverted commit df4d0fa locally TBH I don't understand why we are pulling release candidates for such critical components as boot loaders. |
@gnidorah I completely agree that our repo should roll back. If you have other notes about my rescue process please let me know. I was just hoping to leave breadcrumbs for anybody else who bumps into the issue; but I am by no means an expert here. |
@volth Once there, I will test it using following configuration https://nixos.wiki/wiki/Bootloader#Keeping_kernels.2Finitrd_on_the_main_partition |
Tried grub 2.04 locally and it didn't work too. I'm leaving this issue open, but since there is now a solution for out of space problem for systemd-boot #23926 (comment) I've switched to that |
I use grub on EFI and can't repro this bug. My |
I just did a fresh install on unstable (on ZFS root). But essentially what was on the wiki worked:
partition scheme
And boot with grub efi seems to work fine |
I switched yesterday from 19.03 to the 19.09-release channel on my tablet and the boot now complains with the same message. This is one of those x64 tablets that has a i686 EFI and thus requires In the meantime, I'm booting via 32-bit USB grub with
I tried the What does grub 2.04 offer? Couldn't it just be rolled back to 2.02 in the release-19.09 branch? |
Same problem on debian: |
I fixed my boot by just moving away all files in /boot and |
I just had the same issue after switching to 19.09 and switching back to 19.03. Timeline:
I don't use EFI. Solved it by reinstalling the bootloader with a usb stick. |
In order to avoid breaking boots on the 19.09 release, I'm in favour of rolling back to 2.02 on 19.09 before the release (but leaving 2.04 on master). I'm unsure how to address this problem in general. A naive solution based on my incomplete understanding of the issue seems to me to have versioning for grub's module directories, e.g. have |
just tried again to upgrade to unstable and again get the $ nixos-version
19.09.2370.e10c65cdb35 (Loris)
$ sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
$ sudo nixos-rebuild switch --upgrade
$ reboot |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/go-no-go-meeting-nixos-20-03-markhor/6495/19 |
That was probably already discussed somewhere, but: Is there any problem with rolling back to 2.02 again? That version works, right? elementary OS actually still uses 2.02 (5.1.2 release from 2020-02-07) also Fedora 31 from 2019-10-29, but even the two last debian releases use 2.04. but having a broken bootloader is worse than using older versions than debian We could also implement this logic IF efiSupport = true; THEN package 2.02 ELSE 2.04 |
True, or it could be based on stateVersion. |
This reverts commit 8ba94a8. See NixOS#61718 for rationale. (cherry picked from commit 4eb9725)
This reverts commit df4d0fa. See NixOS#61718 for rationale. (cherry picked from commit 862f05c)
I just upgraded 19.09 -> 20.03 this morning and ran into this issue. I attempted to reinstall the bootloader using the little script on https://nixos.wiki/wiki/Bootloader, but no luck. Here's my relevant config: |
Still trying to restore my system... I noticed that |
@emptyflask in case it helps: Workaround for booting with GRUB
|
That actually does help, I was able to boot into my normal system using rEFInd. Thanks! |
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931896#10 offers some explanation |
So to summarize the issue above, there are 3 components:
The issue boils down to your firmware and your OS disagreeing about where the grub core image is. The firmware points to the grub core image. The core image loads modules. The interface between core and modules is not stable. If your OS is installing core image and modules to location A, but your firmware is loading the core image from location B, then at some point the (old, non-updated) core image at location B is not able to load the (new, updated) modules at location A. The problem has always been there (mismatched core and modules), but you hadn't noticed until the interface between the two broke. |
It does appear that there might be some duplication in (I've omitted a bunch of modules and Microsoft-related things)
|
If you're not dual-booting, it should be safe to remove all of |
@lheckemann I removed all of
If I continue i end up in kernel panic. Update1: Found an old USB with nixos-19.03 with GRUB 2.02. Seems like the installer is working. rEFInd aint working. This means i have to totally fresh install nixos to upgrade it then to 20.03. which is not the optimal option, but ok! Keep you updated. Update2: This actually could be an option too: https://gist.github.com/chris-martin/4ead9b0acbd2e3ce084576ee06961000 |
@saggzz sorry about that! Do you have either or both of As for reinstalling: you don't have to do a totally fresh install. You can boot the installation ISO, mount the filesystems, and run EDIT: you can also get a shell in the initramfs to try and mount your root filesystem manually by passing
|
@saggzz when I had problems with GRUB, I followed the steps here to re-install. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-grub-doesnt-see-windows/6811/4 |
@lheckemann thank you for the hints. Either |
so I finally now have it booting normally and all I did afaik is change Oh I also changed the efi mount point around and I think that may have cleaned up the efi directory, though it's now back to where I started. |
I do confirm that grub2 2.04 boots NixOS in the following scenario:
Notably, I was unable to boot with grub2 2.02 until adding the override. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/good-filesystem-for-the-nix-store/3566/10 |
Today I got this upgrading to
with no success until I removed the content of Does this kind of error happen also in |
Glad to hear removing all of |
Thank you again @lheckemann In fact, after recreating it, I had to fix it manually (it created EFI/EFI/etc). Not sure if this is strictly related to the issue or I just messed it during attempts :) |
Issue description
After upgrading bootloader breaks with
Steps to reproduce
Technical details
"x86_64-linux"
Linux 4.19.44, NixOS, 19.09.git.2439b30 (Loris)
yes
yes
nix-env (Nix) 2.2.2
The text was updated successfully, but these errors were encountered: