Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
(solved) how to enable NFS v2 support of server side ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Zhang Zheng
n00b
n00b


Joined: 26 Jul 2021
Posts: 11
Location: Xi'an, China

PostPosted: Sun Jul 24, 2022 9:30 am    Post subject: (solved) how to enable NFS v2 support of server side ? Reply with quote

Hello,

I'm following this link to run open genera, which requires NFS v2.

I enabled NFS client support for NFS version 2,
in File Systems -> Network File Systems

But "NFS server support for NFS version 2" seems not here,
so I only enabled the client support.

Below is my /etc/conf.d/nfs
Code:
NFS_NEEDED_SERVICES="rpc.idmapd"
OPTS_RPC_NFSD="8 -V 2 --udp"
OPTS_RPC_MOUNTD="-V2 --manage-gids"
EXPORTFS_TIMEOUT=30
# others are empty strings


Kernel is gentoo-sources:5.18.14 and openrc.

USE flags enabled of net-fs/nfs-utils is:
Code:
+libmount +nfsidmap +nfsv4 +uuid


The result of "sudo /etc/init.d/nfs start" is
Code:
nfs                       | * Exporting NFS directories  [ ok ]
nfs                       | * Starting NFS mountd ...    [ ok ]
nfs                       | * Starting NFS daemon ...
nfs                       |2: Unsupported version        [ !! ]
nfs                       | * Starting NFS smnotify ...  [ ok ]
nfs                       | * ERROR: nfs failed to start


I'd like to know if the "NFS v2 support of server side"
is not supported in newest kernel,
or it is my kernel/USE/etc. configuration that goes wrong.

It will be much appreciated if anyone could help :)


Last edited by Zhang Zheng on Sun Jul 24, 2022 1:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sun Jul 24, 2022 10:05 am    Post subject: Reply with quote

Run the command below to find out the NFS versions your server supports:
Code:
rpcinfo -p <server>

See: https://unix.stackexchange.com/questions/185829/which-version-of-nfs-is-my-nfs-server-using
Back to top
View user's profile Send private message
Zhang Zheng
n00b
n00b


Joined: 26 Jul 2021
Posts: 11
Location: Xi'an, China

PostPosted: Sun Jul 24, 2022 10:37 am    Post subject: Reply with quote

Dear mike155,

the result of "rpcinfo -p" is
Code:
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  40378  status
    100024    1   tcp  58469  status
    100005    1   udp  47653  mountd
    100005    1   tcp  37757  mountd
    100005    2   udp  38970  mountd
    100005    2   tcp  55073  mountd
    100005    3   udp  41410  mountd
    100005    3   tcp  45251  mountd


nfs is not here is probably because that the nfs failed to start:

Code:
nfs                       | * Exporting NFS directories ...               [ ok ]
nfs                       | * Starting NFS mountd ...                     [ ok ]
nfs                       | * Starting NFS daemon ...
nfs                       |2: Unsupported version                         [ !! ]
nfs                       | * Starting NFS smnotify ...                   [ ok ]
nfs                       | * ERROR: nfs failed to start


Last edited by Zhang Zheng on Sun Jul 24, 2022 12:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sun Jul 24, 2022 11:18 am    Post subject: Reply with quote

Please remove '-V 2' from OPTS_RPC_NFSD. rpc.nfsd does not support '-V 2'. See 'man nfsd'.

After that, the error message '2: Unsupported version' should have gone away and
Code:
rpcinfo -p <server>

should show the lines below (in addition to the lines you already posted):
Code:
100003  3  tcp  0.0.0.0.8.1  nfs  superuser
100003  4  tcp  0.0.0.0.8.1  nfs  superuser
Back to top
View user's profile Send private message
Zhang Zheng
n00b
n00b


Joined: 26 Jul 2021
Posts: 11
Location: Xi'an, China

PostPosted: Sun Jul 24, 2022 11:46 am    Post subject: Reply with quote

Dear mike,

removing '-V 2' from OPTS_RPC_NFSD does solved the '2: Unsupported version',
and the nfs does start successfully.

And result of "rpcinfo -p localhost" does have the following two lines:
Code:
    100003    3   tcp   2049  nfs
    100003    3   udp   2049  nfs


