Lsblk: /dev/mapper/no*[0-9] with boot.loader.grub.useOSProber = true

[eyome@nixos:~]$ sudo nixos-rebuild  switch
building Nix...
building the system configuration...
updating GRUB 2 menu...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
lsblk: /dev/mapper/no*[0-9] : n'est pas un périphérique bloc
lsblk: /dev/mapper/raid*[0-9] : n'est pas un périphérique bloc
lsblk: /dev/mapper/disks*[0-9] : n'est pas un périphérique bloc
activating the configuration...
setting up /etc...
reloading user units for eyome...
setting up tmpfiles
the following new units were started: libvirtd.service

After I commented this line:

boot.loader.grub.useOSProber = true; 

sudo nixos-rebuild switch works without problem, why?

Wait, it doesn’t seem to solve completely the problem as sudo nixos-rebuild --upgrade switch doesn’t create a new grub line :grimacing:

[eyome@nixos:~]$ sudo nix-env -p /nix/var/nix/profiles/system --list-generations 
 113   2023-03-25 21:42:42   
 114   2023-03-28 21:42:26   
 115   2023-03-30 22:01:52   (current)

[eyome@nixos:~]$ sudo nixos-rebuild --upgrade switch
[sudo] Mot de passe de eyome : 
unpacking channels...
building Nix...
building the system configuration...
updating GRUB 2 menu...
activating the configuration...
setting up /etc...
reloading user units for eyome...
setting up tmpfiles
the following new units were started: libvirtd.service

[eyome@nixos:~]$ sudo nix-env -p /nix/var/nix/profiles/system --list-generations 
 113   2023-03-25 21:42:42   
 114   2023-03-28 21:42:26   
 115   2023-03-30 22:01:52   (current)

is not an error, it is displayed during normal operation of os-prober. Actually I see no errors in the text you pasted. Can you describe exactly the problem you are trying to solve?

Hi symphorien, thank you for your response!

Sorry, I was not clear in my description; let me try to take a new start :stuck_out_tongue:

For 2 or 3 days, when I run “sudo nixos-rebuild switch” or “nixos-rebuild --upgrade switch”, it does not create a new entry in my grub, and neither no new line in my list generation.

When I run these commands, I though the line “lsblk: /dev/mapper/no*[0-9]” after os-prober suspicious, so I commented the line “boot.loader.grub.useOSProber = true;” in my configuration.nix.
Then, the line “lsblk: /dev/mapper/no*[0-9]” disapeared when I run nixos-rebuild and it created a new grub entry as expected.
I though the problem bypassed…

BUT, when I try to reboot with these generations, I have a black screen with just a prompt not blinking.
All my new generations bring me a black screen…

Here is my configurations.nix:

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

#let
#  nix-software-center = (import (pkgs.fetchFromGitHub {
#    owner = "vlinkz";
#    repo = "nix-software-center";
#    rev = "0.1.1";
#    sha256 = "0frigabszyfkphfbsniaa1d546zm8a2gx0cqvk2fr2qfa71kd41n";
#  })) {};
#in


{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      ./nvidia.nix
    ];

  # Bootloader.
  boot.loader.grub.enable = true;
  boot.loader.grub.device = "/dev/sda";
#  boot.loader.grub.useOSProber = true;
 
  # Enable ntfs partition
  boot.supportedFilesystems = [ "ntfs" ];

  system.fsPackages = [ pkgs.ntfs3g ];
  fileSystems."/mnt/Commune" =
    { device = "/dev/disk/by-uuid/688BFB195753AE87";
      fsType = "ntfs3";
      options = ["force" "rw" "uid=1000" "nofail"];
    };

  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "Europe/Paris";

  # Select internationalisation properties.
  i18n.defaultLocale = "fr_FR.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "fr_FR.UTF-8";
    LC_IDENTIFICATION = "fr_FR.UTF-8";
    LC_MEASUREMENT = "fr_FR.UTF-8";
    LC_MONETARY = "fr_FR.UTF-8";
    LC_NAME = "fr_FR.UTF-8";
    LC_NUMERIC = "fr_FR.UTF-8";
    LC_PAPER = "fr_FR.UTF-8";
    LC_TELEPHONE = "fr_FR.UTF-8";
    LC_TIME = "fr_FR.UTF-8";
  };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;

  # Configure keymap in X11
  services.xserver = {
    layout = "fr";
    xkbVariant = "";
  };

  # Configure console keymap
  console.keyMap = "fr";

  # Enable CUPS to print documents.
  services.printing.enable = true;
  services.avahi.enable = true;
  services.avahi.nssmdns = true;
  # for a WiFi printer
  services.avahi.openFirewall = true;

  # Enable scanner
  services.saned.enable = true;
  hardware.sane.enable = true;
  hardware.sane.openFirewall = true;
  services.ipp-usb.enable = true;
  hardware.sane.extraBackends = [ pkgs.sane-airscan ];

  # Enable sound with pipewire.
  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.eyome = {
    isNormalUser = true;
    description = "eyome";
    extraGroups = [ "networkmanager" "wheel" "scanners" "lp" ];
    packages = with pkgs; [
      amberol
      bottles
      curtail
      dino
      drawing
      firefox
      fragments
      fuse
      gnomeExtensions.gsconnect
      gnome.gnome-boxes
      gnome.gnome-software
      gnome.gnome-tweaks
      kodi
      libreoffice-fresh
      mousai
      neofetch
      nix-diff
      nixos-option
#      nix-software-center
      noto-fonts-emoji
      ntfs3g
#      rustdesk
      sane-airscan
      shortwave
      tangram
      ungoogled-chromium
    ];
  };

  # Enable Flatpak
  services.flatpak.enable = true;

  # Gnome paquets exlusion
  environment.gnome.excludePackages = [ pkgs.gnome-tour pkgs.gnome.geary ];
  environment.systemPackages = [
  ];

  # Others paquets exlusion 
  services.xserver.excludePackages = [ pkgs.xterm ];

  # Enable virtualisation
  virtualisation.libvirtd.enable = true;

  # Enable automatic login for the user.
  services.xserver.displayManager.autoLogin.enable = true;
  services.xserver.displayManager.autoLogin.user = "eyome";

  # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
  systemd.services."getty@tty1".enable = false;
  systemd.services."autovt@tty1".enable = false;

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # Enable OpenGL for 32-bit programs such as in Wine
  hardware.opengl.driSupport32Bit = true;

  # NVIDIA drivers
  hardware.nvidia.modesetting.enable = true;
  hardware.opengl.enable = true;

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "22.11"; # Did you read the comment?

}

Oooook, I am totally lost :sweat_smile:

I just run nixos-rebuild --upgrade switch, it performed without problems and I succeeded to loggin with this generation… Whereas my 5 or so previous tests created a generation reaching a black screen.
I really don’t know what happened.

Lets considerate it as ““Solved””, I guess :sweat_smile: