Score:0

The random behaviour of ownership change after mounting in Linux

cn flag

So I do know that by default when we mount; the user/group ownership is set to uid=0=gid when belongs to the root and I read that in the mount man page.

The weird thing is I am mounting an NFS share in /oradata which is a directory that I have created as follows:

[root@sandbox ~]# mkdir /oradata
[root@sandbox ~]# chown oradata:oinstall /oradata

Then am doing the NFS mount:

[root@sandbox ~]# mount -t nfs -o rw,hard,rsize=1048576,wsize=1048576,vers=3,tcp ip_address:/oracle_test  /oradata

Now after the mount the ownership of /oradata sometimes changes to root:root and sometimes it stays as oracle:oinstall as pre-mounting.

My question is why this behavior is random? Shouldn't it always change ownership after mounting to root?

P.S: I am also using Azure Volume Storage for NFS.

Score:0
np flag

the user/group ownership is set to uid=0=gid when belongs to the root and I read that in the mount man page.

I think this is an incorrect assumption. Where did you found this information? When you mount some filesystem, original directory content & permissions becomes "invisible". Instead mounted filesystem (even for network ones) permissions takes place if target supports them (as NFS do). I.e. the permissions you see after mounting are the ones which are set on target NFS server export.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.