Quantcast

Mounting NFS shares permanently

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Mounting NFS shares permanently

mac-23
Friends >>> I've been going round in circles with this, finding some old
bug reports that may be related, but no answers at all.

I mount NFS shares (served by a ReadyNAS) on my Ubuntu clients - all
five of which were, till recently, running 10.04.  As a means of getting
familiar with Unity, etc, I recently put 12.04 on to one machine.  (A
clean install, as the attempted upgrade a few weeks ago failed.)

Today, I got round to setting up the NFS shares on this 12.04 system in
my usual way:  create mount points in /media;  install portmap and
nfs-common;  lockdown portmap;  add the shares to fstab.

Of course, I discovered at once that portmap is deprecated, and rpcbind
installed instead.  So for the lockdown, I simply added "rpcbind : ALL"
to /etc/hosts.deny, and "rpcbind  : NFS server IP address" to
/etc/hosts.allow.  Otherwise, everything corresponds with what is
working under 10.04 on the other four machines.

But...  the shares on the 12.04 machine don't mount at start up.  And
when I do 'sudo mount -a' I get, for each of the shares,

mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

Of course, when I do 'sudo start statd' I get

start: Job is already running: statd

Has anyone solved this issue?  How do I get rpc.statd to start on boot?

(I should say that while I know enough to be able to follow a HowTo,
that's about as far as my skills go - so troubleshooting this for myself
is a bit of a nightmare!)

Any help will be most gratefully received!

mac

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

mac-23
On 10/05/12 16:10, mac wrote:
<snip>
> [NFS] shares on the 12.04 machine don't mount at start up.  And
> when I do 'sudo mount -a' I get, for each of the shares,
> mount.nfs: rpc.statd is not running but is required for remote locking...
> Of course, when I do 'sudo start statd' I get
> start: Job is already running: statd
> Has anyone solved this issue?  How do I get rpc.statd to start on boot?

I take it that, as no one has replied to my post, this is not a problem
for many.  Is that because I'm eccentric in using NFS?  Do folk mostly
prefer Samba for network shares?

Perhaps I should give up and use Samba instead.  Unless anyone has any
ideas about 12.04's NFS problem.

mac

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Simon Greenwood


On 11 May 2012 19:05, mac <[hidden email]> wrote:
On 10/05/12 16:10, mac wrote:
<snip>
[NFS] shares on the 12.04 machine don't mount at start up.  And

when I do 'sudo mount -a' I get, for each of the shares,
mount.nfs: rpc.statd is not running but is required for remote locking...

Of course, when I do 'sudo start statd' I get
start: Job is already running: statd
Has anyone solved this issue?  How do I get rpc.statd to start on boot?

I take it that, as no one has replied to my post, this is not a problem for many.  Is that because I'm eccentric in using NFS?  Do folk mostly prefer Samba for network shares?

Perhaps I should give up and use Samba instead.  Unless anyone has any ideas about 12.04's NFS problem.

Try mounting a share individually with mount -t nfs ip.ad.dr.es:/share /mountname but there is a bug that seems to fit your problem:

 
Across Linux machines, SSHFS  is a viable alternative - that's the SSH option in File | Connect to Server in Nautilus.

s/
--
Twitter: @sfgreenwood
"TBA are particularly glib"


--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

mac-23
On 11/05/12 19:36, Simon Greenwood wrote:
> Try mounting a share individually with mount -t nfs ip.ad.dr.es:/share
> /mountname but there is a bug that seems to fit your problem:
>
> https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/933575

Yes, that looks very similar to my experience.  But I see there's only
one poster, and nothing further since end of March.  :(

> Across Linux machines, SSHFS  is a viable alternative - that's the SSH
> option in File | Connect to Server in Nautilus.

Don't you have to do that manually on every machine every time you start
it?  I could do with the shares mounting automatically (if only because
the Thunderbird profile is on a network share).

As it looks like this may not get fixed in 12.04 any time soon, I think
I'll go back to using Samba (which may no longer have the problems with
unmounting at shutdown that chronically plagued it before, and caused me
to move to NFS in the first place.)

Thanks for taking the trouble to search out the bug report, and for your
suggestion.

mac

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Simon Greenwood


On 11 May 2012 20:17, mac <[hidden email]> wrote:
On 11/05/12 19:36, Simon Greenwood wrote:
Try mounting a share individually with mount -t nfs ip.ad.dr.es:/share
/mountname but there is a bug that seems to fit your problem:

https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/933575

Yes, that looks very similar to my experience.  But I see there's only one poster, and nothing further since end of March.  :(


Across Linux machines, SSHFS  is a viable alternative - that's the SSH
option in File | Connect to Server in Nautilus.

Don't you have to do that manually on every machine every time you start it?  I could do with the shares mounting automatically (if only because the Thunderbird profile is on a network share).

As it looks like this may not get fixed in 12.04 any time soon, I think I'll go back to using Samba (which may no longer have the problems with unmounting at shutdown that chronically plagued it before, and caused me to move to NFS in the first place.)

Thanks for taking the trouble to search out the bug report, and for your suggestion.


You're right, there are some cases where it wouldn't work and that would be likely to be one of them, although in theory if the share was mounted with a keypair rather than a password it should work.

To wander off, shared Thunderbird profiles is one of those things that should work like Firefox sync. I've occasionally thought about it for several years. It's reminded me that I was going to try with Ubuntu One.

s/

--
Twitter: @sfgreenwood
"TBA are particularly glib"


--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Tyler J. Wagner
In reply to this post by mac-23
On 2012-05-10 16:10, mac wrote:
> I mount NFS shares (served by a ReadyNAS) on my Ubuntu clients - all five
> of which were, till recently, running 10.04.  As a means of getting
> familiar with Unity, etc, I recently put 12.04 on to one machine.  (A clean
> install, as the attempted upgrade a few weeks ago failed.)

I don't have the same setup, but perhaps my notes can help. I use Ubuntu
server as a NAS and Ubuntu desktop as a client. The client mounts the NAS
via NFSv4 at boot via /etc/fstab. I used this guide:

https://help.ubuntu.com/community/SettingUpNFSHowTo

Does your NAS only support NFSv3?

> Today, I got round to setting up the NFS shares on this 12.04 system in my
> usual way:  create mount points in /media;  install portmap and
> nfs-common;  lockdown portmap;  add the shares to fstab.
>
> Of course, I discovered at once that portmap is deprecated, and rpcbind
> installed instead.  So for the lockdown, I simply added "rpcbind : ALL" to
> /etc/hosts.deny, and "rpcbind  : NFS server IP address" to
> /etc/hosts.allow.  Otherwise, everything corresponds with what is working
> under 10.04 on the other four machines.

My hosts.allow/deny look like so:

portmap mountd nfsd statd lockd rquotad : 192.168.1.10 192.168.1.11
portmap mountd nfsd statd lockd rquotad : ALL

Perhaps you need to list statd here?

Regards,
Tyler

--
"Offending fundamentalists isn't my goal – but if it is an inevitable
side-effect of defending human rights, so be it."
   -- Johann Hari

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Miia Ranta-2
In reply to this post by Simon Greenwood
On 11 May 2012 19:36, Simon Greenwood <[hidden email]> wrote:
> Across Linux machines, SSHFS  is a viable alternative - that's the SSH
> option in File | Connect to Server in Nautilus.

If the network both the Linux machines are in is secure enough, I
wouldn't swap NFS with SSHFS unless absolutely no other alternatives
are available (including CIFS) as it is noticeably slower in
comparison to non-encrypted sharing methods. YMMV with more powerful
hardware/platform than I had few years ago when I stumbled upon this.

Miia "Myrtti" Ranta
--
GCS/ED/FA/H/P/S/L/O d- s-:+ a31 C++ UL+ P+ L+++ E W+++ N+ o K+ w+(---)
!O M V? PS++ PE>$ Y+ PGP- t+ 5+++ X+ R tv- b+++ DI++++ D-- G e>+++ h-
r++ x?

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

mac-23
In reply to this post by Tyler J. Wagner
On 12/05/2012 00:08, Tyler J. Wagner wrote:
> I don't have the same setup, but perhaps my notes can help...

Thanks for going to the trouble of making suggestions about this
problem.  It's good of you to spend time on it.

> Does your NAS only support NFSv3?

I doubt the NFS version is the issue:  I've got four 10.04 systems
mounting these same NFS shares at startup perfectly correctly.  And I'm
not trying to set up a server:  just one 12.04 client;  so the procedure
ought simply to be

create mount points in /media;
install rpcbind and nfs-common;
lockdown rpcbind;
add the shares to fstab

> My hosts.allow/deny look like so:
>
> portmap mountd nfsd statd lockd rquotad : 192.168.1.10 192.168.1.11
> portmap mountd nfsd statd lockd rquotad : ALL

Because portmap is deprecated now, my hosts.deny file simple has
rpcbind : ALL

and hosts.allow has
rpcbind : <numeric ReadyNAS IP address>


But the problem is not that I'm locked out of the shares:  rather it's
that 'mount.nfs' appears to think that rpc.statd is not running (which
can't depend on what's in hosts.deny/allow, can it???).

> Perhaps you need to list statd here?

Mine is unedited - so it's the vanilla statd as installed in /etc/init.d
on a new system.


Anyway, I've set the shares up with CIFS until a solution to this issue
appears.  I hope this will happen magically, with the release of 12.04.1
and the silkily glitch-free automatic upgrade of my existing 10.04
systems to 12.04.  ;-)

(I guess you must have had success with a routine upgrade from 10.04 or
11.10, given that you're still running portmap, for which apt-get now
substitutes rpcbind?)

I must say, I'm a bit surprised that no one else here has experienced
this problem with setting up NFS on 12.04 (and - because there are real
engineers here who know acres more than me - solved it).

Again, many thanks for your suggestions about this.  Much appreciated!

mac




--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Raf Czlonka
On Sat, May 12, 2012 at 10:52:10AM BST, mac wrote:
> But the problem is not that I'm locked out of the shares:  rather
> it's that 'mount.nfs' appears to think that rpc.statd is not running
> (which can't depend on what's in hosts.deny/allow, can it???).

I'd start with blank hosts.{allow,deny} to rule it out and restart all
the relevant services.

It would be good if you could post /etc/fstab entries for your NFS
mounts as well.

Have you checked whether there's anything interesting in the logs?

To those who suggested SSHFS or SMB/CIFS as viable replacements, well
they're not as both require user authentication to mount.

SMB/CIFS share can be mounted automatically at user's logon but is
anyone here using it form user's $HOME, without modifying cifs kernel
module that is?

BTW, I'm running Ubuntu 10.04 LTS with users' $HOME and data shares on
NFS at my work place, haven't tested 12.04 yet but will try doing it
next week.

Regards,
--
Raf

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Tyler J. Wagner
In reply to this post by mac-23
On 2012-05-12 10:52, mac wrote:
>> Does your NAS only support NFSv3?
>
> I doubt the NFS version is the issue:  I've got four 10.04 systems mounting
> these same NFS shares at startup perfectly correctly.

I asked that because the Ubuntu Setup guide I linked to refers to NFSv4. If
you follow that exactly, your setup will work.

My setup is upgraded from 10.10 (through each intermediate release) on the
server, and is a new install on the client.

>> portmap mountd nfsd statd lockd rquotad : 192.168.1.10 192.168.1.11
>> portmap mountd nfsd statd lockd rquotad : ALL
>
> Because portmap is deprecated now, my hosts.deny file simple has
> rpcbind : ALL

Ah, I see I need to add rpcbind to that list myself. However, other daemons
including statd are running, so they must be on the list too. Try adding
all of the above to your hosts.{allow,deny}.

