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

Default kernel in nixos-19.03 doesn't find luks volume #60305

Closed
dmvianna opened this issue Apr 27, 2019 · 8 comments
Closed

Default kernel in nixos-19.03 doesn't find luks volume #60305

dmvianna opened this issue Apr 27, 2019 · 8 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: kernel 6.topic: nixos

Comments

@dmvianna
Copy link
Contributor

dmvianna commented Apr 27, 2019

Issue description

After switching from channel nixos-18.09 to nixos-19.03 and issuing

sudo nixos-rebuild switch --upgrade

udev can't find the volume where my operating system is.

Steps to reproduce

configuration.nix

  # Use the systemd-boot EFI boot loader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  
  # decrypt LUKS partition
  boot.initrd.luks.devices = [
    {
      name = "root";
      device = "/dev/nvme0n1p2";
      preLVM = true;
    }
  ];

  boot.extraModulePackages = [
    config.boot.kernelPackages.broadcom_sta
  ];
  boot.initrd.kernelModules = [
    "wl"
  ];

command

sudo nixos-rebuild switch --upgrade

Note that the problem was solved by pinning the kernel to an older version

  # Pin kernel
  boot.kernelPackages = pkgs.linuxPackages_4_14;

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.113, NixOS, 19.03.172361.cf3e277dd0b (Koi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2.2`
 - channels(dmvianna): `""`
 - channels(root): `"nixos-19.03.172361.cf3e277dd0b, nixos-hardware"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

The kernel that doesn't boot is Linux kernel 4.19.36. On 18.09 I was using Linux kernel 4.14.105.

@FRidh
Copy link
Member

FRidh commented Apr 27, 2019

Related #60158

@FRidh
Copy link
Member

FRidh commented Apr 27, 2019

Also related #59384

@Mic92
Copy link
Member

Mic92 commented Jul 17, 2019

Do you have nvme in boot.initrd.availableKernelModules
or in other words, would nixos-generate-config result in a new
hardware-configuration.nix i.e. drivers are missing to load your nvme drive?

$ nix repl '<nixpkgs/nixos>'
nix-repl> config.boot.initrd.availableKernelModules
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "i915" "md_mod" "raid0" "raid1" "raid10" "raid456" "ext2" "ext4" "ahci" "sata_nv" "sata_via" "sata_sis" "sata_uli" "ata_piix" "pata_marvell" "sd_mod" "sr_mod" "mmc_block" "uhci_hcd" "ehci_hcd" "ehci_pci" "ohci_hcd" "ohci_pci" "xhci_hcd" "xhci_pci" "usbhid" "hid_generic" "hid_lenovo" "hid_apple" "hid_roccat" "hid_logitech_hidpp" "hid_logitech_dj" "pcips2" "atkbd" "i8042" "rtc_cmos" ]

This is just a wild speculation. I don't know if driver module names have changed during the kernel upgrade. However you can check if a current installation iso with the same kernel is able to detect your nvme drive.

@dmvianna
Copy link
Contributor Author

dmvianna commented Jul 17, 2019

Yep, I have nvme in my current (pinned) kernel. I can't be sure about the one that doesn't boot, though. Should I add it manually and test?

nix-repl> config.boot.initrd.availableKernelModules
[ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" "md_mod" "raid0" "raid1" "raid10" "raid456" "ext2" "ext4" "dm_mod" "dm_crypt" "cryptd" "input_leds" "aes" "aes_generic" "blowfish" "twofish" "serpent" "cbc" "xts" "lrw" "sha1" "sha256" "sha512" "af_alg" "algif_skcipher" "aes_x86_64" "ecb" "ahci" "sata_nv" "sata_via" "sata_sis" "sata_uli" "ata_piix" "pata_marvell" "sd_mod" "sr_mod" "mmc_block" "uhci_hcd" "ehci_hcd" "ehci_pci" "ohci_hcd" "ohci_pci" "xhci_hcd" "xhci_pci" "usbhid" "hid_generic" "hid_lenovo" "hid_apple" "hid_roccat" "hid_logitech_hidpp" "hid_logitech_dj" "pcips2" "atkbd" "i8042" "rtc_cmos" ]

EDIT loading it at boot time made no difference. :(

@dmvianna
Copy link
Contributor Author

Good news! I successfully booted pkgs.linuxPackages_4_9 after running

# nixos-generate-config

I had /etc/nixos/hardware-configuration.nix in an editor window and could see it that command altered it significantly. The obvious change was in

boot.initrd.kernelModules = [ "dm-snapshot" ];

which wasn't there before.

Seems to me this should be described in Chapter 4. Upgrading NixOS?

@dmvianna dmvianna reopened this Jul 18, 2019
@Mic92
Copy link
Member

Mic92 commented Jul 22, 2019

@dmvianna This is a good idea. It might be also necessary, when upgrading a kernel within the same release.

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@Atemu
Copy link
Member

Atemu commented Nov 30, 2022

I don't think this is relevant anymore.

@Atemu Atemu closed this as completed Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: kernel 6.topic: nixos
Projects
None yet
Development

No branches or pull requests

4 participants