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

grub: enable copyKernels by default #68187

Closed
wants to merge 1 commit into from
Closed

Conversation

jb55
Copy link
Contributor

@jb55 jb55 commented Sep 6, 2019

When using filesystems such as ZFS, grub tries to directly access the
root drive to get the kernel. NixOS uses lots of hardlinks and grub
can have a problem reading that, resulting in messages such as:

Error: external pointer tables not supported
Error: you need to load the kernel first.

To avoid this issue, copy the kernel to /boot by default. This is how
it's done in gummiboot and probably other bootloaders.

Signed-off-by: William Casarin jb55@jb55.com

Motivation for this change

My system broke, I want to prevent that from happening to other people.

Fixes #60902

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @spinus @CMCDragonkai @alyssais @spacekookie @fadenb @caadar

When using filesystems such as ZFS, grub tries to directly access the
root drive to get the kernel. NixOS uses lots of hardlinks and grub
can have a problem reading that, resulting in messages such as:

  Error: external pointer tables not supported
  Error: you need to load the kernel first.

To avoid this issue, copy the kernel to /boot by default. This is how
it's done in gummiboot and probably other bootloaders.

Signed-off-by: William Casarin <jb55@jb55.com>
@vcunat
Copy link
Member

vcunat commented Sep 6, 2019

I wonder if it's a bit of overkill to change default for everyone. All other common filesystems should be fine AFAIK.

@andir
Copy link
Member

andir commented Sep 6, 2019

Usually that option is auto-detected just fine.

I am using ZFS with the following layout:

nvme0n1                                                                 259:0    0   477G  0 disk  
├─nvme0n1p1                                                             259:1    0   780M  0 part  /boot/EFI
├─nvme0n1p2                                                             259:2    0   1.1G  0 part  
│ └─boot                                                                254:0    0   1.1G  0 crypt /boot
├─nvme0n1p3                                                             259:3    0  15.3G  0 part  
│ └─dev-disk-…                                                          254:2    0  15.3G  0 crypt [SWAP]
└─nvme0n1p4                                                             259:4    0 459.8G  0 part  
  └─root                                                                254:1    0 459.8G  0 crypt 

Both /boot and the zfs pool have their own luks container. /boot/EFI is really just the EFI binaries. I have copies of the kernels in /boot/kernels without having to set the option.

@jb55
Copy link
Contributor Author

jb55 commented Sep 6, 2019

Hmm I'm wondering how this error could happen then if it's auto-detected, perhaps it's no longer an issue? I ran into it awhile ago.

I also was thinking to set this to true on zfs systems, but I wasn't sure how to do that.

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

Successfully merging this pull request may close these issues.

copyKernels should be enabled with ZFS or else grub can break
3 participants