But what confuses me is still the version 3, while what I need is version 2 :(


Last edited by Zhang Zheng on Sun Jul 24, 2022 12:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sun Jul 24, 2022 11:53 am    Post subject: Reply with quote

Try to mount one of the exported volumes on your server.

The command below lists the exported volumes:
Code:
showmount -e <server>

Mount one of those volumes:
Code:
mount -t nfs -o nfsvers=2 <server>:<volume> /mnt

Does that work? If not: which error message do you get?

Please try nfsvers=3 and nfsvers=4 as well.

Don't forget to unmount the volume after the test:
Code:
umount /mnt
Back to top
View user's profile Send private message
Zhang Zheng
n00b
n00b


Joined: 26 Jul 2021
Posts: 11
Location: Xi'an, China

PostPosted: Sun Jul 24, 2022 12:17 pm    Post subject: Reply with quote

Dear mike,

"showmount -e localhost" gives
Code:
Export list for genteel:
/ genera


and "mount -t nfs -o nfsvers=2 localhost:/ /mnt" gives
Code:
mount.nfs: requested NFS version or transport protocol is not supported


"mount -t nfs -o nfsvers=3 localhost:/ /mnt" is
Code:
mount.nfs: access denied by server while mounting localhost:/
# nfsvers=4 is the same


Mounting / seems ridiculous but that is specified here

I tried changing / to something like /share (in /etc/exports as well) and start over, but result is same.

Thanks for your reply


Last edited by Zhang Zheng on Sun Jul 24, 2022 12:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sun Jul 24, 2022 12:49 pm    Post subject: Reply with quote

It looks like NFSv2 support was removed from nfs-utils in January 2022: commit message.

You could try to install an older version of nfs-utils: nfs-utils-2.5.4, for example.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Sun Jul 24, 2022 12:49 pm    Post subject: Reply with quote

Zhang Zheng,

Are you running the new kernel with NFS2 support?
What is the date/time in
Code:
unane -a

That's the build date/time of the running kernel. Is it before or after your kernel update?

Its very easy to forget to mount /boot, then the kernel is correctly installed to the wrong place.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Zhang Zheng
n00b
n00b


Joined: 26 Jul 2021
Posts: 11
Location: Xi'an, China

PostPosted: Sun Jul 24, 2022 12:51 pm    Post subject: Reply with quote

mike155 wrote:
It looks like NFSv2 support was removed from nfs-utils in January 2022: commit message.

You could try to install an older version of nfs-utils: nfs-utils-2.5.4, for example.


Dear mike,

thanks a lot for your reply, and the nfs v2 removal commit.

Best regards :)
Back to top
View user's profile Send private message
Zhang Zheng
n00b
n00b


Joined: 26 Jul 2021
Posts: 11
Location: Xi'an, China

PostPosted: Sun Jul 24, 2022 12:57 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Zhang Zheng,

Are you running the new kernel with NFS2 support?
What is the date/time in
Code:
unane -a

That's the build date/time of the running kernel. Is it before or after your kernel update?

Its very easy to forget to mount /boot, then the kernel is correctly installed to the wrong place.


Dear NeddySeagoon,

I'm runnning the newest kernel 5.18.14 built yesterday, and I always make sure
/boot is not malfunctioning after each kernel update.

According to the link mike posted, NFS v2 support was removed last November,
so I better revert to something older than that :)
Back to top
View user's profile Send private message
Zhang Zheng
n00b
n00b


Joined: 26 Jul 2021
Posts: 11
Location: Xi'an, China

PostPosted: Sun Jul 24, 2022 1:34 pm    Post subject: Reply with quote

Dear everyone who may concerns,

It turns out that the newest nfs-utils:2.6.1 is the error reason.

Thanks to mike, I decided to try out nfs-utils:2.5.4

Luckily there are not so much changes and patches, so simply
> cp P-2.6.1.ebuild P-2.5.4.ebuild, then regenerate manifest,
will emerge nfs-utils:2.5.4 successfully, re-slotting is also needed.

After that change /etc/conf.d/nfs
Code:
OPTS_RPC_NFSD="8 -V 2 --udp"

"rpcinfo -p" gives
Code:
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    2   tcp   2049  nfs_acl
    100227    3   tcp   2049  nfs_acl
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100227    2   udp   2049  nfs_acl
    100227    3   udp   2049  nfs_acl


All in all to start an NFS v2 server is working now,,

thanks everyone :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum