Linux – nfs autofs automount of exported filesystems is empty on nfs server

autofsautomountlinuxnfsredhat

I am having issues with empty nfs automounts on the nfs server itself.

I'm running RHEL5.7 64bit exporting 4 directories as follows:

/export/site/server13 *(fsid=0,rw,sync,crossmnt)
/export/site/server13/u *(rw,sync)
/export/site/server13/unix *(rw,sync)
/export/site/server13/proj *(rw,sync)

The first location is on the root filesystem.

u, unix and proj are separate mounted filesystems.

I'm using NIS to supply automount maps to each server for the /site mountpoint.

auto.site.indirect:

server13        server13:/export/site/server13 \
/u              server13:/export/site/server13/u \
/unix           server13:/export/site/server13/unix \
/proj           server13:/export/site/server13/proj

On all the other servers in the NIS environment these exports automount with no problem to /site/server13/u etc, however on server13 itself the u, proj and unix directories are empty.

Any ideas please?

Update: I enabled logging for autofs which shows when I cd to /site/server13/u the server mounts /site/server13 but not the u share. It's as it it doesn't even try to mount the u share.

from /var/log/messages:

Jan 17 11:14:41 server13 automount[24326]: handle_packet: type = 3
Jan 17 11:14:41 server13 automount[24326]: handle_packet_missing_indirect: token 21, name server13, request pid 3385
Jan 17 11:14:41 server13 automount[24326]: attempting to mount entry /site/server13
Jan 17 11:14:41 server13 automount[24326]: lookup_mount: lookup(file): looking up server13
Jan 17 11:14:41 server13 automount[24326]: lookup_mount: lookup(file): server13 -> server13:/export/site/server13
Jan 17 11:14:41 server13 automount[24326]: parse_mount: parse(sun): expanded entry: server13:/export/site/server13
Jan 17 11:14:41 server13 automount[24326]: parse_mount: parse(sun): gathered options:
Jan 17 11:14:41 server13 automount[24326]: parse_mount: parse(sun): dequote("server13:/export/site/server13") -> server13:/export/site/server13
Jan 17 11:14:41 server13 automount[24326]: parse_mount: parse(sun): core of entry: options=, loc=server13:/export/site/server13
Jan 17 11:14:41 server13 automount[24326]: sun_mount: parse(sun): mounting root /site, mountpoint server13, what server13:/export/site/server13, fstype nfs, options (null)
Jan 17 11:14:41 server13 automount[24326]: mount_mount: mount(nfs): root=/site name=server13 what=server13:/export/site/server13, fstype=nfs, options=(null)
Jan 17 11:14:41 server13 automount[24326]: mount_mount: mount(nfs): calling mkdir_path /site/server13
Jan 17 11:14:41 server13 automount[24326]: mount_mount: mount(nfs): server13 is local, attempt bind mount
Jan 17 11:14:41 server13 automount[24326]: mount_mount: mount(bind): calling mkdir_path /site/server13
Jan 17 11:14:41 server13 automount[24326]: mount_mount: mount(bind): calling mount --bind -s  -o defaults /export/site/server13 /site/server13
Jan 17 11:14:41 server13 automount[24326]: mount_mount: mount(bind): mounted /export/site/server13 type bind on /site/server13
Jan 17 11:14:41 server13 automount[24326]: dev_ioctl_send_ready: token = 21
Jan 17 11:14:41 server13 automount[24326]: mounted /site/server13

Best Answer

I believe I've solved it.

auto.master refers to: /site /etc/auto_site_indirect

Previously this file contained:

thishost  -rw  server13:/export/site/server13
server13  -rw  server13:/export/site/server13
+auto.site.indirect

Now to manage the submounts it looks like this:

thishost  -rw  server13:/export/site/server13
*         -fstype=autofs,-Dhost=& file:/etc/auto.site.submounts

auto.site.submounts file:

*         server13:/export/site/server13/&

This method appears to be necessary for nfs submounts of mounted filesystems. Obviously I need a new indirect NIS map for /site, for server13 alone, that doesn't have the lines for server13 since they're configured locally now.

Related Topic