Removing the need for a password with internal drives

I would like to be able to access my mounted internal drives without having to enter a password. Can someone guide me on this?

I am on KDE Nixos 23.05

Mount them through fileSystems in your configuration.

And if you want them for temporary mounts only, make sure to have services.udisks2.enable enabled.

1 Like

This worked–until I rebooted!

  # Mount External Drives
  
  fileSystems."/home/me/WDBLACK" = {
    device = "/dev/disk/by-uuid/d2a55801-08e9-4bad-b905-4c83d7e76ad0";
    fsType = "ext4"; # replace with actual file system type, e.g., ext4, ntfs
  };

  fileSystems."/home/me/SSD" = {
    device = "/dev/disk/by-uuid/e20cde3c-b800-42a5-bfc6-700fb6af4298";
    fsType = "btrfs"; # replace with actual file system type
  };

  services.udisks2.enable = true;

Is it possible for you to look at my config below and tell me if you spot anything out of place? It worked when I rebuilt but on reboot it failed.

Failed with which error? And look where “below”?

Sorry I meant to the code above.

[ OK ] Started Network Time Synchronization.
[ OK ] Reached target Network.
[ OK ] Reached target Network is Online.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
Give root password for maintenance
(or press Control-D to continue):

From that snippet the best bet I can do is: You do not have BTRFS as a required for boot filesystem…

boot.supportedFilesystems or boot.initrd.supportedFilesystems. I am never sure which one is actually required for which stage and for what mount points and tend to simply put any filesystem I use in both lists.

1 Like

Might alternatively want to explicitly disable neededForBoot for those drives if you don’t want to mount them on boot.

1 Like

I think I may have isolated the problem by checking journal logs. I ran a check on the disk for errors and got this:

~$ sudo fsck.ext4 /dev/sda1
e2fsck 1.46.6 (1-Feb-2023)
/dev/sda1 has unsupported feature(s): FEATURE_C12
e2fsck: Get a newer version of e2fsck!

/dev/sda1: ********** WARNING: Filesystem still has errors **********

Installing e2fsprogs did not help.

Seems as if a fix got merged to unstable during May. On the 18th to be exact. It might be, that this was right after branch-off for 23.05 and you are still using 23.05 with a ext4 that was touched by newer ext4 “drivers”.

1 Like