Problem installing 20.03: Failed to check file system type of "/boot"

Hi,

tldr; nixos-install fails with:

Failed to check file system type of “/boot”: No such file or directory

I think I’ve been through this install 30 times yesterday and today and I still haven’t gotten things to work. But I think I’m close. To be sure that I haven’t missed anything I’d like to share step by step everything that I’ve done:

Create bootable usb drive

  1. Download nixos graphical live cd from here
  2. Use rufus on the windows laptop to create a bootable gpt&uefi drive

Here’s a screenshot to verify those settings in rufus:

Make the Dell laptop ready

  1. Boot into BIOS
  2. Disable secure boot
  3. Make sure the boot mode is UEFI

(try to) Install nixos

  1. Start the laptop and hit F12 to open the boot menu
  2. Select “UEFI BOOT”: “UEFI: SanDisk, Partition 1” - this is your usb drive
  3. Select the first option in the list (“NixOS 20.03.1619.ab3adfe1c76 Installer”)

Picture:

  1. The Plasma display manager opens
  2. Connect to your wifi
  3. Open system settings → input devices → keyboard → layouts → change keyboard layout
  4. Open Konsole
  5. sudo su
  6. Verify that we’re in UEFI: [ -d /sys/firmware/efi/efivars ] && echo "UEFI" || echo "fail" - it prints “UEFI”
  7. gdisk /dev/nvme0n1
    • o to create a new GPT partition table
    • n to create a partition
      partition number: 1
      first sector: (just hit enter)
      last sector: write “+512M” and hit enter
      hex code: EF00
    • n to create a partition
      partition number: 2
      first sector: (just hit enter)
      last sector: (just hit enter)
      hex code: 8E00
    • w to write the changes
  8. See what the world looks like: lsblk

Picture:

  1. Setup encryption:
    a. Format the partition: cryptsetup luksFormat /dev/nvme0n1p2 and select a password
    b. Open the formatted partition: cryptsetup luksOpen /dev/nvme0n1p2 nvme0n1p2-crypt and enter the password

  2. See what the world looks like: lsblk.
    You should see the crypt disk under nvme0n1 → nvme0n1p2 → nvme0n1p2-crypt.

Picture:

  1. LVM stuff:
    a. Initiate a physical volume to be used by LVM: pvcreate /dev/mapper/nvme0n1p2-crypt
    b. Create a volume group: vgcreate vgnixos /dev/mapper/nvme0n1p2-crypt
    c. Create a swap volume: lvcreate -C y -L 10G -n swap vgnixos
    d. Create a volume for the rest of the space: lvcreate -l 100%FREE -n nixos vgnixos
  2. See what the world looks like: lsblk

Picture:

  1. mkfs.vfat -n BOOT /dev/nvme0n1p1 to format the boot partition, giving it a label of “BOOT.”
  2. Make vgnixos-nixos an ext4 filesystem: mkfs.ext4 /dev/vgnixos/nixos
  3. Make swap: mkswap -L swap /dev/vgnixos/swap
  4. mkdir /mnt/boot
  5. mount /dev/nvme0n1p1 /mnt/boot
  6. mount /dev/vgnixos/nixos /mnt
  7. swapon /dev/vgnixos/swap
  8. Check the UUID of the LVM: lsblk -f

Picture:

  1. Generate nix config: nixos-generate-config --root /mnt
  2. Open the config: vi /mnt/etc/nixos/configuration.nix and update to match:
{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

    # Use the systemd-boot EFI boot loader.
    boot.loader.systemd-boot.enable = true;
    boot.loader.efi.canTouchEfiCariables = true;
    boot.initrd.luks.devices = [
        {
        name="nixos";
        device="/dev/disk/by-uuid/e3f91b38-e297-4ba8-9bbe-925f0ed5b52e"; # I did correct this according to the screenshot above
        preLVM=true;
        }
    ];

    networking.useDHCP = false;
    networking.interfaces.enp0s3.useDHCP = true;

    i18n.defaultLocale = "en_US.UTF-8";
    console = {
      font = "Lat2-Terminus16";
      keyMap = "no";
    };

    time.timeZone = "Europe/Oslo";

    environment.systemPackages = with pkgs; [
      wget
      vim
      tmux
    ];

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

    # Enable sound.
    sound.enable = true;
    hardware.pulseaudio.enable = true;

    # Enable the X11 windowing system.
    services.xserver.enable = true;
    services.xserver.layout = "no";
    services.xserver.xkbOptions = "eurosign:e";

    # Enable touchpad support
    services.xserver.libinput.enable = true;

    # Enable the KDE Desktop Environment.
    services.xserver.displayManager.sddm.enable = true;
    services.xserver.desktopManager.plasma5.enable = true;

    # Define a user account. Don't forget to set a password with `passwd`.
    users.users.stian = {
      isNormalUser = true;
      extraGroups = [ "wheel" ];
    };

    system.stateVersion = "20.03";
}
  1. Install: nixos-install

Here I get a warning about the format for the initrd.luks-thing changing soon, but the installer does continue.
After a while, the installer fails with

Failed to check file system type of “/boot”: No such file or directory

Picture:

What am I missing here? Any help would be very much appreciated.

1 Like

I did an install recently, and I recall invoking the install with nixos-install --root /mnt which then I think maybe does a chroot to /mnt when it’s installing so it can find the boot drive at /boot.

That might help, and I’m surprised to not see that in the docs, because I was following the manual at the time, but might have remembered to do that from a previous install.

Edit: Checked the manual for nixos-install and it assumes --root /mnt if it’s not provided so that probably isn’t it.

1 Like

Wrong way around. You need to mount /mnt first, so that /mnt/boot exists within the /dev/vgnixos/nixos file system. As is, the mount /dev/vgnixos/nixos /mnt command is overriding the /mnt/boot file system.

2 Likes

Thank you both for responding!

ElvishJerricco: You were right! Flipping those around solved my problem. Thank you very much!

Tangentially, this is quite a nice write-up of installing NixOS. If you’ve got a blog, please post it!

3 Likes

Thanks acowley, I’ll do that, but I’ll have to give credit to the two below blog posts for getting me this far.

  1. Part 1 - Installing NixOs - Tuxinaut.de
  2. https://www.adelbertc.com/posts/2017-08-13-installing-nixos.html
1 Like

Just in case it helps anyone: I did indeed post instructions on how to install NixOS, but I forgot to link to it from here: How to install NixOS on a Dell Precision 5530 · Stian Lågstad.