0

I have two machines with raspbian OS.

The first machine has a HD USB connected.

Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  362M     0  362M   0% /dev
tmpfs          tmpfs     367M  5.0M  362M   2% /run
/dev/mmcblk0p2 ext4       29G  852M   27G   4% /
tmpfs          tmpfs     367M     0  367M   0% /dev/shm
tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs          tmpfs     367M     0  367M   0% /sys/fs/cgroup
/dev/mmcblk0p1 vfat      240M   23M  217M  10% /boot
/dev/sda2      fuseblk   2.8T  1.3T  1.5T  46% /media/biblio
/dev/sda1      vfat      300M  380K  299M   1% /media/EFI
tmpfs          tmpfs      74M     0   74M   0% /run/user/1000

I want to share /dev/sda2 with the second machine. This is what I did:

Install portman and nfs server in the first machine:

$ sudo apt-get install nfs-kernel-server
$ sudo apt-get install portmap

Install nfs client in the second machine:

$ sudo apt-get install nfs-common

Add a line in /etc/exports

/media/biblio *(rw)

Then, in the second machine I try to show files shared in the first machine:

showmount -e 192.168.1.128

But I get this error:

clnt_create: RPC: Program not registered

Why. What am I doing wrong? Thank you.

1

The showmount command is attempting to query the rpc.mountd daemon. Under normal circumstances, it should already be running at this point.

Did you get any error messages when installing nfs-kernel-server? What happens if you try to start or restart the script manually?

pi@nfsserver:~ $ sudo /etc/init.d/nfs-kernel-server stop
[ ok ] Stopping nfs-kernel-server (via systemctl): nfs-kernel-server.service.
pi@nfsserver:~ $ showmount -e
clnt_create: RPC: Program not registered
pi@nfsserver:~ $ sudo /etc/init.d/nfs-kernel-server start
[ ok ] Starting nfs-kernel-server (via systemctl): nfs-kernel-server.service.
pi@nfsserver:~ $ showmount -e
Export list for nfsserver:
pi@nfsserver:~ $ ps -ef | grep [m]ountd
root      1599     1  0 20:23 ?        00:00:00 /usr/sbin/rpc.mountd --manage-gids

rpc.mountd will often log in /var/log/syslog. If it is being started (either manually or by systemd), there should be something there.

When rpc.mountd actually starts, it will attempt to register its port with the portmapper. You can ask the portmapper to show what port it is on. If it is running, but no port appears, you could have a portmapper issue.

pi@nfsserver:~ $ rpcinfo -p | grep mount
    100005    1   udp  40783  mountd
    100005    1   tcp  59249  mountd
    100005    2   udp  56682  mountd
    100005    2   tcp  34875  mountd
    100005    3   udp  49762  mountd
    100005    3   tcp  55881  mountd

Finally, if showmount -e works on the server, but showmount -e [host] doesn't on the client, you could have a networking/firewall issue between them.

Reboot the OSMC server and try adding the following (please edit it into your question, not as comments):

ps -ef | grep rpc (on server)
rpcinfo -p (on server)
rpcinfo -p [server] (from the client)
showmount -e [server] (from the client)
  • Thank you very much for the answer. I forget to mention that the first machine has OSMC, not raspbian, although is raspbian based. Sorry about that. This is my research based on your guide: – aitor Sep 19 '17 at 6:50
  • 1) Restart nfs-kernel-server results in an output exactly as yours, except for exported list: pastebin.com/aygPZyi3 – aitor Sep 19 '17 at 6:53
  • 2) There is no /var/log/syslog file in this machine – aitor Sep 19 '17 at 6:54
  • 3) rpcinfo -p | grep mount returns nothing. But rpcinfo -p, without grep filter returns this: pastebin.com/xSz0zCgw – aitor Sep 19 '17 at 6:56
  • 4) More meaningfull: after restart manually nfs-kernell in the first machine and to do 'showmount -e' in the second machine, I get another error: clnt_create: RPC: Port mapper failure - Unable to receive: errno 0 (Success) – aitor Sep 19 '17 at 6:58
0

After reinstall Raspbian from scratch in the second machine, everything work. I don't know why.

Thank you all for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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