Skip to contentSkip to conversation

nfs server issues

DISCUSSION Bruce Dubbs 4 participants 7 messages Nov 30, 2011 – Dec 1, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I am trying to document the installation of nfs for Linux From Scratch.
The client works, but the server does not and I'm looking for some
help. If this is the wrong place to ask for help, please redirect me.

For now, I am only trying to get nfs version 3 to work.

# mount -t nfs -o nfsvers=3 lfs6:/home/bdubbs /mnt/test
   [ mounts OK ]
# mount -t nfs -o nfsvers=3 localhost:/usr/src /mnt/tmp
# mount.nfs: requested NFS version or transport protocol is not supported

Any pointers are appreciated. Details of the procedures I've used are below.

-- Bruce Dubbs
linuxfromscratch.org

The packages I'm using:

linux-3.0.4
libtirpc-0.2.2
rpcbind-0.2.0
nfs-utils-1.2.5
glibc-2.14.1
util-linux-2.20

The build procedures were as follows:

1. Restore nfs/nis headers omitted by glibc-2.14.1
2. Build libtirpc
Remove auth_des.c authdes_prot.c des_crypt.c from Makefile Comment out authdes_create() in rpc_soc.c ./configure --prefix=/usr --libdir=/lib
3. Build rpcbind
./configure --prefix=/usr --bindir=/sbin
Update /etc/services for rpcbind on port 111
4. Build nfs-utils

   LIBS=-lpthread ./configure --prefix=/usr     \
        --sysconfdir=/etc --disable-nfsv4 --disable-nfsv41  \
        --disable-gss

Start rpcbind
Start rpc.mountd
Run rpc.nfsd -p 2049 8
Start rpc.statd
Run exportfs -ra

/etc/exports has:
/usr/src 192.168.0.0/24(rw,async,no_root_squash,subtree_check)

rpcinfo -p gives:

    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
    100005    1   udp  52645  mountd
    100005    1   tcp  47533  mountd
    100005    2   udp  60954  mountd
    100005    2   tcp  56425  mountd
    100005    3   udp  33939  mountd
    100005    3   tcp  56892  mountd
    100024    1   udp  34641  status
    100024    1   tcp  50491  status
# ps -ef|grep 'nfs\|rpc\|lock'
root       291     2  0 Nov26 ?        00:00:00 [kblockd]
root       498     2  0 Nov26 ?        00:00:00 [rpciod]
root       613     2  0 Nov26 ?        00:00:00 [nfsiod]
root      1136     2  0 Nov28 ?        00:00:00 [lockd]
root      1137     2  0 Nov28 ?        00:00:00 [nfsd]
root      1138     2  0 Nov28 ?        00:00:00 [nfsd]
root      1139     2  0 Nov28 ?        00:00:00 [nfsd]
root      1140     2  0 Nov28 ?        00:00:00 [nfsd]
root      1141     2  0 Nov28 ?        00:00:00 [nfsd]
root      1142     2  0 Nov28 ?        00:00:00 [nfsd]
root      1143     2  0 Nov28 ?        00:00:00 [nfsd]
root      1144     2  0 Nov28 ?        00:00:00 [nfsd]
root      1889     1  0 Nov28 ?        00:00:00 /usr/sbin/rpc.statd
root     12615     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12618     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12685     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12711     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12923     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14127     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14494     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14861     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     15248     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     15819     1  0 Nov29 ?        00:00:00 /sbin/rpcbind
root     16423     1  0 12:34 ?        00:00:00 /usr/sbin/rpc.mountd
root     16432     1  0 12:36 ?        00:00:00 /usr/sbin/rpc.statd

Kernel configuration:

CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_USE_NEW_IDMAPPER is not set
CONFIG_NFSD=y
# CONFIG_NFSD_DEPRECATED is not set
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
# CONFIG_NFSD_V4 is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y

#1 lore raw

Bruce Dubbs wrote:

I am trying to document the installation of nfs for Linux From Scratch. The client works, but the server does not and I'm looking
for some help. If this is the wrong place to ask for help, please
redirect me.

For now, I am only trying to get nfs version 3 to work.

  # mount -t nfs -o nfsvers=3 lfs6:/home/bdubbs /mnt/test
     [ mounts OK ]
  # mount -t nfs -o nfsvers=3 localhost:/usr/src /mnt/tmp
  # mount.nfs: requested NFS version or transport protocol is not supported

It doesn't explain the error message you're getting, but your exports file doesn't have an entry for localhost. When I try this I get "mount.nfs:
access denied by server while mounting localhost:/usr/src".

2. Build libtirpc
Remove auth_des.c authdes_prot.c des_crypt.c from Makefile Comment out authdes_create() in rpc_soc.c ./configure --prefix=/usr --libdir=/lib

This shouldn't be necessary. Instead of working around the problem, it would be nice if you could figure out why you needed to do this, and if there is a bug in the configure magic, let us know.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

The parent should have gone to the list.

Quoted 28 lines · Bruce Dubbs
Quoted 9 lines · Jim Rees

Bruce Dubbs wrote:

I am trying to document the installation of nfs for Linux From Scratch. The client works, but the server does not and I'm looking
for some help. If this is the wrong place to ask for help, please
redirect me.
For now, I am only trying to get nfs version 3 to work. # mount -t nfs -o nfsvers=3 lfs6:/home/bdubbs /mnt/test
[ mounts OK ]

Quoted 7 lines
  # mount -t nfs -o nfsvers=3 localhost:/usr/src /mnt/tmp
  # mount.nfs: requested NFS version or transport protocol is not 
supported

It doesn't explain the error message you're getting, but your exports file doesn't have an entry for localhost. When I try this I get "mount.nfs:
access denied by server while mounting localhost:/usr/src".

I added
/usr/src 127.0.0.0/8(rw,async,no_root_squash,subtree_check)

but still got 'requested NFS version or transport protocol is not supported'. I suspect it has something to do with rpcbind not having nfsd registered on port 2049. At least rpcinfo doesn't know about it.

Quoted 5 lines

2. Build libtirpc
Remove auth_des.c authdes_prot.c des_crypt.c from Makefile Comment out authdes_create() in rpc_soc.c ./configure --prefix=/usr --libdir=/lib

Quoted 7 lines
Quoted 3 lines

This shouldn't be necessary. Instead of working around the problem, it would be nice if you could figure out why you needed to do this, and if there is a bug in the configure magic, let us know.

Which shouldn't be necessary? The change to the Makefile/rpc_soc.c files or the -prefix and --libdir options?

I just went back and rebuilt without the file changes and it built fine. I'm not sure what happened to change it, but it was definitely needed before. Sometimes when you are building a whole system from scratch, some assumed prereqs are not installed. I'll have to figure that out to get it right. I suspect it was because I originally didn't get the replacement of the rpc/nis headers that glibc now omits installed correctly.

Now I remember. Without the patch, other programs don't link. For example, rpcbind gives:

