March 23, 2023, 2:31pm
If I copy a file from my home folder to a shared NTFS drive, the copy is owned by root. I’m not using sudo or anything. I get the same result if I use Nemo to copy.
Is it something wrong with he way the drive is mounted?
cp testfile /mnt/M/
ls -l testfile
-rw-r--r-- 1 me me 0 Mar 23 14:18 testfile
ls -l /mnt/M/testfile
-rwxrwxrwx 1 root root 0 Mar 23 14:19 /mnt/M/testfile
This is in my fstab:
LABEL=m2dat /mnt/M ntfs user,noatime 0 0
March 23, 2023, 2:49pm
The Linux concepts of ownership and permissions don’t apply to NTFS. This means that chown and chmod won’t work for changing the ownership or permissions for NTFS.
If I am not mistaken, an NTFS partition will mount with owner:group as root but with permissions 777 as can be shown by
That means everybody can read-write-execute any files.
However you could set Linux compatible permissions via fstab:
March 23, 2023, 3:45pm
So permissions are not part of the file itself, they’re managed by the file system? makes sense, I just never thought about it.
Interestingly, if I copy the file back to its original location, it gets assigned
-rwxr-xr-x me me, which sounds reasonable if it’s lost the original permission info.
i’ve also found that wrapping the file in an archive seems to preserve the permissions of the files inside somehow (just tried with
I’ll look into your link for Windows sharing, that sounds useful.
March 23, 2023, 5:08pm
You can use options uid, gid, dmask and fmask in
/etc/fstab for the
March 25, 2023, 5:08pm
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.