Announcement

Collapse
No announcement yet.

who mounts my disk? + permission setting

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    who mounts my disk? + permission setting

    Hi!

    I don't know too much about the mount system in Kubuntu, so I would like to ask your help:
    I have an external HDD formatted to NTFS. This device is not listed on the fstab file. Still, if I open the Konqueror this device is listed on the "Places" sheet.
    If I click on the device name, the HDD gets mounted with some sort of rights (I think r/w for owner, none for the others).

    Could someone tell me how this works?:
    - From where Konqueror knows about this HDD that is not in the fstab?
    - where are the parameters defined that is used for mounting? where can I change them?

    Thanks for your help!

    #2
    Re: who mounts my disk? + permission setting

    The operating system is aware of anything connected to the USB bus, which I assume is what you have. It is part of the USB design to detect any connected device. The fact that it is not listed in /etc/fstab is a good thing -- you should not automatically mount USB storage devices.

    So, Konqueror knows because the OS tells it there is a connected device.

    NTFS does not carry "permissions", like a Linux filesystem, so you can't really deal with ownership of the files on the NTFS drive. (In Windows, every user owns everything -- thus making virus insertion very easy.)

    Comment


      #3
      Re: who mounts my disk? + permission setting

      Thanks, but I was not so precise, sorry for that.
      So this external drive is connected to the PC through eSATA interface, not by USB.

      After this device gets mounted automatically, it will be mounted like this (output of 'mount' command):
      /dev/sdb1 on /media/bigMama type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)

      I know that NTFS has not the same right-management that Linux types have, but I think somehow it should be possible to mount it to have other users rights as well.
      Right now the problem is the following: I have two users on this Kubuntu machine. User1 -who is also the admin- and User2. If I login with User1 the NTFS drive is fully accessable (rw), but after that User2 cannot access it, since it is mounted with no access for a group or everyone else.
      If User2 logs in earlier, then he/she cannot mount it, because the system asks for User1 password.
      I am sure that this can be changed, but I cannot find where

      Thanks for the help!

      Comment


        #4
        Re: who mounts my disk? + permission setting

        I tried for you to mount USB NTFS disk. There is an usual dialog on right click file or folder - Properties, but changes are not saved. So you cannot for example grant read access for another user than owner.

        NTFS file system has very similar system of permissions as in Linux, but works for NTFS only in newer Windows from Windows NT.

        The reasonable solution is to reformat your disk to Ext2. if you need it in Windows. You can install Ext driver in Windows for it. If you don't need it in Windows so use Ext4.
        Kubuntu 16.04 on two computers and Kubuntu 17.04 on DELL Latitude 13

        Comment


          #5
          Re: who mounts my disk? + permission setting

          Originally posted by dudeeg
          Thanks, but I was not so precise, sorry for that.
          So this external drive is connected to the PC through eSATA interface, not by USB.

          After this device gets mounted automatically, it will be mounted like this (output of 'mount' command):
          /dev/sdb1 on /media/bigMama type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)

          I know that NTFS has not the same right-management that Linux types have, but I think somehow it should be possible to mount it to have other users rights as well.
          Right now the problem is the following: I have two users on this Kubuntu machine. User1 -who is also the admin- and User2. If I login with User1 the NTFS drive is fully accessable (rw), but after that User2 cannot access it, since it is mounted with no access for a group or everyone else.
          If User2 logs in earlier, then he/she cannot mount it, because the system asks for User1 password.
          I am sure that this can be changed, but I cannot find where

          Thanks for the help!
          Try pysdm:
          Code:
          sudo apt-get install pysdm
          Launch it through System > Storage Device Manager

          [img width=400 height=306]http://i.imgur.com/xREQY.jpg[/img]
          ASROCK Z87 Pro4 - i5 4670K - R9 270x ☞ Triple Boot: KDE NEON ★ Windows 10 ★ Windows 7

          Comment


            #6
            Re: who mounts my disk? + permission setting

            Thanks for everyone for the proposals.
            However, I still would be interested where Kubuntu or KDE stores the configuration file for mounting this eSata NTFS drive.
            Normally it should be in fstab, but maybe there is another way now, I don't know.

            Also, I suppose ntfs-3g is working behind the scene, and the man page states this:
            "By default, files and directories are owned by the effective user and group of the mounting process and everybody has full read, write, execution and directory browsing permissions. "

            Now, for me only User1 has full access right, the others have nothing, so they cannot read it after User1 mounted it. If I understand correctly this is not according to the description in ntfs man page.
            Perhaps I misconfigured something during the first setup of my Kubuntu install...

            (years earlier I was using Slackware, and there the GUI was not so in the front. Now, these GUIs are hiding a bit too much, so it is -at least for me- pretty hard to figure out what works beneath)

            Comment


              #7
              Re: who mounts my disk? + permission setting

              Ok, I think I understand your question and I am struggling with a somewhat related problem.

              In my situation I have an external storage device, also formatted in NTFS. I plug it into my Linux system and then want to mount it as a network share over the LAN (from my Linux OS). I come across similar roadblocks as you have described.

              We're assuming that the external drive has no native NTFS permissions/restrictions previously set, so that the NTFS drive is fully accessible. (IME, Linux does not do a good job of interacting with NTFS permissions. If an NTFS drive is to be used with Linux, IMO, it is best to make sure that none of the NTFS protections are set.)

              The question then isn't one of NTFS permissions but of Linux permissions to the external media.

              When you hotplug an external drive, only the current user gets r/w permission to use the device. You want to automatically give permission to all users, however, not just the user currently logged in, whenever you hotplug an external storage device.

              (In my situation I want to mount the drive as a network share (Samba share, for example).)

              In earlier versions of Kubuntu, this happened automatically and for me actually presented a bit of a security risk. When I plugged in a device I didn't really want it accessible to other users (and now prefer the tighter security).

              I can think of several solutions.

              1) Create a mount script that gives access to all users, not just the current user.

              If I'm not mistaken, mount creates a directory entry, as part of the big directory tree, in the "media" folder (that refers to the hotplugged storage device). The options for the mount command determine the permissions assigned to that reference. By changing the behavior of the automatically-invoked mount command, that behavior can be changed to give permissions to not only the current user but all user (or a subset of users). The script might have to unmount the automounted drive and then remount it with the permissions you desire.

              2) Create a group (using user permissions) whose users are allowed to hotplug a device, and somehow give permissions to them to mount the hotplugged device. I'll think about the best way to do this.

              A question is whether you want this to happen for all hotplugged storage devices or only a specific one?

              3) I agree with the other posts that the fstab is probably going to be the best solution. The annoyance is an error that would appear if the fstab were invoked and the external device not actually found to be connected. Certainly there must be some way to suppress that error through the fstab settings?

              UbuntuGuide/KubuntuGuide

              Right now the killer is being surrounded by a web of deduction, forensic science,
              and the latest in technology such as two-way radios and e-mail.

              Comment


                #8
                Re: who mounts my disk? + permission setting

                Originally posted by dudeeg
                Now, for me only User1 has full access right, the others have nothing, so they cannot read it after User1 mounted it. If I understand correctly this is not according to the description in ntfs man page.
                That is exactly what I saw on file > right click > Properties > Permissions: Owner full access, group and others nothing, owner current user.
                Kubuntu 16.04 on two computers and Kubuntu 17.04 on DELL Latitude 13

                Comment


                  #9
                  Re: who mounts my disk? + permission setting

                  Originally posted by perspectoff
                  You have to remember that most of the people who answer in these forums really aren't superusers and will give you anything but the answer you are seeking. There are precious few actual developers of Kubuntu that hang out in the forums.

                  You are asking a nuts and bolts question about how the OS works -- how a drive/location gets temporarily mounted by the OS.

                  I suspect that when you mount something from Dolphin (or Konqueror), it invokes the mount command as a script.

                  USBs are automounted when detected as a new device, probably (and I, like the others, am guessing) as a notifier script to run the mount command.

                  This behavior can be turned off, of course.
                  As I mentioned, this is not a USB drive, but an eSATA. But maybe there is no difference.
                  Anyway, I know (K)Ubuntu is meant to simplify Linux to bring it to more homes through its user friendliness. But for me this doesn't mean that there should be no experts out there who are using it
                  Also, I don't think that my problem is really complicated. I need to mount an ntfs external drive in a way that more users can use it. That is all. I think this is really not a special topic.

                  Comment


                    #10
                    Re: who mounts my disk? + permission setting

                    Originally posted by josefko
                    Originally posted by dudeeg
                    Now, for me only User1 has full access right, the others have nothing, so they cannot read it after User1 mounted it. If I understand correctly this is not according to the description in ntfs man page.
                    That is exactly what I saw on file > right click > Properties > Permissions: Owner full access, group and others nothing, owner current user.
                    Correct. But this causes me headache

                    Comment


                      #11
                      Re: who mounts my disk? + permission setting

                      Originally posted by dudeeg
                      this causes me headache
                      It shouldn't if you knew, that it hasn't solution you expected. As I wrote earlier, the solution is switching to some Ext format. If you have NTFS because you want to reach it also from Windows, so Ext2IFS driver is for you.
                      Kubuntu 16.04 on two computers and Kubuntu 17.04 on DELL Latitude 13

                      Comment


                        #12
                        Re: who mounts my disk? + permission setting

                        Although using /etc/fstab to automatically boot external drives is not normally recommended, doing that might fix your issue. But, you would have to leave the external drive connected -- if you boot without it, your boot process will puke errors, and might hang (don't use the "auto" option). You'll have to use your text editor and write the boot line in /etc/fstab.

                        Give it a try -- if it doesn't work, just remove the line that you added to /etc/fstab.

                        Comment


                          #13
                          Re: who mounts my disk? + permission setting

                          Originally posted by dibl
                          But, you would have to leave the external drive connected -- if you boot without it, your boot process will puke errors, and might hang (don't use the "auto" option).
                          Mounting explicitly with the "noauto" option in /etc/fstab should prevent any errors during boot if drive is not connected ("auto" is the default).

                          You can also set the ownership, group and permissions for an ntfs volume with "uid=value", "gid=value" and "umask=value" mount options in /etc/fstab, if you wish (see 'man mount' for details). So you can mount an ntfs filesystems with the ownerships and permissions you like.

                          Comment


                            #14
                            Re: who mounts my disk? + permission setting

                            Thanks!
                            Then I will add this device to fstab with 'noauto' option.

                            Comment

                            Working...
                            X