> But the problem is not that I'm locked out of the shares:  rather it's that
> 'mount.nfs' appears to think that rpc.statd is not running (which can't
> depend on what's in hosts.deny/allow, can it???).

Or it's not able to access the daemon because it is denied by default? Not
sure about that behaviour.

> I must say, I'm a bit surprised that no one else here has experienced this
> problem with setting up NFS on 12.04 (and - because there are real
> engineers here who know acres more than me - solved it).

As I said, using the Ubuntu setup guide works fine. Try following it before
using your own steps, or switching to CIFS.

Regards,
Tyler

--
"You may not like Grandma's Thanksgiving turkey. It may be overcooked
and dry - and her stuffing salty and studded with rubbery pellets of
giblet you find unpalatable in the extreme. You may not even like turkey
at all. But it's Grandma's turkey. And you are in Grandma's house. So
shut the fuck up and eat it."
   -- Anthony Bourdain, on the "Grandma Rule" for travellers

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

mac-23
On 12/05/12 14:03, Tyler J. Wagner wrote:
> On 2012-05-12 10:52, mac wrote:
>>  Because portmap is deprecated now, my hosts.deny file simple has
>>  rpcbind : ALL

Doh!  That was the mistake!  In fact, portmap is included in the rpcbind
package that apt-get substitutes when you do

sudo apt-get install portmap nfs-common

But you *don't* use 'rcpbind' in the /etc/hosts.deny file;  use
  portmap : ALL
as previously.

Everything working now - after only a day and a half of going round in
circles!

Thanks again, Tyler, for taking the trouble to offer help.

mac



--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Tyler J. Wagner
On 2012-05-13 19:59, mac wrote:

> Doh!  That was the mistake!  In fact, portmap is included in the rpcbind
> package that apt-get substitutes when you do
>
> sudo apt-get install portmap nfs-common
>
> But you *don't* use 'rcpbind' in the /etc/hosts.deny file;  use
>  portmap : ALL
> as previously.
>
> Everything working now - after only a day and a half of going round in
> circles!
>
> Thanks again, Tyler, for taking the trouble to offer help.

Excellent, Mac. I'm glad I could help.

One of these days I'll get around to blogging my HTPC + NFS NAS setup. :)

Regards,
Tyler

--
"Cheops' Law: Nothing ever gets built on schedule or within budget."
   -- Lazarus Long, "Time Enough for Love", by Robert A. Heinlein

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

MidnightWatcher
This post has NOT been accepted by the mailing list yet.
In reply to this post by mac-23
Guys, I think I have the same problem, but being a bit of a noob I'm not sure exactly what I need to do. How do I get Ubuntu 12.04 to automatically mount my /export/media? I can mount it using Webmin 1.580 and it works fine, but when I reboot it doesn't automatically mount at all.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

MidnightWatcher
In reply to this post by Tyler J. Wagner
Guys, I think I have the same problem, but being a bit of a noob I'm not sure exactly what I need to do. How do I get Ubuntu 12.04 to automatically mount my /export/media? I can mount it using Webmin 1.580 and it works fine, but when I reboot it doesn't automatically mount at all.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Ron Wellsted
On 27/05/12 03:42, MidnightWatcher wrote:
> Guys, I think I have the same problem, but being a bit of a noob I'm not sure
> exactly what I need to do. How do I get Ubuntu 12.04 to automatically mount
> my /export/media? I can mount it using Webmin 1.580 and it works fine, but
> when I reboot it doesn't automatically mount at all.
>
Hi,
I append the relevant lines to my /etc/fstab file.  e.g.:

nfs.srv.ip.adr:/home/common /home/common nfs defaults 0 0

--
Ron Wellsted
[hidden email] http://www.wellsted.org.uk
N 52.567623, W 2.136111 Linux Counter No. 202120

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Mounting NFS shares permanently

Tyler J. Wagner
On 2012-05-27 18:45, Ron Wellsted wrote:
> I append the relevant lines to my /etc/fstab file.  e.g.:
>
> nfs.srv.ip.adr:/home/common /home/common    nfs    defaults 0 0

"noatime" is better than "defaults".

http://gnorman.org/index.php?option=com_content&view=article&id=154&Itemid=164

Or go it a step further:

http://www.techrepublic.com/blog/opensource/tuning-nfs-for-better-performance/64

Regards,
Tyler

--
"Scientific theories can be altered by publishing a paper with
reproducible results, and political principles can be changed every two
to four years with an election, but if you want to change religious
principles you usually have to wait for a whole generation of clergy
to die."
   -- Soren Ragsdale

--
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/
Loading...