Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: mounting ntfs usb disk and user access

  1. #1

    Default mounting ntfs usb disk and user access

    before I had an external usb hard disk (formated with ntfs) mounted in user space (i.e. via the KDE panel or by clicking in dolphin on the respective entry)

    no I want to mount that HD at boot time and to export it via nfs.
    when doing that I encountered the following problem:
    I want a particular folder on that HD to be accessibe by a particular user.
    with non-ntfs-disks I simply had used chown to change the permissions of that folder.
    with the ntfs disk however this didn't word. the permissions didn't change after using chown (as root of course)
    but the permissions are set to rwx for all!

    does ntfs not allow to mount as root and to set ownership to a particular user?
    do I have to format the disk to e.g. ext?

    the fstab entry for that disk contains:
    ntfs-3g user,user_xattr,nofail 1 2
    before it was
    ntfs-3g defaults 0 0
    with the same result

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,757

    Default Re: mounting ntfs usb disk and user access

    Of course you can not change ownership of user/group and/or permission bits on an NTFS file system, because they are not there. They are only faked by the NTFS software on Linux. Wha they will be on your system when the NTFS file system is mounted is decided by the parameters of the mount. They are filled in with the user/group of the users that mounts them using the desktop feature. Or, when root mounts them with the mount statment, they are there in the options field. And they can of course be in an fstab entry when that is used.

    I always advise to use non-Linux file system types only for exchanging data with non-Linux systems. Not for integral using in a Linux system. And I guess that mounting it permanently and exporting is through NFS is rather inegral Linux usage.
    Henk van Velden

  3. #3

    Default Re: mounting ntfs usb disk and user access

    Hi suse_paul !

    Quote Originally Posted by hcvv View Post
    Of course you can not change ownership of user/group and/or permission bits on an NTFS file system, because they are not there.
    In other words: NTFS by default doesn't know about permissions. Period.

    And even if it would: could you expect that permissions would be treated the same way under Linux as they could possibly be treated under windows ??

    Quote Originally Posted by hcvv View Post
    They are only faked by the NTFS software on Linux. Wha they will be on your system when the NTFS file system is mounted is decided by the parameters of the mount.
    The access rights to an NTFS volume under Linux are given by the entries in /etc/fstab (or under openSUSE can as well be set using the partitioner of YaST),
    and are further influenced by the settings in e.g. /etc/polkit-default-privs.local.

    You could format your USB drive with a Linux file system (like ext3 or ext4).

    But then on the other hand the question arises of how you could access that drive as a non-root user.

    Best wishes
    Mike

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,757

    Default Re: mounting ntfs usb disk and user access

    Quote Originally Posted by ratzi View Post

    But then on the other hand the question arises of how you could access that drive as a non-root user.
    That is of course the same case as for every file in Linux. To be done by correct ownership and permissions.
    Henk van Velden

  5. #5

    Default Re: mounting ntfs usb disk and user access

    Quote Originally Posted by hcvv View Post
    That is of course the same case as for every file in Linux. To be done by correct ownership and permissions.
    I have a question with respect to that, that I will post soon - but perhaps you could answer that now?

    No, it is not the permission for a single file. That would be rather trivial.

    But I have formatted 2 external USB hard disks with ext4 and ReiserFS.

    To be able to write to the root directory of these external USB disks as the standard (non-root) user,
    for which file should I change the permissions?

    Thanks
    Mike

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: mounting ntfs usb disk and user access

    On 2014-07-09 22:06, ratzi wrote:
    >
    > Hi suse_paul !
    >
    > hcvv;2653048 Wrote:
    >> Of course you can not change ownership of user/group and/or permission
    >> bits on an NTFS file system, because they are not there.

    >
    > In other words: NTFS by default doesn't know about permissions. Period.


    No, that is not true. NTFS has a very complex or powerful set of
    permissions, including ownership (on Windows), akin to Linux ACLs, and
    Linux does not support them all. It might be possible to do some
    translation between some Linux permissions and some Windows NTFS
    permissions, and I believe there is some *experimental* support for such.

    Meanwhile what we have for NTFS mounts is about the same to what we have
    for vfat: permissions are defined for the entire partition at mount time.

    Notice that vfat does have some permission support, but not ownership.
    For example, the MsDos "write" permission can be translated. I did
    experiments years ago, and it translated in Linux as "w" for everybody,
    or nobody at all. I'm not sure about the MsDOS "r" attribute.


    You could experiment now if this is still true, and when; and remember
    that "vfat" is not the only Linux equivalent for "FAT" that we can use,
    there are, or were, other variants.


    For instance, there was a filesystem type that stored the Linux
    permission sets on a separate file stored somewhere on the FAT
    filesystem, so that Linux did see it with about the entire Linux
    permission set. This was used about two decades ago to be able to run
    Linux on a FAT partition without reformatting it, which at that time
    scared many people away - and disks were not that big, so an extra
    partition was also a waste.

    This must still be somewhere in the manual.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  7. #7

    Default Re: mounting ntfs usb disk and user access

    Quote Originally Posted by robin_listas View Post
    On 2014-07-09 22:06, ratzi wrote:
    >
    > Hi suse_paul !
    >
    > hcvv;2653048 Wrote:
    >> Of course you can not change ownership of user/group and/or permission
    >> bits on an NTFS file system, because they are not there.

    >
    > In other words: NTFS by default doesn't know about permissions. Period.


    No, that is not true. NTFS has a very complex or powerful set of
    permissions, including ownership (on Windows), akin to Linux ACLs, and
    Linux does not support them all.
    Correct me if I'm wrong.
    That would mean that permissions loose their significance if the filesystem is read using a different operating system.

    Best wishes
    Mike

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: mounting ntfs usb disk and user access

    On 2014-07-10 00:16, ratzi wrote:

    > Correct me if I'm wrong.
    > That would mean that permissions loose their significance if the
    > filesystem is read using a different operating system.


    No, that's correct :-)

    There can be some translation, depending on what each operating system
    defines.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: mounting ntfs usb disk and user access

    On 2014-07-09 23:06, ratzi wrote:

    > To be able to write to the root directory of these external USB disks as
    > the standard (non-root) user,
    > for which file should I change the permissions?


    Of the directory or mount point, once mounted.

    But I think it is preferable to create a directory, just at the root of
    the external disk, named for the user that needs access, and chown that
    directory to that user.

    Then that user has full permissions on that directory. A different user
    may have another directory of his own. Or they can share another,
    adjusting the group permissions.

    But remember that in Linux ownership is not name based, but number
    based. That is, suppose you have a machine 'one' where user 'john' is
    the first user, with UID 1000, and machine 'two' has user 'tony' as the
    first user, with UID 1000.

    Well, a file belonging to "john" on the first machine, when copied over
    to the second machine, it automatically belongs there to "tony", even if
    the second machine has another user named "john".

    Which is often a complication.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,757

    Default Re: mounting ntfs usb disk and user access

    Quote Originally Posted by ratzi View Post
    I have a question with respect to that, that I will post soon - but perhaps you could answer that now?

    No, it is not the permission for a single file. That would be rather trivial.

    But I have formatted 2 external USB hard disks with ext4 and ReiserFS.

    To be able to write to the root directory of these external USB disks as the standard (non-root) user,
    for which file should I change the permissions?

    Thanks
    Mike
    As said, it is all the same for every directory/file. That fact that there is a mount point somewhere doesn't matter.

    Look e.g. at /home (mine e.g.):
    Code:
    totaal 40
    drwxr-xr-x 10 root   root  4096 17 jan 14:37 ./
    drwxr-xr-x 23 root   root  4096 10 jul 11:50 ../
    drwxr-xr-x  6 mysql  mysql 4096 18 jan 15:44 databases/
    drwxr-xr-x 85 henk   wij   4096 10 jul 12:54 henk/
    drwx------  2 root   root  4096 25 okt  2009 lost+found/
    drwxr-xr-x 34 marian wij   4096  3 aug  2013 marian/
    drwxr-xr-x 12 mgi    users 4096  8 jul 10:15 mgi/
    drwxr-xr-x 17 smweb  www   4096  8 jul 09:44 smweb/
    drwxr-xr-x  8 wappl  www   4096 21 mei 10:14 wappl/
    drwxrwxrwx 16 henk   wij   4096 29 jun 16:05 wij/
    henk@boven:~>
    /home /itself (here represented by ./) is owned by root:root, and only the owner (root) has write permission and thus can cretae,/remove thiings, but everybody can read and see what is there. The several home directories are owned by the several users and thus only those users can change thingsin there. This has nothing to do with the fact if /home is on a separate file system or not.

    So it all depends on who must have what sorts f access to what.

    When it is for one user, you could e.g. create the mount point inside the user's home directory (e.g. /home/theuser/music) and then of course make the user and hhis default group own that directory (orlet it create bij the user himself, he weill them be the owner automaticaly). And of ourse (s)he should be owner of what is inside that file system).

    When you have more users that should be able to read and/or write, first decide if that is all users, or only a subset. Then you must create groups for those groups, so you can then set permissions on the group level. You could e.g. create a mount point in system space (e.g. /mnt/music-for-for-all) and make the owner one of the group (that then has probably more rights, so choose tehier chairman or make an extra user) and the special group. Then set the group permisson so that everybody in the groups can r, w and x there.

    Again it all depends on your wishes, the number of users, the grouping of the users, the security you want against bad users, etc.

    BTW, there was some talking about NFS exporting. Take care that your users have the same userid on the different systems. Else on system one user aap with userid 1001 will have access to the files on system two with user noot which on that system also has userid 1001.
    Henk van Velden

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •