You are not logged in.

#1 2010-06-23 11:40:49

the_mat
Member
Registered: 2010-01-30
Posts: 8

hide subdirectories in NFS exports

Hi,

on my server I have
/data/subA
/data/subB
/data/subC
/data/subD
/data/subE

I exported /data via NFS and everything works great.
My problem is, that I do not wish to export subD.

All have same permissions, which I can't change, because the server needs to be able to access subD itself.

Also, since there are actually more than those 5 subdirectories, I'd like to avoid setting up individual exports for each subdirectory.

The ideal solution for me would be to continue exporting just "/data" but somehow excluding that one subdirectory..
I checked "man exports" and google but couldn't find anything useful.


So, I faithfully turn to you. smile

Mat

Offline

#2 2010-06-23 15:22:42

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: hide subdirectories in NFS exports

create another directory, and symlink/hardlink your subdirectories inside it, and then export that folder over nfs.

Offline

#3 2010-06-23 18:35:44

the_mat
Member
Registered: 2010-01-30
Posts: 8

Re: hide subdirectories in NFS exports

never would have thought about that! thx man!


just one small thing:
when the client mounts the share, it can still see the symlink, thus it knows, such a directory exists.
some way around that?

even if it's not possible, that's a great solution you posted there



Mat

Offline

#4 2010-06-23 21:16:22

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: hide subdirectories in NFS exports

i have checked articles on nfs and symlinks, and found out that they most likely wont work as the symlinks so resolved are done by the client only, and not by the server, but if it does work for you, please let me know. on the other hand, this symlink setup does work well with samba so you can try using that if nfs doesnt work out.

Offline

#5 2010-06-23 23:57:53

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: hide subdirectories in NFS exports

Symlinks didn't work for me with NFS on a similar matter. I use samba instead now, too.


no place like /home
github

Offline

#6 2010-06-24 08:13:29

the_mat
Member
Registered: 2010-01-30
Posts: 8

Re: hide subdirectories in NFS exports

Sin.citadel wrote:

i have checked articles on nfs and symlinks, and found out that they most likely wont work as the symlinks so resolved are done by the client only, and not by the server, but if it does work for you, please let me know. on the other hand, this symlink setup does work well with samba so you can try using that if nfs doesnt work out.

and that's what's helping me now!

on the server, I created a symlink under /data named subD but pointing to /myhiddendir.
When mounting /data on the client, the symlink is still there, but since the nfs-mount is treated like a local directory, it points to /myhiddendir ON THE CLIENT as well. So, the contents of "subD" is not exported and that's exactly what I wanted.


I guess that was the problem for demian, he would have needed to export (and mount on the client) /myhiddendir as well

Offline

Board footer

Powered by FluxBB