Skip to contentSkip to conversation

Automount FS re-exported via NFS fails

DISCUSSION David D. Hagood 3 participants 3 messages Nov 12, 2001 – Nov 13, 2001

lore
Share & tools
lore
#0 lore raw

I have a situation where I have a set of file systems that are automounted by the automount file system in 2.4.x under /misc. I'd like to make those file systems available via NFS from machine.

In the ideal case, I would have something like this in /etc/exports:
/misc 10.0.0.0/255.0.0.0 (rw)

Thus, a client machine could mount server:/misc as /somedir, and then cause a filesystem to be mounted by accessing /somedir/some_auto_filesystem.

However, that doesn't work, as the NFSD seems to want to do a getfh() IOCTL on the auto file system, and autofs doesn't seem to support that IOCTL.

(I can work around this by explicitly exporting each possible file system under /misc, and allowing clients to mount them directly, but this isn't the greatest solution.)

First, is anybody working on this? If not, I may try my hand at it.

Second, if nobody is working on it, anybody have pointers on a good file system to model a getfh() for autofs on?

Please CC me, as I'm not currently subscribed to the list.

#include <std_disclaimer>

#1 lore raw
Quoted 4 lines · David D. Hagood

I have a situation where I have a set of file systems that are automounted by the automount file system in 2.4.x under /misc. I'd like to make those file systems available via NFS from machine.

Quoted 8 lines

In the ideal case, I would have something like this in /etc/exports:
/misc 10.0.0.0/255.0.0.0 (rw)

Thus, a client machine could mount server:/misc as /somedir, and then cause a filesystem to be mounted by accessing /somedir/some_auto_filesystem.

However, that doesn't work, as the NFSD seems to want to do a getfh() IOCTL on the auto file system, and autofs doesn't seem to support that IOCTL.

NFS don't see mountpoints. It's a strange feature but it is really done that way. I can mount my /dev/hdc on a non-empty dir in NFS exported tree and I see hdc filesystem when browsing it locally, but NFS clients still see old dir contents - they don't see mounted drive there!

I don't know whether it's bug or a feature.

Every automounted dir under automount mountpoint is a mountpoint too, that's why you can't export them via NFS.
--
vda

#2 lore raw
In reply to David D. Hagood
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == vda <[email protected]> writes:

> NFS don't see mountpoints. It's a strange feature but it is > really done that way. I can mount my /dev/hdc on a non-empty > dir in NFS exported tree and I see hdc filesystem when browsing > it locally, but NFS clients still see old dir contents - they > don't see mounted drive there!

Actually, knfsd can see mountpoints: you just have to explicitly tell it which mountpoints it is allowed to cross by using the 'nohide' export option. (man 5 exports)

For instance:

/foo client1
/foo/bar client1(nohide)

Should ensure that client1 can mount /foo, and expect to be able to see the filesystem on /foo/bar as well...

> I don't know whether it's bug or a feature.

It is an action that is recommended in the RFCs. If you didn't have this, then you could end up with nasty things happening, for instance, in the case where the server accidentally re-exports another NFS partition.
In addition you quickly end up with basic wierdness such as duplicate inode numbers and the like on the client, since that sees the whole thing as 1 partition.

Cheers,
Trond