Solved Can't mount Pi4's neither Samba nor NFS shares

So, a Pi4 box is a server (192.168.66.40), a FreeBSD 13.0 laptop is a client (192.168.66.24).
As far I understood, mount Samba is absolutely impossible? Because mount_smbfs still doesn't know what is SMB2+ 😣 (I don't want to use smbclient, really).

OK, let's try NFS. No way too. It just hangs telling me:
[tcp] 192.168.66.40:/ftp: RPCMNT: clnt_create: RPC: Remote system error - Operation timed out
Here is /etc/exports from my Pi4:
Code:
/srv/nfs        192.168.66.0/24(mp,fsid=0,no_subtree_check,all_squash)
/srv/nfs/bak    192.168.66.0/24(no_subtree_check,all_squash)
/srv/nfs/pub    192.168.66.0/24(rw,insecure,async,no_subtree_check)
/srv/ftp        192.168.66.0/24(nohide,no_subtree_check,all_squash)
Here is part of my /etc/rc.conf (tried in different combinations):
Code:
nfs_client_enable="YES"
nfs_client_flags="-n 4"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
Here is a command I tried (also tried srv/ftp, /ftp, ftp, and options -o nfsv2/3/4,nolockd):
# mount -t nfs 192.168.66.40:/srv/ftp /net/nfs/ftp
NFS... the native unix way to share files... hmm...

So, all I have - The Handbook with non-working guides and ancient internet articles. Do folks are still using the network capabilities of the network OS?
Another two unix-like boxes (Arch and Debian) mount both Samba and NFS like a charm.
Another bunch of hours with no luck at basic OS functioning.
Another desire to format the drive and forget about this NightmareOS forever.

UPD. The Pi server is on Raspbian. The laptop client is on FreeBSD.
 
Last edited:
As you are pleased to tell this forum that nothing works, I am sure you are correct.

Personally, I am happy to continue with the misapprehension that with little effort, everything works extremely well.
 
I bet you don't have rpcbind running. Check with ps ax | grep rpcbind. Add rpcbind_enable="YES" to /etc/rc.conf.
 
rpcbind is running, but it haven't present in rc.conf - added, rebooted, still no luck.
/etc/rc.conf:
Code:
hostname="x230"
#ifconfig_em0="DHCP" #SYNCDHCP for VM
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA DHCP powersave"
create_args_wlan0="country RU regdomain NONE"
wpa_supplicant_program="/usr/local/sbin/wpa_supplicant"
background_dhclient="YES"

zfs_enable="YES"
dumpdev="NO"
syslogd_flags="-ss"
clear_tmp_enable="YES"
sshd_enable="YES"
openssh_enable="NO"
sendmail_enable="NONE"
ntpd_enable="YES"
ntpd_flags="-g"
dbus_enable="YES"
#hald_enable="YES"
keymap="ru.win"
moused_enable="YES"
moused_flags="-VH"
linux_enable="YES"

powerd_enable="YES"
powerd_flags="-a hiadaptive -b adaptive"
performance_cx_lowest="Cmax" # "C2"?
economy_cx_lowest="Cmax" # "C2"?

#kld_list="i915kms.ko fuse"
kld_list="i915kms"
#kld_list="/boot/modules/i915kms.ko"
#?kern.ipc.shm_allow_removed=1
hcsecd_enable="YES"
sdpd_enable="YES"
bthidd_enable="YES"
cupsd_enable="YES"
webcamd_enable="YES"
#sndiod_enable="YES"

#slim_enable="YES"
##sddm_enable="YES"

gateway_enable="YES"
pf_enable="YES"
pf_rules="/etc/pf.conf"
ipv6_network_interfaces="none"      # Default is auto
ipv6_activate_all_interfaces="NO"   # this is the default
ip6addrctl_enable="NO"              # New way to disable IPv6 support
ip6addrctl_policy="ipv4_prefer"     # Use IPv4 instead of IPv6
ipv6_activate_all_interfaces="NO"   # Do not automatically add IPv6 addresses

