0

Why I cannot change the ownership on mounting ntfs drive?

I give uid=1000,gid=1000, etc in my /etc/fstab file, but found it is not working. So I'm testing it out on command line:

root@host:~# mount | grep /mnt/tmp1 | wc
      0       0       0

root@host:~# mount -o uid=1000 /dev/nvme0n1p4 /mnt/tmp1/

root@host:~# mount | grep /mnt/tmp1 /dev/nvme0n1p4 on /mnt/tmp1 type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

root@host:~# umount /mnt/tmp1

root@host:~# mount -o user_id=1000 /dev/nvme0n1p4 /mnt/tmp1/

root@host:~# mount | grep /mnt/tmp1 /dev/nvme0n1p4 on /mnt/tmp1 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 21.10 Release: 21.10 Codename: impish

$ apt-cache policy mount mount: Installed: 2.36.1-8ubuntu1 Candidate: 2.36.1-8ubuntu2 Version table: 2.36.1-8ubuntu2 500 500 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 Packages *** 2.36.1-8ubuntu1 500 500 http://archive.ubuntu.com/ubuntu impish/main amd64 Packages 100 /var/lib/dpkg/status

Am I missing something? (This is Ubuntu 21.10 impish)
Why I cannot change the ownership on mounting ntfs drive?

xpt
  • 1,045
  • 2
    Linux and Microsoft have very different approaches to how access permissions are managed. This is like using Disney Bucks at Caesar’s Palace. Does the mounted device need to be NTFS? – matigo Nov 15 '21 at 23:44
  • 1
    You've shown that /mnt/tmp1 didn't have anything mounted on it, but didn't show that /dev/nvme0n1p4 isn't already mounted elsewhere. Is it? – muru Nov 15 '21 at 23:55
  • 1
    You didn't show the /etc/fstab line, either. – waltinator Nov 16 '21 at 00:18
  • No @muru, /dev/nvme0n1p4 isn't already mounted elsewhere. I didn't show but it isn't. Else, I'll get the error of Mount is denied because the NTFS volume is already exclusively opened. The volume may be already mounted – xpt Nov 16 '21 at 00:47
  • Does it matter @waltinator? and why? – xpt Nov 16 '21 at 01:02
  • Have you tried the steps that I posted in OP @Nmath? Try them then you'll know what you are asking are as irrelevant as posting what the content of my NTFS file system are. – xpt Nov 16 '21 at 13:42
  • Interesting, what type of "hardware" that you don't have to repeat the steps that I posted in OP? So you don't have NTFS file system at all? Then how come you are able to help on something that you have no experience of? The problem is not me refusing anything but you refusing to read and try what I posed. Once again, "you're all correct and what I'm asking is impossible". I'll stop responding to further conversations. End of discussion. – xpt Nov 16 '21 at 23:52

2 Answers2

0

Changing the ownership is absolutely possible. See this page: Mount NTFS partition at startup, with non-root user as owner and Change owner of internal hard drive partition from root to user

Basically, add uid=1000,gid=1000,permissions and possibly play with umask=000,nls=iso8859-1,users. Use mount -a to test without rebooting.

alchemy
  • 762
-1

NTFS is simply not capable of POSIX ownership and permissions, which is how permissions and ownership is handled in Ubuntu.

If you have a task that needs to store data on a file system with POSIX ownership or permissions, you cannot use a NTFS file system.

Nmath
  • 12,333
  • What do you say to https://askubuntu.com/questions/43570/? – xpt Nov 16 '21 at 05:52
  • I'm answering specifically how you ask about changing ownership under NTFS. To clarify, only the mount point is going to be on your root file system under Ubuntu. That's because the mount point itself is actually a file. But everything that is beyond that is stored within the NTFS file system and is not really located in your Ubuntu file system, even though the path is under /mnt/... For this reason, none of the files or directories in stored on a NTFS volume can contain the type of ownership and permission information that is used by Ubuntu. – Nmath Nov 16 '21 at 06:57
  • Oh, my, oh my, I think it is wise for me to stop our conversation right here, and let you believe that you're right, and what I'm asking is impossible. – xpt Nov 16 '21 at 13:44