| View previous topic :: View next topic |
| Author |
Message |
thekeymaker Tux's lil' helper


Joined: 15 Aug 2010 Posts: 104
|
Posted: Tue Jul 10, 2012 10:26 pm Post subject: [SOLVED] nfs containing mount points |
|
|
I have been looking for an answer the last few day and was wondering if anyone knows this.
I have a media server that has the following directories:
/share/music
/share/movies
/share/photos
I have each of these directories mounted to different hard drives when the server boots in fstab.
I also have nfs running and sharing /share which I can successfully mount on another machine. Only problem is that it doesn't show the files in each of these locally mounted directories.
I did find on the ubuntu forms this post:
http://ubuntuforums.org/showthread.php?t=1165716
saying:
"If an exported directory has mount points under it, files under those mount points will not be accessible by NFS clients. So if you exported the root directory / and has a separate filesystem mounted at /home , you would need to also export /home and clients would need to mount it in order to see the files under it. "
Is this correct or is there a way I can have my local mounted file-systems show up?
Ideas? 
Last edited by thekeymaker on Wed Jul 11, 2012 10:13 pm; edited 2 times in total |
|
| Back to top |
|
 |
Hu Watchman

Joined: 06 Mar 2007 Posts: 7610
|
Posted: Wed Jul 11, 2012 12:53 am Post subject: |
|
|
| That is correct. Is there some reason you do not want to follow the advice given in the quoted passage? |
|
| Back to top |
|
 |
thekeymaker Tux's lil' helper


Joined: 15 Aug 2010 Posts: 104
|
Posted: Wed Jul 11, 2012 2:44 am Post subject: |
|
|
| Hu wrote: | | That is correct. Is there some reason you do not want to follow the advice given in the quoted passage? |
No. I was just wondering if in never versions of nfs that there was a way to make this work, since it is an older post. Or what others might have done in the same situation, like maybe linking the files or using LVM to make all the media drives seem like one. That last one might be a stretch. But anyway. Thank you for the reply Hu! I guess I will have to try some other things to achieve what I am looking for. |
|
| Back to top |
|
 |
toralf Advocate


Joined: 01 Feb 2004 Posts: 2411 Location: Hamburg/Germany
|
Posted: Wed Jul 11, 2012 8:50 am Post subject: |
|
|
| NFS generally prevents a NFS user from re-exporting and therefore exposing contents of directories which was exported by the original NFS exporter to (only) a dedicated group of clients AFAIK. |
|
| Back to top |
|
 |
thekeymaker Tux's lil' helper


Joined: 15 Aug 2010 Posts: 104
|
Posted: Wed Jul 11, 2012 10:12 pm Post subject: |
|
|
Yay I found a solution!!!
Many thanks first to those who took the time to respond.
It is possible to mount a nfs that has directories that are mounted on the server side. What you have to do is, using my example above, not only add to your /etc/exports file:
| Code: | | /share ip (nohide,rw,sync,no_root_squash,no_subtree_check) |
but also add this:
| Code: |
/share/music ip (nohide,rw,sync,no_root_squash,no_subtree_check)
/share/movies ip (nohide,rw,sync,no_root_squash,no_subtree_check)
/share/photos ip (nohide,rw,sync,no_root_squash,no_subtree_check) |
The nohide is a critical part! Now on the client like normal do
| Code: | | mount (ip server):/share (mount point) |
and you can see the files! Magic! |
|
| Back to top |
|
 |
Hu Watchman

Joined: 06 Mar 2007 Posts: 7610
|
Posted: Thu Jul 12, 2012 1:54 am Post subject: |
|
|
| thekeymaker wrote: | also add this:
| Code: | /share/music ip (nohide,rw,sync,no_root_squash,no_subtree_check)
/share/movies ip (nohide,rw,sync,no_root_squash,no_subtree_check)
/share/photos ip (nohide,rw,sync,no_root_squash,no_subtree_check) |
The nohide is a critical part! | You neglected to quote the relevant section of the manpage that explains why you should think carefully before doing this: | man 5 exports: | nohide This option is based on the option of the same name provided in
IRIX NFS. Normally, if a server exports two filesystems one of
which is mounted on the other, then the client will have to
mount both filesystems explicitly to get access to them. If it
just mounts the parent, it will see an empty directory at the
place where the other filesystem is mounted. That filesystem is
"hidden".
Setting the nohide option on a filesystem causes it not to be
hidden, and an appropriately authorised client will be able to
move from the parent to that filesystem without noticing the
change.
However, some NFS clients do not cope well with this situation
as, for instance, it is then possible for two files in the one
apparent filesystem to have the same inode number.
This option can be very useful in some situations, but it should
be used with due care, and only after confirming that the client
system copes with the situation effectively. |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|