Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have an /etc/exports file like this:


Do the two exports work independently of one another or can conflicts occur? For instance, if I mount /home and /home/fred, what will happen? If I unmount /home, will /home/fred stay mounted?


share|improve this question
Could you explain what you are trying to accomplish? –  sciurus Apr 30 '11 at 0:52

2 Answers 2

The first line doesn't grant the right to mount /home/fred, it only specifies the one mount point. The second line is independent of the first. Where you mount them to will determine inheritance issues.

share|improve this answer
The first line does grant the right to mount /home/fred if /home and /home/fred are part of the same file system. –  Jeff Strunk Apr 30 '11 at 13:07
@Jeff, no, by default the first line will not let you mount /home/fred. You can mount /home, and access 'fred' by that. But that's different from what I said. –  Chris S Apr 30 '11 at 15:09
Jeff is right. Even if only /home was exported, you could mount just /home/fred if you wanted to. I just verified this on two RHEL 5.6 systems. –  sciurus Apr 30 '11 at 17:43

Let's call your nfs server Let's say that on it there are two directories in /home

  • /home/fred, owned by the user and group numbered 500
  • /home/bob, owned by the user and group numbered 1000

Let's say that on, you have three empty directories

  • /allhome
  • /justbob
  • /justfred

If you mounted on /allhome, you would be able to see all the contents of on /allhome, i.e. /allhome/bob and /allhome/fred. Since you enabled root_squash and set anonuid and anongid to 500, if the root user attempted to access anything under /allhome, they would do so with the access rights that the user with id 500 or a user in group 500 on has. For example, if /allhome/bob/.profile had the permissions -rw-r-----, root would be able to read and write to it. If /allhome/fred/.profile had the permissions -rw-r-----, root would not be able to access it.

Even though you did not explicitly export /home/bob, since it a subdirectory of a directory that you did export you could mount on /justbob. This would use the same export options you specified for /home.

Even though /home/fred is a subdirectory of another directory you exported, since you explicitly exported it when you mount it the export options you specified for it will take affect. This means that if you mounted on /justfred, anonuid and anongid would be set to 1000. The root user would be able to read and write /justfred/.profile. This would not effect their inability to access the same file through the path /allhome/fred/.profile.

What if you mounted on /allhome/fred? That would mask the contents of /allhome/fred from the export and show the contents from the export. In this case, the difference wouldn't be readily apparent, since the files being accessed are the same. However, the export options are not the same. root would now access /allhome/fred with uid and gid of 1000. Now they would be able to read and write /home/fred/.profile.

If you tried to unmount /allhome at this point, you would get an error that the device is busy. You would have to unmount /allhome/fred first.

share|improve this answer
Perhaps it has to do with NFS4 vs earlier versions, but in all the testing I've done, the /home/fred export line is completely and utterly ignored, as long as, on the server, /home/fred is on the same filesystem as /home –  Cheetah Jan 22 '13 at 23:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.