Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Linux
  3. New SSD requires password to mount

New SSD requires password to mount

Scheduled Pinned Locked Moved Linux
linux
23 Posts 16 Posters 9 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P This user is from outside of this forum
    P This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #1

    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.

    K eskuero@lemmy.fromshado.wsE J american_jesus@lemm.eeA ? 8 Replies Last reply
    0
    • System shared this topic on
    • P [email protected]

      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.

      K This user is from outside of this forum
      K This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #2

      Encrypted volume? If so, that's why.

      P 1 Reply Last reply
      0
      • K [email protected]

        Encrypted volume? If so, that's why.

        P This user is from outside of this forum
        P This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #3

        Right. Wouldn't it make sense to unlock it along with my root drive when I log in though? There should be a way to do that

        C 1 Reply Last reply
        0
        • P [email protected]

          Right. Wouldn't it make sense to unlock it along with my root drive when I log in though? There should be a way to do that

          C This user is from outside of this forum
          C This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #4

          You could set the password to be the same. It'll attempt to use all known methods when unlocking it.

          You can also probably store a key on the root drive instead of using a password, but I've never done that.

          P 1 Reply Last reply
          0
          • C [email protected]

            You could set the password to be the same. It'll attempt to use all known methods when unlocking it.

            You can also probably store a key on the root drive instead of using a password, but I've never done that.

            P This user is from outside of this forum
            P This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #5

            They do use the same pass though, that's why it's so strange to me. Thanks for the help, this at least gives me a clue.

            I'll dig around and update the post for reference.

            1 Reply Last reply
            0
            • P [email protected]

              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.

              eskuero@lemmy.fromshado.wsE This user is from outside of this forum
              eskuero@lemmy.fromshado.wsE This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #6

              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

              C 1 Reply Last reply
              0
              • P [email protected]

                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.

                J This user is from outside of this forum
                J This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #7

                Add it to /etc/fstab. Tons of guides everywhere online.

                1 Reply Last reply
                0
                • P [email protected]

                  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.

                  american_jesus@lemm.eeA This user is from outside of this forum
                  american_jesus@lemm.eeA This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #8

                  lsblk -f then add it to fstab https://wiki.archlinux.org/title/Fstab

                  Or you can use KDE Partition Manager https://apps.kde.org/partitionmanager/

                  9 1 Reply Last reply
                  0
                  • american_jesus@lemm.eeA [email protected]

                    lsblk -f then add it to fstab https://wiki.archlinux.org/title/Fstab

                    Or you can use KDE Partition Manager https://apps.kde.org/partitionmanager/

                    9 This user is from outside of this forum
                    9 This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #9

                    If its encrypted, you can also decrypt the drive automatically once booted by adding an entry in /etc/crypttab

                    O 1 Reply Last reply
                    0
                    • 9 [email protected]

                      If its encrypted, you can also decrypt the drive automatically once booted by adding an entry in /etc/crypttab

                      O This user is from outside of this forum
                      O This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #10

                      This never worked for me…

                      eskuero@lemmy.fromshado.wsE 1 Reply Last reply
                      0
                      • O [email protected]

                        This never worked for me…

                        eskuero@lemmy.fromshado.wsE This user is from outside of this forum
                        eskuero@lemmy.fromshado.wsE This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #11

                        For automatically you need to add a keyfile to a slot in the luks device

                        # openssl genrsa -out /root/keyfile.bin 4096

                        # cryptsetup luksAddKey /dev/mapper/extra /root/keyfile.bin

                        The entry in the crypttab would be like this

                        extra UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /root/keyfile.bin luks

                        9 1 Reply Last reply
                        0
                        • eskuero@lemmy.fromshado.wsE [email protected]

                          For automatically you need to add a keyfile to a slot in the luks device

                          # openssl genrsa -out /root/keyfile.bin 4096

                          # cryptsetup luksAddKey /dev/mapper/extra /root/keyfile.bin

                          The entry in the crypttab would be like this

                          extra UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /root/keyfile.bin luks

                          9 This user is from outside of this forum
                          9 This user is from outside of this forum
                          [email protected]
                          wrote on last edited by
                          #12

                          And technically the key file can just be a plain text password and still work. Just as long as the key file matches the drive's encryption password.

                          1 Reply Last reply
                          0
                          • eskuero@lemmy.fromshado.wsE [email protected]

                            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

                            C This user is from outside of this forum
                            C This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #13

                            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?

                            eskuero@lemmy.fromshado.wsE brewchin@lemmy.worldB I 3 Replies Last reply
                            0
                            • C [email protected]

                              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?

                              eskuero@lemmy.fromshado.wsE This user is from outside of this forum
                              eskuero@lemmy.fromshado.wsE This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #14

                              I believe systemd after targets work tho I have never tried them
                              Try adding this to mount options

                              x-systemd.after=network-online.target

                              1 Reply Last reply
                              0
                              • C [email protected]

                                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?

                                brewchin@lemmy.worldB This user is from outside of this forum
                                brewchin@lemmy.worldB This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #15

                                You may be right, but I worked around this using https://wiki.archlinux.org/title/NetworkManager#Network_services_with_NetworkManager_dispatcher

                                Essentially, I added the CIFS shares to my fstab with the _netdev option and created /etc/NetworkManager/dispatcher.d/30-nas-shares.sh containing:

                                WANTED_CON_UUID="UUID-OF-MY-WIFI-IN-NETWORK-MANAGER"
                                
                                if [ "$CONNECTION_UUID" = "$WANTED_CON_UUID" ]; then
                                  case "$2" in
                                    "up"|"vpn-up")
                                      mount -a -t cifs
                                      ;;
                                  esac
                                fi
                                

                                This waits for my WiFi to come up, ensures it's my home WiFi, and then mounts my shares.

                                There are probably other and better ways to do it, but it works.

                                1 Reply Last reply
                                0
                                • C [email protected]

                                  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?

                                  I This user is from outside of this forum
                                  I This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #16

                                  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

                                  C 1 Reply Last reply
                                  0
                                  • P [email protected]

                                    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.

                                    ? Offline
                                    ? Offline
                                    Guest
                                    wrote on last edited by
                                    #17

                                    KDE has option to automount during login. I found that to be the best solution.

                                    1 Reply Last reply
                                    0
                                    • P [email protected]

                                      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.

                                      mimicjar@lemmy.worldM This user is from outside of this forum
                                      mimicjar@lemmy.worldM This user is from outside of this forum
                                      [email protected]
                                      wrote on last edited by
                                      #18

                                      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.

                                      F 1 Reply Last reply
                                      0
                                      • mimicjar@lemmy.worldM [email protected]

                                        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.

                                        F This user is from outside of this forum
                                        F This user is from outside of this forum
                                        [email protected]
                                        wrote on last edited by
                                        #19

                                        Be sure to restrict it to only be readable by root.

                                        sudo chmod 400 /etc/newpassword
                                        
                                        1 Reply Last reply
                                        0
                                        • I [email protected]

                                          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

                                          C This user is from outside of this forum
                                          C This user is from outside of this forum
                                          [email protected]
                                          wrote on last edited by
                                          #20

                                          Will that add two minutes to my boot time though?

                                          I 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups