4

I've followed the ubuntu help docs for setting up NFSv4 on a server running Ubuntu 10.4LTS and now I'm trying to get Autofs (on ubuntu 10.10) to mount the exports, following these instructions. So far it doesn't work.

Where the docs say server -fstype=nfs4 server:/ I'm supposed to replace 'server' with my server's hostname right? If yes, should that be server-foo or server-foo.local?

# Sample /etc/auto.master file
#  --- comments snipped --8<--
+auto.master            # pre-existing
/nfs   /etc/auto.nfs    # added by me

.

# manually created /etc/auto.nfs
ubuntu-server.local   -fstype=nfs4   ubuntu-server.local:/

ls /nfs/ubuntu-server /nfs/ubuntu-server.local shows nothing. What's the next troubleshooting step?


[update 2011-feb-12] I followed the procedure outlined at Which to use NFS or Samba?. I've now verified that my server export is working because I can mount the nfs shares via /etc/fstab. Here is my config, server side:

/home/matt      192.168.1.0/255.255.255.0(rw,sync,no_subtree_check)
/home/shared    192.168.1.0/255.255.255.0(rw,sync,no_subtree_check)

And in client /etc/fstab:

ubuntu-server:/home/matt  /nfs/matt  nfs rw,hard,intr 0 0
ubuntu-server:/home/shared  /nfs/shared  nfs rw,hard,intr 0 0

followed by sudo mount /nfs/shared. (I also needed to add an entry to /etc/hosts so the server name would resolve to ip)

matt wilkie
  • 2,170

2 Answers2

2

If your server name is ubuntu-server, /nfs/tutu where to mount the nfs share, then in /etc/auto.nfs:

tutu -fstype=nfs4 ubuntu-server:/

and then run:

sudo invoke-rc.d autofs restart

ls /nfs/tutu
matt wilkie
  • 2,170
LionelR
  • 136
  • thank you for this suggestion. It did not lead to a solution for me, but I think I may have deeper network issues at play, for instance ping ubuntu-server does not resolve, I have to use ip. – matt wilkie Feb 12 '11 at 18:51
  • this finally works for me, though I followed a long and circuitous route to get here, so the solution may be incomplete. Part of it least involved hard coding the server ip into /etc/hosts – matt wilkie Mar 29 '11 at 05:06
2

Here's my auto.master file for reference :

/etc/auto.master

+auto.master
/smb /etc/auto.smb uid=1000,gid=1000,--timeout=300 --ghost

For my samba share, that's all I need to do to see my shares listed :

scaine@GroovyTosh:~$ ls /smb/core
Archive  Backups  Data  Live

Due to a bug in smbclient, I have to specify the UID and GID. The timeout is how long before autofs unmounts an unused share and the ghost option keeps previously created folders in place inside /smb even when the share is not available.

I can also browse my /smb by IP address (e.g. ls /smb/192.168.1.10).

In your case, you might want to try the /net option, instead of manually specifying your exports. So your auto.master would simply be :

+auto.master
/net /etc/auto.net --timeout=300 --ghost

Then after a sudo service autofs restart, try ls /net.

Scaine
  • 11,139
  • Thanks for helping. The /net line does nothing for me, however /smb does get me partway: after adding that and restarting autofsls /smb/192.168.1.123 shows the share names I expect, I just can't open any of them. – matt wilkie Jan 03 '11 at 04:22
  • Well that's weird. Your server must be configured for Samba then, as well as the NFS config you're trying to get working. Seeing the shares is a success - you just need to specify the correct /etc/auto.smb.192.168.1.123 file now to pass credentials to the samba server. – Scaine Jan 03 '11 at 10:45