A few days ago my nixos grub install all of a sudden started giving the error “unknown filesystem” and dropping into a rescue shell, rendering my nixos install unable to boot. Today I started troubleshooting it via chroot but reinstalling gave the same error but this time when installing grub. Instead of troubleshooting further I decided to completely reinstall my system as it would just be easier, or so I thought.
When reinstalling I get the exact same error when running nixos-install. I have mounted my esp on /mnt/boot as the manual says with /mnt being a btrfs subvolume for my root system and /mnt/home being another subvolume. All mounts are displayed with their correct filesystem type when running the mount command. However the grub install part gives the error error: unknown filesystem. Followed by Installation of GRUB EFI into /boot failed: No such file or directory. I know /mnt/boot is correctly mounted as I can see its contents however when I run grub-probe /mnt/boot I get the same error: unknown filesystem. My esp is a FAT32 partition with the esp flag set and it used to work just fine, I have not made any changes to my partition layout. How can I get grub to install?
Sounds like a failing flash drive? 1. Backup anything important from your other partitions now, 2. Have you tried writing a file to /boot to see if that reproduces the error?
Just tried writing to it and it doesn’t seem to be failing, test file persisted across reboot. Crystaldiskinfo gives a good health as well so that doesn’t seem to be it. It’s a 2 month old laptop as well so I wouldn’t expect the ssd to fail so quickly
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/266f666b-6892-4d79-bb9a-4c6b5ee42e7d";
fsType = "btrfs";
options = [ "subvol=@nixos" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/266f666b-6892-4d79-bb9a-4c6b5ee42e7d";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/9835-FD28";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
It is in line with what I would expect from my lsblk output:
Were you ever able to understand & fix the problem? I’m seeing something very similar right now, in my case after partitioning a drive in my new PC using ZFS.