Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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)

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

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
share|improve this answer
    
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 5:06
add comment

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.

share|improve this answer
    
Thanks for helping. The /net line does nothing for me, however /smb does get me partway: after adding that and restarting autofs`ls /smb/192.168.1.123` shows the share names I expect, I just can't open any of them. –  matt wilkie Jan 3 '11 at 4: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 3 '11 at 10:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.