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

Thread: Can't change directory ownership

  1. #1

    Default Can't change directory ownership

    I have my hard drive arranged with a single large ntfs data partition and a number of smaller partitions for /home etc. Here's the line in fstab:

    Code:
    /dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J9FZ806954-part2 /home/shmuck/data           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
    But the ownership for that directory is root and I can't change it for some reason, using this line:

    Code:
    sudo chown -R shmuck /home/shmuck/data
    It just doesn't do anything. Could anyone tell me why that is?

  2. #2
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,733
    Blog Entries
    20

    Default Re: Can't change directory ownership

    Become su -
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  3. #3

    Default Re: Can't change directory ownership

    Nope, no difference. I was using sudo in the first case.

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

    Default Re: Can't change directory ownership

    Did you do the chown with the fs mounted or unmounted?

    Also mark that you can not change ownership on the NTFS partition itself because NTFS does note have such a thing as ownership. The ownership you see there is fake and derives from the appropriate mount options used.
    Henk van Velden

  5. #5
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Can't change directory ownership

    The ownership of the folder to be mounted can continue to be root. This does not keep you from reading and writing the data as you wish. Perhaps the real issue is how you have the hard drive partition mounted in your fstab file. I suggest you modify your entry to read like this and then reboot:

    Code:
    /dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J9FZ806954-part2 /home/shmuck/data           ntfs-3g defaults 0 0
    This works for me for all ntfs partitions. I also use Samba to share these with other Windows PC's and don't wish to enforce the Linux permission system on the ntfs partitions. I leave Linux partitions as set by default and make no changes to their setup.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  6. #6

    Default Re: Can't change directory ownership

    That works for me as well, so problem solved. Thanks.

    Unmounting did allow me to change the directory ownership, but the ownership was changed back as soon as I mounted again.

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,288

    Default Re: Can't change directory ownership

    I agree with jdmcdaniel3 that mounting with defaults, which is recommended by all threads handling permission problems in NTFS file systems AFAIK, is a good thing to do. After all, all those threads can't be wrong, can't they?

    And while I also agree that root can stay the owner of the mountpoint without any problem (as long as enough permission bits are set), I as user would not like it to have a directory (or other file) somewhere within my realm (my home directory) where I am not the owner. When I (as user) would like to have an NTFS file system mounted somewhere inside my home directory, I would create the mountpoint, set the correct persmissions and then ask the system manager (me again, but in a different role: root) to create the fstab entry.
    Henk van Velden

  8. #8
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Can't change directory ownership

    shmuck
    That works for me as well, so problem solved. Thanks.

    Unmounting did allow me to change the directory ownership, but the ownership was changed back as soon as I mounted again.
    Happy to hear that this worked for you shmuck. This is the method I have found that works best for me so far (using the defaults setting for ntfs partitions) and which was suggested to me many moons ago.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  9. #9

    Default Re: Can't change directory ownership

    Although this thread has been for a while, yet we can add some information:



    Mount NTFS partition at startup, with non-root user as owner


    Simply add

    uid=yourUserName

    In the fstab line, that is it.

    I had a hard time with this same issue, and I've found a solution to assign the partition with yast in

    openSUSE 12.3 Tips, Tricks, And Tweaks » TweakHound

    "Mounting Windows Drives"

    Here adding the extra step: edit the Fstab Option, by adding the 'uid=yourUserName'. The fstab in the example here
    would become something like


    /dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J9FZ806954-part2 /home/shmuck/data
    ntfs-3g users,uid=yourUserName,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0


    I've found the answer in

    11.10 - Mount NTFS partition at startup, with non-root user as owner - Ask Ubuntu


    I hope it helps.

  10. #10

    Default Re: Can't change directory ownership

    Just for the record:

    uid=user identifier
    gid=group identifier

    For more info, search for file ownership in linux.

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
  •