NFS client setup obviously not the same as FreeBSD


#1

I’ve arrived at TrueOS from dabbling with Ubuntu. I have a NAS which exports NFS3 and works happily with linux clients.

I can’t find any TrueOS reference to setting up a NFS client so I tried the BSD /etc/fstab method:
28.3.2. Configuring the Client

I couldn’t find a likely looking file in /etc/conf.d/servicename, so I used /etc/rc.conf to add the line:
nfs_client_enable=“YES”

I created the mount points under /mnt
[owen@trueos-4261] /mnt% ls -al
total 7
drwxr-xr-x 10 root wheel 10 12 Nov 17:54 .
drwxr-xr-x 21 root wheel 29 11 Nov 05:32 …
drwxrwxrwx 2 root wheel 2 12 Nov 17:54 flac
drwxrwxrwx 2 root wheel 2 12 Nov 17:54 media

I added entries to /etc/fstab
192.168.1.132:/media /mnt/media nfs ro,bg,hard,intr,rsize=32768,wsize=32768,vers=3,proto=tcp,noatime,timeo=600,retrans=2,intr 0 0
192.168.1.132:/FLAC /mnt/flac nfs rw,bg,hard,intr,rsize=32768,wsize=32768,vers=3,proto=tcp,noatime,timeo=600,retrans=2,intr 0 0

The FreeBSD command to start the service is “not found”

service nfsclient start

I want to do this the easy / traditional way before trying automounting - which at home is overkill. What resources for learning have I missed here?

Thanks in anticipation for help.


#2

TrueOS is migrated to OpenRC scripts for init.
rc-status -a command, make sure you have
netmount
rpcbind
statd
lockd
services running.
On the client, what is the output of:
showmount -e 192.168.1.132 (I assume this is the IP of your NAS)

Output of
rc-service netmount status
rc-service netmount stop
rc-service netmount start

The OpenRC service netmount looks in /etc/fstab for NFS mounts and will call the OpenRC service nfsclient if needed.

Post-First-Cup-Of-Coffee thoughts:

As root (term window su - or sudo /user/local/bin/bash) can you mount the shares by hand?

mount /mnt/flac or mount /mnt/media to use the entries in /etc/fstab (this tells you if there is a problem with the options).

or manually mount

mount 192.168.1.132:/FLAC /mnt/flac (this uses default values, mount can figure out that it’s a NFS mount).

These are the basic steps I always take when this doesn’t work. We may need to walk through Firewall setup/disabling on the TrueOS box too.

Edited to add a few more things that coffee reminded me of.


#3

Hi Mike,

Thanks for your suggestions. I am reminded of my dad who always kept a full toolbox in his car boot in case he broke down and someone knew how to use the tools :wink:

All the services were already running on the vanilla install. :slight_smile:

Here’s the answers to your post coffee questions. the commands that hung are the ones with a SIGINT / ^C:

[owen@trueOS-Owen] /usr/home/owen# showmount -e 192.168.1.132
^C
[owen@trueOS-Owen] /usr/home/owen# rc-service netmount status

  • status: started
    [owen@trueOS-Owen] /usr/home/owen# rc-service netmount stop
  • Caching service dependencies … [ ok ]
  • Unmounting network filesystems …
    umount: /mnt/shared: not a file system root directory
    umount: /mnt/susanshare: not a file system root directory
    umount: /mnt/software: not a file system root directory
    umount: /mnt/flac: not a file system root directory
    umount: /mnt/mediawr: not a file system root directory
    umount: /mnt/owenshare: not a file system root directory
    umount: /mnt/media: not a file system root directory
    umount: /mnt/photos: not a file system root directory
  • Failed to simply unmount filesystems
  • Unmounting /autofs … [ ok ]
  • Unmounting /net … [ ok ]
    [owen@trueOS-Owen] /usr/home/owen# rc-service netmount start
  • Mounting network filesystems …
    ^C * netmount: caught SIGINT, aborting
    [owen@trueOS-Owen] /usr/home/owen# mount /mnt/flac
    [tcp] 192.168.1.132:/FLAC: RPCPROG_NFS: RPC: Port mapper failure - RPC: Unable to send
    mount_nfs: Cannot immediately mount 192.168.1.132:/FLAC, backgrounding
    [owen@trueOS-Owen] /usr/home/owen# mount 192.168.1.132:/FLAC /mnt/flac
    ^C

The NAS, which works with Ubuntu clients fine is a QNAP - now they have some funny ideas about user IDs but from a user perspective the mounts just work.

I understand tat the important bits here are:
umount: /mnt/shared: not a file system root directory
and
[tcp] 192.168.1.132:/FLAC: RPCPROG_NFS: RPC: Port mapper failure - RPC: Unable to send
mount_nfs: Cannot immediately mount 192.168.1.132:/FLAC, backgrounding

. . . but I’ve no idea what they mean. This is a stable TrueOS which is straight out of the box as it were.

The firewall is exactly as set up by the default install and here’s the details:
uname -a
FreeBSD trueOS-Owen.ruggienet 12.0-CURRENT FreeBSD 12.0-CURRENT #66 ac2f0aa3b(trueos-stable)-dirty: Wed Jun 21 01:09:23 UTC 2017 root@gauntlet:/usr/obj/usr/src/sys/GENERIC amd64


#4

The fact that the showmount command hangs, leads me to believe the firewall may be mucking things up. I’d try stopping that (service name is probably ipfw, you can also do it from the sysadm client).

All the messages about “not a file system root directory”; do you have a bunch more in /etc/fstab? (shared, susanshare, software,…)?


#5

Ooops!!!

Big apologies are due.

I upgraded my router from Netgear to DDWRT. This required re-subnetting my network. The copy of existing mounts for clients to use on install hadn’t been updated with the new subnet and the new static addresses. Basically, all my static stuff went from e.g. x.x.x.132 to x.x.1.32.

They wouldn’t mount because I had the wrong ip addresses in the /etc/fstab file on my new trueOS client.

I corrected the IP addresses and can now see the server’s mounts. Now due to the QNAP NAS starting it’s users UID at 500, I set my user to a higher one:1000. Real OS’es like TrueOS won’t let me create a user under 1001 so I need to chown and chgrp all the files on my NAS to match a user of 1001. Or move it to FreeNAS.

Please accept my thanks for your help, I’ve learnt something about TrueOS from it and as punishment need to resolve why my client user can see the first level directories under the mount point but only “root” can see any lower than that.

How do I close the case as “user stupidity (myself)”? :frowning:


#6

I think you just did :wink:


#7