nfs_client_enable="YES"
nfs_client_flags="-n 4"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
rpcbind_enable="YES"

#vm_enable="YES"
vm_dir="zfs:zroot/usr/bhyve"
cloned_interfaces="bridge0 tap0"
ifconfig_bridge0="addm wlan0 addm tap0"
#kld_list="nmdm vmm"
vboxnet_enable="YES"
devfs_system_ruleset="system"

## VirtualBox Guest
#vboxguest_enable="YES"
#vboxservice_enable="YES"
#vboxservice_flags="--disable-timesync"
Does anyone here have LAN shares? How did you manage it?
Since ~2016 there is no clear information on the Internet about it, that's weird...
 
Here is /etc/exports from my Pi4:
Looks like a Linux export to me, is that correct?

# mount -t nfs 192.168.66.40:/srv/ftp /net/nfs/ftp
It depends on how NFSv4 is set up on the Linux Pi. I suspect /srv/ is set as the root for NFS mounts. In that case you need to use mount 192.168.66.40:/ftp /net/nfs/ftp

There is no need to rpcbind(8), NFSv4 doesn't use it.
Code:
nfs_client_enable="YES"
nfs_client_flags="-n 4"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
rpcbind_enable="YES"
You can remove all that.
Code:
ntpd_enable="YES"
ntpd_flags="-g"
Remove those too, you don't need it on a client.
 
Looks like a Linux export to me
Yes, the Pi is on Raspbian.
I've commented out the suggested rows in my /etc/rc.conf, rebooted and moved the ftp dir under the /srv/nfs/ (the root of all NFS mounts) on my Pi.
/etc/exports (Pi):
Code:
/srv/nfs 192.168.66.0/24(mp,fsid=0,no_subtree_check,all_squash)
/srv/nfs/ftp 192.168.66.0/24(nohide,no_subtree_check,all_squash)
/srv/nfs/bak 192.168.66.0/24(no_subtree_check,all_squash)
/srv/nfs/pub 192.168.66.0/24(rw,insecure,async,no_subtree_check)
But anyway no share is mounted, and the error is the same.

One more question: how do I know the 4th NFS version is used? How can I try with say v3? Or it doesn't make sense?

P.S.: why delete ntpd rows on my laptop? Should I use ntpdate instead? Just for sync time with world.
 
how do I know the 4th NFS version is used?
That's the default nowadays.

why delete ntpd rows on my laptop? Should I use ntpdate instead? Just for sync time with world.
Oops. Sorry, that's my dyslexia getting the better of me, I thought it said nfsd_*. Forget I mentioned removing those.
 
Yes, the Pi is on Raspbian.
I too thought the Pi was running FreeBSD. In my FreeBSD client’s /etc/rc.conf I don’t have any NFS or RPC related lines. I will experiment as I do have a pi4 running Raspian though I’m not sure how old the os version is.
 
Are there any firewalls active?
Yes, ufw on my pi is on. Disabled it temporarily and saw an error on the FreeBSD client laptop:
[tcp] 192.168.66.40:ftp: Permission denied
instead of an error when the firewall is enabled:
[tcp] 192.168.66.40:ftp: RPCMNT: clnt_create: RPC: Remote system error - Operation timed out
on Pi:
# ufw status numbered
Status: active

