I have a question about mount in Linux Fedora.I have a mount point inside my home directory. The mount point is at /home/user/project and in fstab I have added the line:/dev/mapper/fedora-proj /home/user/project ext4 defaults 1 2The directory /home/user/project has the file permissions 0755 and it is owned by user. But when I do 'mount -a', the directory owner gets changed to root and the permissions are 777.I know ext2/3/4 do not have uid= and gid= options, but why is the mounting point receives hard coded file permissions during mount and how can I change it?P.SThe test was made on Fedora 25. When I am doing the exact same procedure on Fedora 23 I see a different behavior: the mount directory permissions are changing to 755 (before mount it is 0777)
Mount permissions on Linux
fedora;mount;fstab
The permissions for the root of a mountpoint are stored on the mounted filesystem (it actually makes sense this way; otherwise, where would the permissions for the root directory / be stored?). You change them the normal way: chmod, chown, etc.Before mounting, you're seeing the permissions for the mountpoint directory on the parent filesystem. After mounting, you're seeing the permissions for the root of the mounted filesystem.Example: You have two filesystems:FS-A             FS-B/                /  /mnt             /file1    /foo           /file2  /etc           Note both of them have a topmost/root directory (/), as all (Unix) filesystems do. FS-A has has two subdirectories shown (/mnt and /etc) and /mnt has a subdirectory /mnt/foo. FS-B has two files, /file1 and /file2. Being Unix filesystems, all of these directories and files have a user, a group, and permissions. Now, let's make FS-A the root filesystem, and mount FS-B at /mnt/foo. We then get:/                   # FS-A /  /mnt              # FS-A /mnt    /foo            # FS-A /mnt/foo *or* FS-B /      /file1        # FS-B /file1      /file2        # FS-B /file2  /etc              # FS-A /etcNote how we have a choice of what /mnt/foo isit could be /mnt/foo from FS-A or / from FS-B. Both have exactly the same path. Unix's designers chose FS-B.PS: your fstab line is missing the filesystem type. Should come before the options (defaults).