gcc -g -O2 -o rpcbind check_bound.o rpcbind.o rpcb_svc_4.o
rpcb_svc_com.o util.o pmap_svc.o rpcb_stat.o rpcb_svc.o security.o warmstart.o /lib/libtirpc.so -lnsl -lpthread -Wl,--rpath -Wl,/lib -Wl,--rpath -Wl,/lib
/lib/libtirpc.so: undefined reference to key_encryptsession_pk' /lib/libtirpc.so: undefined reference to getnetname' /lib/libtirpc.so: undefined reference to _des_crypt_call' /lib/libtirpc.so: undefined reference to getpublickey' /lib/libtirpc.so: undefined reference to `key_gendes'

This is a glibc-2.14 and later issue.

Quoted 4 lines

As for the --prefix and --libdir options, we may not need the --prefix. Most packages install in /usr/local without it. The --libdir is to install in /lib instead of /usr/lib so the library is available if /usr is not mounted. Without the setting, we would have to move the files and also modify the libdir line in both libtirpc.la and libtirpc.pc.

-- Bruce

#4 lore raw
In reply to Bruce Dubbs
Quoted 8 lines · Bruce Dubbs

I am trying to document the installation of nfs for Linux From Scratch. The client works, but the server does not and I'm looking for some help. If this is the wrong place to ask for help, please redirect me.

For now, I am only trying to get nfs version 3 to work.

# mount -t nfs -o nfsvers=3 lfs6:/home/bdubbs /mnt/test
   [ mounts OK ]
# mount -t nfs -o nfsvers=3 localhost:/usr/src /mnt/tmp
# mount.nfs: requested NFS version or transport protocol is not supported

The reason you getting the mounting error to localhost is because there are no NFS services registered with rpcbind. Note the lack of nfs entires in your rpcinfo -p output. For the above mount to work you would need at least the following entry:
100003 3 tcp 2049 nfs

Figure out why that is not happening and you find the problem...

steved.

Quoted 110 lines

Any pointers are appreciated. Details of the procedures I've used are below.

-- Bruce Dubbs
linuxfromscratch.org

The packages I'm using:

linux-3.0.4
libtirpc-0.2.2
rpcbind-0.2.0
nfs-utils-1.2.5
glibc-2.14.1
util-linux-2.20

The build procedures were as follows:

1. Restore nfs/nis headers omitted by glibc-2.14.1
2. Build libtirpc
Remove auth_des.c authdes_prot.c des_crypt.c from Makefile Comment out authdes_create() in rpc_soc.c ./configure --prefix=/usr --libdir=/lib
3. Build rpcbind
./configure --prefix=/usr --bindir=/sbin
Update /etc/services for rpcbind on port 111
4. Build nfs-utils

   LIBS=-lpthread ./configure --prefix=/usr     \
        --sysconfdir=/etc --disable-nfsv4 --disable-nfsv41  \
        --disable-gss

Start rpcbind
Start rpc.mountd
Run rpc.nfsd -p 2049 8
Start rpc.statd
Run exportfs -ra

/etc/exports has:
/usr/src 192.168.0.0/24(rw,async,no_root_squash,subtree_check)

rpcinfo -p gives:

    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
    100005    1   udp  52645  mountd
    100005    1   tcp  47533  mountd
    100005    2   udp  60954  mountd
    100005    2   tcp  56425  mountd
    100005    3   udp  33939  mountd
    100005    3   tcp  56892  mountd
    100024    1   udp  34641  status
    100024    1   tcp  50491  status
# ps -ef|grep 'nfs\|rpc\|lock'
root       291     2  0 Nov26 ?        00:00:00 [kblockd]
root       498     2  0 Nov26 ?        00:00:00 [rpciod]
root       613     2  0 Nov26 ?        00:00:00 [nfsiod]
root      1136     2  0 Nov28 ?        00:00:00 [lockd]
root      1137     2  0 Nov28 ?        00:00:00 [nfsd]
root      1138     2  0 Nov28 ?        00:00:00 [nfsd]
root      1139     2  0 Nov28 ?        00:00:00 [nfsd]
root      1140     2  0 Nov28 ?        00:00:00 [nfsd]
root      1141     2  0 Nov28 ?        00:00:00 [nfsd]
root      1142     2  0 Nov28 ?        00:00:00 [nfsd]
root      1143     2  0 Nov28 ?        00:00:00 [nfsd]
root      1144     2  0 Nov28 ?        00:00:00 [nfsd]
root      1889     1  0 Nov28 ?        00:00:00 /usr/sbin/rpc.statd
root     12615     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12618     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12685     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12711     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12923     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14127     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14494     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14861     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     15248     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     15819     1  0 Nov29 ?        00:00:00 /sbin/rpcbind
root     16423     1  0 12:34 ?        00:00:00 /usr/sbin/rpc.mountd
root     16432     1  0 12:36 ?        00:00:00 /usr/sbin/rpc.statd

Kernel configuration:

CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_USE_NEW_IDMAPPER is not set
CONFIG_NFSD=y
# CONFIG_NFSD_DEPRECATED is not set
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
# CONFIG_NFSD_V4 is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw
Quoted 15 lines · Steve Dickson
Quoted 11 lines · Bruce Dubbs

I am trying to document the installation of nfs for Linux From Scratch. The client works, but the server does not and I'm looking for some help. If this is the wrong place to ask for help, please redirect me.

For now, I am only trying to get nfs version 3 to work.

# mount -t nfs -o nfsvers=3 lfs6:/home/bdubbs /mnt/test
   [ mounts OK ]
# mount -t nfs -o nfsvers=3 localhost:/usr/src /mnt/tmp
# mount.nfs: requested NFS version or transport protocol is not supported
Quoted 6 lines

The reason you getting the mounting error to localhost is because there are no NFS services registered with rpcbind. Note the lack of nfs entires in your rpcinfo -p output. For the above mount to work you would need at least the following entry:

100003 3 tcp 2049 nfs

Figure out why that is not happening and you find the problem...

Yes, I thought that might be the problem. The hard part is figuring out why. I am running 'rpc.nfsd -p 2049 8' and I would think that would do it, but it's not registering with rpcbind. The actual nfsd daemon is running in the kernel.

I looked at the nfsd.c source and nfsdfs is mounted in /proc correctly.
The threads seem to be started properly in nfssvc_threads() and there are no error messages either on the terminal or in syslog.

I'm just not familiar enough with the code to see where nfs is supposed to register with rpcbind. That's where I'm trying to get help. I suspect I've done something wrong with the build or configuration, but I don't see where. Is the kernel nfsd process supposed to register when it starts?

One other thing. When I try to mount the share from a remote (older) system, the error message is sightly different: "RPC Error: Program not registered", but I think that means the same thing as above.

-- Bruce

#6 lore raw
Quoted 8 lines · Bruce Dubbs
Quoted 6 lines · Steve Dickson

The reason you getting the mounting error to localhost is because there are no NFS services registered with rpcbind. Note the lack of nfs entires in your rpcinfo -p output. For the above mount to work you would need at least the following entry:

100003 3 tcp 2049 nfs

Figure out why that is not happening and you find the problem...

I got it to work. I did a 'killall -HUP nfsd' and restarted 'rpc.nfsd -p 2049 8' and nfs showed up in rpcinfo and mount now works.

It must have been a sequence error on my part. Sorry for the noise.

-- Bruce

#7 lore raw
In reply to Bruce Dubbs

Hi.

It looks to me as if /usr/src is only exported to hosts on the 192.168.0 network and not to hosts on the 127 network. Unless you alias localhost to the host address on the 192.168.0 network, then I don't think that this will work as you desire.

ps

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Bruce Dubbs
Sent: Wednesday, November 30, 2011 6:32 PM
To: [email protected]
Subject: nfs server issues

I am trying to document the installation of nfs for Linux From Scratch.
The client works, but the server does not and I'm looking for some
help. If this is the wrong place to ask for help, please redirect me.

For now, I am only trying to get nfs version 3 to work.

# mount -t nfs -o nfsvers=3 lfs6:/home/bdubbs /mnt/test
    [ mounts OK ]
# mount -t nfs -o nfsvers=3 localhost:/usr/src /mnt/tmp
# mount.nfs: requested NFS version or transport protocol is not supported

Any pointers are appreciated. Details of the procedures I've used are below.

-- Bruce Dubbs
linuxfromscratch.org

The packages I'm using:

linux-3.0.4
libtirpc-0.2.2
rpcbind-0.2.0
nfs-utils-1.2.5
glibc-2.14.1
util-linux-2.20

The build procedures were as follows:

1. Restore nfs/nis headers omitted by glibc-2.14.1
2. Build libtirpc
Remove auth_des.c authdes_prot.c des_crypt.c from Makefile Comment out authdes_create() in rpc_soc.c ./configure --prefix=/usr --libdir=/lib
3. Build rpcbind
./configure --prefix=/usr --bindir=/sbin
Update /etc/services for rpcbind on port 111
4. Build nfs-utils

    LIBS=-lpthread ./configure --prefix=/usr     \
         --sysconfdir=/etc --disable-nfsv4 --disable-nfsv41  \
         --disable-gss

Start rpcbind
Start rpc.mountd
Run rpc.nfsd -p 2049 8
Start rpc.statd
Run exportfs -ra

/etc/exports has:
/usr/src 192.168.0.0/24(rw,async,no_root_squash,subtree_check)

rpcinfo -p gives:

     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
     100005    1   udp  52645  mountd
     100005    1   tcp  47533  mountd
     100005    2   udp  60954  mountd
     100005    2   tcp  56425  mountd
     100005    3   udp  33939  mountd
     100005    3   tcp  56892  mountd
     100024    1   udp  34641  status
     100024    1   tcp  50491  status
# ps -ef|grep 'nfs\|rpc\|lock'
root       291     2  0 Nov26 ?        00:00:00 [kblockd]
root       498     2  0 Nov26 ?        00:00:00 [rpciod]
root       613     2  0 Nov26 ?        00:00:00 [nfsiod]
root      1136     2  0 Nov28 ?        00:00:00 [lockd]
root      1137     2  0 Nov28 ?        00:00:00 [nfsd]
root      1138     2  0 Nov28 ?        00:00:00 [nfsd]
root      1139     2  0 Nov28 ?        00:00:00 [nfsd]
root      1140     2  0 Nov28 ?        00:00:00 [nfsd]
root      1141     2  0 Nov28 ?        00:00:00 [nfsd]
root      1142     2  0 Nov28 ?        00:00:00 [nfsd]
root      1143     2  0 Nov28 ?        00:00:00 [nfsd]
root      1144     2  0 Nov28 ?        00:00:00 [nfsd]
root      1889     1  0 Nov28 ?        00:00:00 /usr/sbin/rpc.statd
root     12615     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12618     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12685     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12711     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     12923     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14127     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14494     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     14861     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     15248     1  0 Nov29 ?        00:00:00 rpc.statd --no-notify
root     15819     1  0 Nov29 ?        00:00:00 /sbin/rpcbind
root     16423     1  0 12:34 ?        00:00:00 /usr/sbin/rpc.mountd
root     16432     1  0 12:36 ?        00:00:00 /usr/sbin/rpc.statd

Kernel configuration:

CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_USE_NEW_IDMAPPER is not set
CONFIG_NFSD=y
# CONFIG_NFSD_DEPRECATED is not set
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
# CONFIG_NFSD_V4 is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html