NFS4 mount

Hi all,

I am trying to configure an NFS4 server and client.

I have been through the entire setup and i have managed to mount the directory as i wanted to however it doesn't seem quite right.

My server is "swstage", the NFS4 pseudofilesystem is "/NFS4", the directory i am trying to export is "/soashare" size is 70GB (which i have bound within "/etc/fstab" to "/NFS4/soashare").

the client i am trying to mount that filesystem on is "soaserver", the directory i am trying to mount on is "/soa/share"

on nfs server settings are as follows:
/etc/exports (ip settings have been omitted but are correct.

/NFS4 ip.address(rw,fsid=0,sync,no_root_squash,no_wdelay)
/NFS4/soashare ip.address(rw,sync,no_root_squash,no_wdelay)

the setup of the /etc/fstab NFS4 bindings:

/soashare               /NFS4/soashare          none    bind            0 0

output of rpcinfo command:

rpcinfo -p | grep nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs

so it is nfs4 enabled, and it has the exports setup correctly, i think, please correct me if im wrong.

on the client settings are as follows
available mount points are (ip settings omitted but are correct):

showmount -e swstage
Export list for swstage:
/NFS4          ip.addresses
/NFS4/soashare ip.addresses

So we can see the directory is mountable as an NFS4 mount point.

/etc/fstab line, this is what im not entirely sure about being correct but i followed some very good instructions which worked for everything else so far so not sure why it wouldn't be right but this is what i have:

swstage:/    /soa/share          nfs4    defaults        0 0

and finally when i run the command

mount /soa/share

This works and it mounts the filesystem but it doesn't look right. first of all this /soashare directory on the NFS server is 70GB but the mounted directory is only showing as 2GB (which is the size of the / directory on the swstage server)

df -h
Filesystem            Size  Used Avail Use% Mounted on
swstage:/  2.0G  513M  1.4G  28% /soa/share

if i do an ls of /soa/share:

[root@soaserver share]# pwd
/soa/share
[root@soaserver share]# ls
soashare
[root@soaserver share]#

it shows i have mounted the pseudo filesystem, but if i change the entry in /etc/fstab to either of the following, i get exactly the same result as i described above:

swstage:/soashare    /soa/share          nfs4    defaults        0 0
swstage:/NFS4/soashare    /soa/share          nfs4    defaults        0 0

Can anyone tell me if i have done something wrong in all this or is there something i have missed out? Or even if this is correct and this is exactly what i am supposed to be seeing?

Cheers,
Tom

Does not look right.

I have not worked RH for several years, so I am more than rusty. However. You definitely should be able to see all of the files and df should show disk usage correctly.
Someone with better knowledge than mine will help.

How is the file system mounted on the server that owns the file system?

the actual filesystem on the NFS server is mounted on an LVM logical volume as follows.

/dev/mapper/vg03-soashare
                       69G  180M   66G   1% /soashare

This does not make sense. Why are you exporting both /NFS4 and /NFS4/soashare if all that you want do, as you state in your post, is to export /soashare? Why not just export /soashare? Why complicate things?

On the client, you appear to be trying to mount swstage's root file system, not the server's /soashare filesystem.

swstage:/    /soa/share          nfs4    defaults        0 0

Just another note which i guess makes sense but still seems a bit weird.

When i mount another client using the same settings, i can see the directory called "test" that i created on the first client, but i still cannot see it on the NFS server itself.

So it must be mounted and writing to the NFS server even though i can't see that file on the NFS server, and its not returning the correct filesystem sizing information within a df command.

one more question. do i only need the fsid=0 in the pseudo filesystem export settings or do i need fsid=0 in every filesystem that is exported in the "/etc/exports" file

---------- Post updated at 13:49 ---------- Previous update was at 13:40 ----------

fpmurphy,

My DBA colleague has asked me to setup the NFS share using NFS version 4, the setup of NFS version 4 requires a pseudo filesystem master filesystem. I was following the documentation i found in another post given on this website, here.

This is also a test as we are planning to have a whole host of filesystems being exported from this server using NFS version 4 so i need to get the specifics right first in a smaller environment before being rolled out to multiple servers and systems.

Again, the mounting of swstage:/ under version 4 works differently as this is not the root filesystem it is the pseudo filesystem that it mounts, again all explained in the documentation i was following.

I do appreciate your help with this matter.
Tom

Try the information listed here.

Setting up NFSv4

This should help. Make sure that portmapper is working, and that TCP is the method for transfer, as UDP has been deprecated for NFSv4.

Also, you may want to look into using relatime or a similar construct to prevent slow performance.

Again, gone through the entire setup step by step, it was identicle to the setup i had already done but still only showing that the mounted FS is 2GB and done a test write and it is definately writing to the home directory of the server and not the filesystem i have mounted...

Im not entirely sure what i did with this but i did manage to get it mounted properly showing the correct size and writing to the correct directory on the host server. I didn't change anything that i know of... but following the setup i set a link to in an earlier post is all i did and it eventually managed to work.

Cheers for all your help guys.