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:

/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:

sudo chown -R shmuck /home/shmuck/data

It just doesn’t do anything. Could anyone tell me why that is?

Become su -

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

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.

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:

/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,

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.

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.

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,

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.

Just for the record:

uid=user identifier
gid=group identifier

For more info, search for file ownership in linux.

NTFS does not have a concept of file ownership that is compatible with “chown”. My understanding is that it uses acls (access lists) and inheritance to control permissions. I put “uid=1001” into the options of “fstab” so that I am owner without being root.