Debian 13.

I have an FSTAB config that auto mounts a second drive , NTFS fstype that used to be on windows (same laptop) UUID=666 /media/userName/Data auto defaults,nofail,x-systemd.automount 0 2

Because the /media/userName/Data path was made in a way that didn’t transfer ownership to my user, and because I am clueless about user/group management on linux, Virtual machine manager and jenkins and all the other program based users that don’t really get a “real” user I can manage on cockpit or similar (AFAIK) can’t use that disk for writing information to and etc.

I already tried to change owner to a shared group in a shitty way that locked me out of that very important drive. Also, it doesn’t seem to work anyway, and just fucking sets it back to root or ignores it when I try to do it.

What’s the simplest change I can make to the fstab entry or ownership to make use of that drive for jenkins pipelines , steam games and most importantly, Virtual Machine Manager guest machines?

This shit scares me, and I have very little time, so I will get back to you guys in due time, and appreciate your assistance.

  • timroerstroem@feddit.dk
    link
    fedilink
    arrow-up
    5
    ·
    15 days ago

    Try adding uid=<your uid>,gid=<your gid> to the mount options. id will show your uid and gid (probably 1000). That should give you ownership of the file system.

    • Skullgrid@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      15 days ago

      can I share it with a group like that too? like 1003?

      UUID=666 /media/userName/Data auto uid=1000,gid=1000,groups=1003 defaults,nofail,x-systemd.automount 0 2
      ?

      • Successful_Try543@feddit.org
        link
        fedilink
        arrow-up
        1
        ·
        14 days ago

        The options user and users allow any user to mount or unmount that device. It doesn’t mean that they actually have some permission for reading from or writing to that device. Afaik, the option groups=<gid> doesn’t exist.

        • Skullgrid@lemmy.worldOP
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          12 days ago

          I changed the fstab to :

          UUID=666 /media/myUser/Data auto defaults,nofail,x-systemd.automount,uid=1000,gid=1000 0 2

          then did the following (among others)

          $ chown otherUser fart.txt 
          chown: changing ownership of 'fart.txt': Operation not permitted
          $ sudo !!
          sudo chown otherUser fart.txt 
          [sudo] password for myUser: 
          $ ls -l
          total 16
          -rwxrwxrwx 1 myUser myUser    0 Oct 14 17:27 fart.txt
          

          I also did try with

          setfacl -g g:sharedFolders fart.txt

          and it still didn’t change the group.

          /media/myUser/Data/docs/Subfolder/Again

          is the path. The other user did mention that because this is an NTFS drive so it won’t work, are they right?

          • Successful_Try543@feddit.org
            link
            fedilink
            arrow-up
            1
            ·
            12 days ago

            The other user did mention that because this is an NTFS drive so it won’t work, are they right?

            Yes, the uid and gid you are setting in fstab simulate a linux uid:gid style ownership of the files an directories on the device. They can’t be changed.
            You may create a group, let’s call it ntfsusers, and add the users that need to use the files and directories on the ntfs partition to that group and assign gid with the group id of ntfsusers in fstab.

            • Skullgrid@lemmy.worldOP
              link
              fedilink
              arrow-up
              1
              ·
              12 days ago

              that’s what I meant with this :

              can I share it with a group like that too? like 1003?

              UUID=666 /media/userName/Data auto uid=1000,gid=1000,groups=1003 defaults,nofail,x-systemd.automount 0 2
              ?

              I already have a group like that, sharedFolders, if I use the ID from that eg :

              getent group
              sharedFolders:x:1003:myUser,otherUser,root
              

              and modify FSTAb like this :

              UUID=666 /media/myUser/Data auto defaults,nofail,x-systemd.automount,uid=1000,gid=1003 0 2

              would that work?

                • Skullgrid@lemmy.worldOP
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  12 days ago

                  I did set it to that, and the folder I am mounting to now has this :

                  
                  $ ls -l
                  total 24
                  drwxr-x---+ 3 root root           4096 Aug 28 18:28 .
                  drwxr-xr-x  4 root root           4096 Jan 17  2026 ..
                  drwxrwxrwx  1 myUser  sharedFolders 16384 Sep 28 23:15 Data
                  
                  $pwd 
                  /media/myUser
                  

                  but when I login as otherUser, they cannot access the /media/myUser/Data folder. What could I be doing wrong?

                  • Successful_Try543@feddit.org
                    link
                    fedilink
                    arrow-up
                    1
                    ·
                    edit-2
                    12 days ago

                    Which groups does your ordinary user belong to and which the one that cannot acces the path?

                    Does the group sharedFolders have permission on the folder /media/myUser/Data before you have mounted the device?