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.
  • 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
                • 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.

                  dr_jekell@lemmy.worldD This user is from outside of this forum
                  dr_jekell@lemmy.worldD This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #21

                  I have had the issue of having to enter a password to access an additional drive on my Manjaro PC.

                  I was pointed to this as a possible solution and it worked for me.

                  It may or may not work for you though.

                  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.

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

                    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)

                    1 Reply Last reply
                    0
                    • C [email protected]

                      Will that add two minutes to my boot time though?

                      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
                      #23

                      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 is used, so YMMV, but on Fedora, Rocky, and Ubuntu, it has worked for me for many years.

                      1 Reply Last reply
                      0
                      • System shared this topic on
                      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