Automount cifs not working w/ kernel 6.6.0

I am having a problem automounting remote samba shares using cifs since updating to kernel 6.6.0. I am on unstable. Here is what happens:

❯ ls /mnt/media
lsd: /mnt/media: No such device (os error 19).

I mount this directory automatically using:

 fileSystems."/mnt/media" = {
    device = "//nas/media";
    fsType = "cifs";
    options = let
      automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
    in ["${automount_opts},credentials=/home/user/smb-secrets,uid=1000"];
  };

This remote share is on an unraid server.

If I boot back into kernel 6.5.9, everything mounts and works as expected.

I believe this has to do with SMB dialects. I have tried adding vers=1.0, vers=2.0 and vers=3.0, but that hasn’t worked, or maybe I am doing it wrong.

Does the cifs mount section on this page Samba - NixOS Wiki need to be updated now that SMB1 seems to be deprecated in the latest kernel release?

Sorry to ping this post, but does anyone have this working with kernel 6.6?

NixOS wiki might need updating in many areas, yes.

But you might not be the only one having issues with cifs on kernel 6.6.0

I am still no closer to solving this issue. Does anyone have any insight?

did you try mounting it via IP address instead of hostname?

Edit: Also, did you try switching to the LTS kernel?

1 Like

Ahh. Brilliant.

I had been using boot.kernelPackages = pkgs.linuxPackages_latest; from a long time ago because of some hardware compatability issue (long since have forgotten what it was). I am now running the default kernel (which right now is 6.1.63) and my mounting problems have gone away.

Thanks for the tip.

Great! You can mark my post as the solution so that others may see it straight away.

Most likely this issue will be solved very soon though, there appears to be a patch in the kernel by now.