* [gentoo-user] Debugging NFS mounts
@ 2023-11-15 16:29 Peter Humphrey
2023-11-15 17:04 ` Alan McKinnon
2023-11-16 20:38 ` Marco Rebhan
0 siblings, 2 replies; 10+ messages in thread
From: Peter Humphrey @ 2023-11-15 16:29 UTC (permalink / raw
To: gentoo-user
Hello list,
My little server needs help with compiling, so I NFS-export /var (which has
its own partition) to a chroot on my workstation. I mount all the partitions
on both server and workstation. Then when I chroot, env-update hangs for ever.
Well, over an hour anyway.
Is it possible to export /var in this way? I can't see anything else wrong.
--
Regards,
Peter.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Debugging NFS mounts
2023-11-15 16:29 [gentoo-user] Debugging NFS mounts Peter Humphrey
@ 2023-11-15 17:04 ` Alan McKinnon
2023-11-15 23:42 ` Peter Humphrey
2023-11-16 20:38 ` Marco Rebhan
1 sibling, 1 reply; 10+ messages in thread
From: Alan McKinnon @ 2023-11-15 17:04 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 582 bytes --]
On Wed, Nov 15, 2023 at 6:29 PM Peter Humphrey <peter@prh.myzen.co.uk>
wrote:
> Hello list,
>
> My little server needs help with compiling, so I NFS-export /var (which
> has
> its own partition) to a chroot on my workstation. I mount all the
> partitions
> on both server and workstation. Then when I chroot, env-update hangs for
> ever.
> Well, over an hour anyway.
>
> Is it possible to export /var in this way? I can't see anything else wrong.
>
Did you run mount inside the chroot or outside of it?
--
Alan McKinnon
alan dot mckinnon at gmail dot com
[-- Attachment #2: Type: text/html, Size: 1030 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Debugging NFS mounts
2023-11-15 17:04 ` Alan McKinnon
@ 2023-11-15 23:42 ` Peter Humphrey
0 siblings, 0 replies; 10+ messages in thread
From: Peter Humphrey @ 2023-11-15 23:42 UTC (permalink / raw
To: gentoo-user
On Wednesday, 15 November 2023 17:04:27 GMT Alan McKinnon wrote:
> On Wed, Nov 15, 2023 at 6:29 PM Peter Humphrey <peter@prh.myzen.co.uk>
>
> wrote:
> > Hello list,
> >
> > My little server needs help with compiling, so I NFS-export /var (which
> > has
> > its own partition) to a chroot on my workstation. I mount all the
> > partitions
> > on both server and workstation. Then when I chroot, env-update hangs for
> > ever.
> > Well, over an hour anyway.
> >
> > Is it possible to export /var in this way? I can't see anything else
> > wrong.
>
> Did you run mount inside the chroot or outside of it?
Outside. That's how it's worked everywhere else.
--
Regards,
Peter.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Debugging NFS mounts
2023-11-15 16:29 [gentoo-user] Debugging NFS mounts Peter Humphrey
2023-11-15 17:04 ` Alan McKinnon
@ 2023-11-16 20:38 ` Marco Rebhan
2023-11-17 16:44 ` Peter Humphrey
1 sibling, 1 reply; 10+ messages in thread
From: Marco Rebhan @ 2023-11-16 20:38 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]
On Wednesday, 15 November 2023 17:29:19 CET Peter Humphrey wrote:
> Hello list,
>
> My little server needs help with compiling, so I NFS-export /var (which has
> its own partition) to a chroot on my workstation. I mount all the partitions
> on both server and workstation. Then when I chroot, env-update hangs for
> ever. Well, over an hour anyway.
>
> Is it possible to export /var in this way? I can't see anything else wrong.
I don't see why it shouldn't work, but there's a couple commands I use to
debug NFS. They're not *great*, but they work.
I haven't used Gentoo in a while so I forget exactly what env-update does, but
I assume mounting the network share works successfully and this is just a
command that accesses /var.
You can use these commands to make the kernel driver output debugging
information to dmesg.
On the client:
> # rpcdebug -m nfs -s all
On the server:
> # rpcdebug -m nfsd -s all
On both sides, if the others don't give useful info, this is for the lower
level protocol:
> # rpcdebug -m rpc -s all
Then, try running the command again. It will spew a lot of info but hopefully
you can figure out from it what's going on.
-Marco :-)
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Debugging NFS mounts
2023-11-16 20:38 ` Marco Rebhan
@ 2023-11-17 16:44 ` Peter Humphrey
2023-11-18 7:29 ` Peter Humphrey
0 siblings, 1 reply; 10+ messages in thread
From: Peter Humphrey @ 2023-11-17 16:44 UTC (permalink / raw
To: gentoo-user
On Thursday, 16 November 2023 20:38:45 GMT Marco Rebhan wrote:
> On Wednesday, 15 November 2023 17:29:19 CET Peter Humphrey wrote:
> > Hello list,
> >
> > My little server needs help with compiling, so I NFS-export /var (which
> > has
> > its own partition) to a chroot on my workstation. I mount all the
> > partitions on both server and workstation. Then when I chroot, env-update
> > hangs for ever. Well, over an hour anyway.
> >
> > Is it possible to export /var in this way? I can't see anything else
> > wrong.
>
> I don't see why it shouldn't work, but there's a couple commands I use to
> debug NFS. They're not *great*, but they work.
>
> I haven't used Gentoo in a while so I forget exactly what env-update does,
> but I assume mounting the network share works successfully and this is just
> a command that accesses /var.
>
> You can use these commands to make the kernel driver output debugging
> information to dmesg.
>
> On the client:
> > # rpcdebug -m nfs -s all
>
> On the server:
> > # rpcdebug -m nfsd -s all
>
> On both sides, if the others don't give useful info, this is for the lower
>
> level protocol:
> > # rpcdebug -m rpc -s all
>
> Then, try running the command again. It will spew a lot of info but
> hopefully you can figure out from it what's going on.
I'll try that - thanks.
--
Regards,
Peter.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Debugging NFS mounts
2023-11-17 16:44 ` Peter Humphrey
@ 2023-11-18 7:29 ` Peter Humphrey
2023-11-19 0:30 ` William Kenworthy
0 siblings, 1 reply; 10+ messages in thread
From: Peter Humphrey @ 2023-11-18 7:29 UTC (permalink / raw
To: gentoo-user
On Friday, 17 November 2023 16:44:29 GMT I wrote:
> I'll try that - thanks.
Damn fool - it was a firewall problem on the server. For some reason, the NFS
destination port has changed.
Sorry for the noise.
--
Regards,
Peter.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Debugging NFS mounts
2023-11-18 7:29 ` Peter Humphrey
@ 2023-11-19 0:30 ` William Kenworthy
2023-11-19 15:12 ` Peter Humphrey
0 siblings, 1 reply; 10+ messages in thread
From: William Kenworthy @ 2023-11-19 0:30 UTC (permalink / raw
To: gentoo-user
On 18/11/23 15:29, Peter Humphrey wrote:
> On Friday, 17 November 2023 16:44:29 GMT I wrote:
>
>> I'll try that - thanks.
> Damn fool - it was a firewall problem on the server. For some reason, the NFS
> destination port has changed.
>
> Sorry for the noise.
Actually, NFS may have some ports dynamicly allocated so they change on
reboot. Google "pin NFS ports" for how to fix them for firewalls.
BillK
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Debugging NFS mounts
2023-11-19 0:30 ` William Kenworthy
@ 2023-11-19 15:12 ` Peter Humphrey
2023-11-19 15:59 ` [gentoo-user] " Remy Blank
0 siblings, 1 reply; 10+ messages in thread
From: Peter Humphrey @ 2023-11-19 15:12 UTC (permalink / raw
To: gentoo-user
On Sunday, 19 November 2023 00:30:24 GMT William Kenworthy wrote:
> On 18/11/23 15:29, Peter Humphrey wrote:
> > On Friday, 17 November 2023 16:44:29 GMT I wrote:
> >> I'll try that - thanks.
> >
> > Damn fool - it was a firewall problem on the server. For some reason, the
> > NFS destination port has changed.
> >
> > Sorry for the noise.
>
> Actually, NFS may have some ports dynamicly allocated so they change on
> reboot. Google "pin NFS ports" for how to fix them for firewalls.
Yes, indeed. In fact I don't know why this has only just bitten me; I've been
doing the same thing for years without problem.
That search turns up so many answers that I don't know where to start, even
prefixing the phrase with "gentoo". Most of them seem to date from 10 years ago
or more.
--
Regards,
Peter.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-user] Re: Debugging NFS mounts
2023-11-19 15:12 ` Peter Humphrey
@ 2023-11-19 15:59 ` Remy Blank
2023-11-20 11:28 ` Peter Humphrey
0 siblings, 1 reply; 10+ messages in thread
From: Remy Blank @ 2023-11-19 15:59 UTC (permalink / raw
To: gentoo-user
Peter Humphrey wrote on 19.11.2023 16:12:
> Yes, indeed. In fact I don't know why this has only just bitten me; I've been
> doing the same thing for years without problem.
>
> That search turns up so many answers that I don't know where to start, even
> prefixing the phrase with "gentoo". Most of them seem to date from 10 years ago
> or more.
You need to configure two files. Add a *.conf file below /etc/sysctl.d with
the following content:
# Set fixed ports for lockd.
fs.nfs.nlm_tcpport = 4014
fs.nfs.nlm_udpport = 4014
Then set some options in /etc/conf.d/nfs. Here's my config, the -p options configure the ports
of various NFS services.
# /etc/conf.d/nfs
# If you wish to set the port numbers for lockd,
# please see /etc/sysctl.conf
# Optional services to include in default `/etc/init.d/nfs start`
# For NFSv4 users, you'll want to add "rpc.idmapd" here.
NFS_NEEDED_SERVICES="rpc.idmapd"
# Options to pass to rpc.nfsd
OPTS_RPC_NFSD="8 -s -V 3 -N 4"
# Options to pass to rpc.mountd
# ex. OPTS_RPC_MOUNTD="-p 32767"
OPTS_RPC_MOUNTD="-p 4010 --manage-gids"
# Options to pass to rpc.statd
# ex. OPTS_RPC_STATD="-p 32765 -o 32766"
OPTS_RPC_STATD="-p 4011 -o 4012"
# Options to pass to rpc.idmapd
OPTS_RPC_IDMAPD=""
# Options to pass to rpc.gssd
OPTS_RPC_GSSD=""
# Options to pass to rpc.svcgssd
OPTS_RPC_SVCGSSD=""
# Options to pass to rpc.rquotad (requires sys-fs/quota)
OPTS_RPC_RQUOTAD="-p 4013"
# Timeout (in seconds) for exportfs
EXPORTFS_TIMEOUT=30
# Options to set in the nfsd filesystem (/proc/fs/nfsd/).
# Format is <option>=<value>. Multiple options are allowed.
#OPTS_NFSD="nfsv4leasetime=30 max_block_size=4096"
Then you need to allow ports 111 (TCP + UDP), 2049 (TCP) and 4010:4014 (TCP + UDP) through your
firewall. I'm not entirely sure about TCP vs. UDP, you might be able to remove some of them (it
has been a while that I configured this). You can pick different port number than 4010:4014 if
you like.
-- Remy
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-user] Re: Debugging NFS mounts
2023-11-19 15:59 ` [gentoo-user] " Remy Blank
@ 2023-11-20 11:28 ` Peter Humphrey
0 siblings, 0 replies; 10+ messages in thread
From: Peter Humphrey @ 2023-11-20 11:28 UTC (permalink / raw
To: gentoo-user
On Sunday, 19 November 2023 15:59:37 GMT Remy Blank wrote:
> Peter Humphrey wrote on 19.11.2023 16:12:
> > Yes, indeed. In fact I don't know why this has only just bitten me; I've
> > been doing the same thing for years without problem.
> >
> > That search turns up so many answers that I don't know where to start,
> > even
> > prefixing the phrase with "gentoo". Most of them seem to date from 10
> > years ago or more.
>
> You need to configure two files. Add a *.conf file below /etc/sysctl.d with
> the following content:
>
> # Set fixed ports for lockd.
> fs.nfs.nlm_tcpport = 4014
> fs.nfs.nlm_udpport = 4014
>
> Then set some options in /etc/conf.d/nfs. Here's my config, the -p options
> configure the ports of various NFS services.
>
> # /etc/conf.d/nfs
>
> # If you wish to set the port numbers for lockd,
> # please see /etc/sysctl.conf
>
> # Optional services to include in default `/etc/init.d/nfs start`
> # For NFSv4 users, you'll want to add "rpc.idmapd" here.
> NFS_NEEDED_SERVICES="rpc.idmapd"
>
> # Options to pass to rpc.nfsd
> OPTS_RPC_NFSD="8 -s -V 3 -N 4"
>
> # Options to pass to rpc.mountd
> # ex. OPTS_RPC_MOUNTD="-p 32767"
> OPTS_RPC_MOUNTD="-p 4010 --manage-gids"
>
> # Options to pass to rpc.statd
> # ex. OPTS_RPC_STATD="-p 32765 -o 32766"
> OPTS_RPC_STATD="-p 4011 -o 4012"
>
> # Options to pass to rpc.idmapd
> OPTS_RPC_IDMAPD=""
>
> # Options to pass to rpc.gssd
> OPTS_RPC_GSSD=""
>
> # Options to pass to rpc.svcgssd
> OPTS_RPC_SVCGSSD=""
>
> # Options to pass to rpc.rquotad (requires sys-fs/quota)
> OPTS_RPC_RQUOTAD="-p 4013"
>
> # Timeout (in seconds) for exportfs
> EXPORTFS_TIMEOUT=30
>
> # Options to set in the nfsd filesystem (/proc/fs/nfsd/).
> # Format is <option>=<value>. Multiple options are allowed.
> #OPTS_NFSD="nfsv4leasetime=30 max_block_size=4096"
>
>
> Then you need to allow ports 111 (TCP + UDP), 2049 (TCP) and 4010:4014 (TCP
> + UDP) through your firewall. I'm not entirely sure about TCP vs. UDP, you
> might be able to remove some of them (it has been a while that I configured
> this). You can pick different port number than 4010:4014 if you like.
That's a great help. Thank you Remy.
--
Regards,
Peter.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-11-20 11:28 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-15 16:29 [gentoo-user] Debugging NFS mounts Peter Humphrey
2023-11-15 17:04 ` Alan McKinnon
2023-11-15 23:42 ` Peter Humphrey
2023-11-16 20:38 ` Marco Rebhan
2023-11-17 16:44 ` Peter Humphrey
2023-11-18 7:29 ` Peter Humphrey
2023-11-19 0:30 ` William Kenworthy
2023-11-19 15:12 ` Peter Humphrey
2023-11-19 15:59 ` [gentoo-user] " Remy Blank
2023-11-20 11:28 ` Peter Humphrey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox