2

I am trying to change the owner and group of a directory that happens to be on a mounted drive. I can run sudo chown and sudo chgrp on the directory however, when I look at the group and owner, nothing changes. I get no failures in the output. Am I missing something? Is there any extra step because it is mounted?

1 Answer 1

2

You could not change ownership or permissions on ntfs partition the way you're trying to do it.

You could only mount it with required uid of user you want to be the owner of the partition.

Find out your user uid and gid by:

$ cat /etc/passwd | grep $(echo $USER)

Find out your ntfs partition UUID by blkid command execution.

Mount your partition in /etc/fstab with your user's permissions and ownership:

UUID=1EB89832B8980B03    /mnt/super    ntfs    rw,uid=1000,gid=1000    0   0

Add also noauto option if you do not want it to be mounted automatically at boot.

Even binding

sudo mount --bind /mnt/super/test ~/test/newtest -o rw,uid=0,gid=0

will change nothing. Ownership will remain as you specified there in /etc/fstab or as it is now in case of mounting it using nautilus or other file manager.

If you want everyone reading and writing permissions on that partition, you could change uid and gid to 65534:

$ cat /etc/passwd | grep nobody
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin

in /etc/fstab:

UUID=1EB89832B8980B03 /mnt/super ntfs rw,uid=65534,gid=65534 0 0

Also, you could find some info about mapping windows/linux users here. But I didn't try it and could not answer if it works as you want.

1
  • 1
    Thank You! This worked perfectly! May 7, 2020 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.