I installed an additional SSD on my pc. Everything works ok, except I need to unlock it with my root password on every session so that it mounts.

I’ve tried formatting it to change the ‘owner’, tried adding it to the user group, and I can’t find any other solutions. Any ideas?

This happens irrelevant of DE (happens on KDE and hyprland). I’m running tumbleweed, though this looks like a config problem rather than a distro problem.

  • darksiderbun@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 day ago

    I know a lot of people are recommending fstsb entries, but since you’re using a DE, you can have the credential stored in the wallet / session manager for your DE. KDE and Gnome should both have an automount option using keys from there. Then you also can find a preference somewhere to unlock your wallet / session keys thing on login. Bing bang boom you should have it mount and unlock automatically without having to enter any extra stuff with the added benefit of not leaving the key around (though since it seems you have FDE anyway that’s a minor issue depending on your threat model)

  • MimicJar@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    3 days ago

    As you mentioned elsewhere it’s encrypted.

    Take a look at /etc/crypttab and creating and adding a key file that can unlock the drive.

    Essentially your additional SSD will have both a password and a file containing a password that can unlock the drive. When you unlock your root filesystem (I’m guessing at boot) it will then have the key file that can unlock the SSD.

    Something like cryptsetup luksAddKey /dev/pathtossd --new-keyfile /etc/newpassword

    Systemd might make this easier to setup nowadays.

    Edit: Also, yes, the password to unlock your SSD is just sitting in a file in your root drive. Be sure to restrict it to only be readable by root.

  • Eskuero@lemmy.fromshado.ws
    link
    fedilink
    arrow-up
    1
    ·
    3 days ago

    Generally, they enforce in Linux using root permissions to mount internal hard drives unlike USB drives that can be mounted by the user If you want to mount it automatically in every boot, you could modify the /etc/fstab to add an entry for it

    • caseyweederman@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      I have a related issue. Mine is a network share and it’s in fstab, but I have Linux boot without waiting for wifi, so the mount fails and then asks for root password when I try to mount it later.
      I think I just need to add “user” to the options field, right?

      • irotsoma@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        1
        ·
        3 days ago

        Try adding the nofail and _netdev options in your fstab entry. I have this on a few computers that connect to nfs shares including my laptop that obviously can only connect when I’m at home or on VPN. Example:

        server:/path /mnt/path nfs4 defaults,nofail,_netdev 0 0

          • irotsoma@lemmy.blahaj.zone
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            1 day ago

            Nope it doesn’t add anything for me. The _netdev option tells mount to wait until the network is connected before attempting to mount. And the nofail option tells it not to error or block the process that called it if the mount doesn’t work or is delayed.

            Now if the mount contains your etc or other critical config files, it could cause problems and maybe you want to wait, so don’t want the nofail. And of course this kind of thing is somewhat OS specific depending on what boot system and service manager, etc., is used, so YMMV, but on Fedora, Rocky, and Ubuntu, it has worked for me for many years.