To Action From
-- ------ ----
[ 1] 25522/tcp LIMIT IN Anywhere # ssh
[ 2] CUPS ALLOW IN Anywhere
[ 3] 5902/tcp ALLOW IN 192.168.66.0/24 # delete! use ssh!
[ 4] 137:138/udp ALLOW IN 192.168.66.0/24 # smb-netbios
[ 5] 139/tcp ALLOW IN 192.168.66.0/24 # smb-netbios
[ 6] 445/tcp ALLOW IN 192.168.66.0/24 # smb-cifs
[ 7] 10000 ALLOW IN Anywhere # webmin
[ 8] 56789 ALLOW IN Anywhere # transmission
[ 9] 9089/tcp ALLOW IN Anywhere # transmission-remote
[10] 20:21/tcp ALLOW IN Anywhere # ftp
[11] 60000:65535/tcp ALLOW IN Anywhere # ftp-passive
[12] 60000:65535/udp ALLOW IN Anywhere # ftp-passive
[13] 5201 ALLOW IN Anywhere # iperf3
[14] syncthing ALLOW IN Anywhere
[15] 8384 ALLOW IN 192.168.66.0/24 # syncthing-gui
[16] NFS ALLOW IN 192.168.66.0/24
#
# ufw app info NFS
Profile: NFS
Title: NFS server
Description: NFS and portmap server. Will also need access to mountd, statd and possibly others

Ports:
2049,111/tcp
2049,111/udp

I just can't understand - other two clients don't suffer from the pi's firewall, no errors at all, do it need extra adjustments to make it possible to mount from FreeBSD client?
specific ports blocked by a firewall needed to be opened
How I could know what the ports are? Again, mounting doesn't work even with Pi's firewall disabled.

And about samba. smbnetfs works surprisingly easy. Shares open both in cli and Xfe file manager. But it doesn't open in PCManFM-Qt (LXQt), that's strange... Also, I'd like to automount samba shares on the system level to have an ability to use it with Xfe and cli at least. Should I use both .bashrc and WM's facilities instead? I can't use /etc/fstab for this purpose, if I've got it right.
 
I can't tell where on your system the problem is, and I can't reproduce on a Linux Mint 20.1 NFS server and FreeBSD 13.0-RELEASE client test system. These are the steps applied:

Setup without firewall:

Linux Mint:
Code:
$ sudo mkdir -p /srv/ftp
$ sudo chown nobody:nogroup /svr/ftp
$ sudo chmod 777 /svr/ftp

/etc/exports
/srv/ftp     192.168.1.0/24(nohide,no_subtree_check,all_squash)

$ sudo exportfs -a
$ sudo systemctl restart nfs-kernel-server

FreeBSD:
Code:
/etc/rc.conf
nfs_client_enable="YES"

# mount 192.168.1.111:/srv/ftp /mnt
# mount | grep mnt
192.168.1.111:/srv/ftp on /mnt (nfs)

Setup with firewall:

Linux Mint:
Code:
$ sudo ufw default deny incoming
$ sudo ufw default allow outgoing
$ sudo ufw allow nfs
$ sudo ufw allow 111
$ sudo ufw enable

$ sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 2049                       ALLOW IN    Anywhere         
[ 2] 111                        ALLOW IN    Anywhere         
[ 3] 2049 (v6)                  ALLOW IN    Anywhere (v6)    
[ 4] 111 (v6)                   ALLOW IN    Anywhere (v6)

FreeBSD:
Code:
# mount 192.168.1.111:/srv/ftp /mnt
[tcp] 192.168.1.111:/srv/ftp: RPCMNT: clnt_create: RPC: Remote system error - Operation timed out

# mount -o nfsv4 192.168.1.111:/srv/ftp /mnt
# mount | grep mnt
192.168.1.111:/srv/ftp on /mnt (nfs, nfsv4acls)

Check if mounting NFS with -o nfsv4 works for you without the firewall enabled.
 
For the 192.168.66.0/24 subnet try ufw(8) rules:
Code:
$ sudo ufw allow from 192.168.66.0/24 to any port nfs proto tcp
Code:
$ sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 2049/tcp                   ALLOW IN    192.168.66.0/24
Mount the FreeBSD client with -o nfsv4.
 
Mount the FreeBSD client with -o nfsv4.
OMG... here is The Key! Now it's just works!! I'm very grateful to you, T-Daemon!!!

Added in /etc/fstab (still looking for _netdev option analog):
Code:
pi41:pub    /net/nfs/public    nfs    rw,-o=nfsv4

Still some questions to permissions and not all the shares mount, but I'm investigating it.
 
Back
Top