Why does a file with a permission of 0664/-rw-rw-r-- become 0777/-rwxrwxrwx when copied onto an external hard drive? The external drive is NTFS-formatted - does this matter?
- 1NTFS does not honor linux permissionseyoung100– eyoung1002021-06-11 03:04:17 +00:00Commented Jun 11, 2021 at 3:04
1 Answer
It does matter, because the set of attributes and metadata supported for a file vary widely across the various types of filesystems.
Specifically, the file-system permissions (and ownership, for that) you are referring to here originate in the traditional Unix user management framework and are therefore a feature of the filesystems developed for/usually used in Unix/Linux operating systems, like the EXT family of filesystems. They are stored in the inode, a special low-level data block describing a filesystem data structure.
NTFS comes from the Windows world where users and permissions are handled very differently; in particular, NTFS uses access-control lists to determine which user may do what with a certain file (1). So, when an NTFS drive is mounted on a Linux/Unix system, the file system driver has to "translate" the properties of that drive into something understandable to the Linux tools for handling filesystems, which sometimes can mean substituting data that simply isn't present on the actual fileystem with default values.
So, since
- NTFS has no notion of your local users, and
- it doesn't control access via ownership/group membership
when copying a file from a Unix/Linux-type file system to an NTFS filesystem will lead to a loss of metadata which is then substituted with a default "everyone can do everything".
See also
- External drive chmod does nothing
- Will permission bits set on a directory on an external hard drive be respected under Windows?
(1)and although filesystems used in the Linux world now also support them, they are added "on top" of the traditional permissions, which still form the basis for access handling
- Thanks. I've also done some more readings and found out that the filesystem format (in this case NTFS) is definitely important.ajthealchemist– ajthealchemist2021-07-09 07:48:00 +00:00Commented Jul 9, 2021 at 7:48