LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   nfs (tcp & udp) (https://www.linuxquestions.org/questions/linux-networking-3/nfs-tcp-and-udp-434722/)

Eileen 04-13-2006 04:09 AM

nfs (tcp & udp)
 
Hello,

Currently my PC has nfs running in udp protocol.
# rpcinfo -p
100000 2 tcp 111 portmapper
...
...
...
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs

Help:
How can I have my nfs running with the tcp protocol?

Appreciate any help!

druuna 04-13-2006 09:15 AM

Hi,

Server side: No action needed,
Client side: Change your fstab entry and add tcp.

Entry would look something like this:

inferno:/data/Downloads /mnt/nfs/Downloads nfs _netdev,rsize=8192,wsize=8192,soft,tcp

Don't know if you need/want the other options present.

man nfs for more details.

Hope this helps.

Eileen 04-16-2006 07:56 PM

Sorry, I am not very sure on how to add into my fstab. Can I re-confirm on the following?

My /etc/exports is :
/export/rootfs/target *(rw,no_root_squash,async)

So do I add this in my /etc/fstab :
/export/rootfs/target / nfs soft,tcp 0 0

Am I correct?? I need to change my nfs from udp to tcp. Is this the correct method? Do I have to restart any services after changing my fstab?

Thanks a zilliom!!

Eileen 04-16-2006 08:16 PM

100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
391002 1 tcp 741 sgi_fam
391002 2 tcp 741 sgi_fam
100011 1 udp 898 rquotad
100011 2 udp 898 rquotad
100011 1 tcp 901 rquotad
100011 2 tcp 901 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs <- How do I get my nfs to be set as tcp??
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs

100021 1 udp 32771 nlockmgr
100021 3 udp 32771 nlockmgr
100021 4 udp 32771 nlockmgr
100021 1 tcp 53022 nlockmgr
100021 3 tcp 53022 nlockmgr
100021 4 tcp 53022 nlockmgr
100005 1 udp 909 mountd
100005 1 tcp 912 mountd
100005 2 udp 909 mountd
100005 2 tcp 912 mountd
100005 3 udp 909 mountd
100005 3 tcp 912 mountd
100024 1 udp 917 status
100024 1 tcp 920 status

Eileen 04-16-2006 08:17 PM

Currently nfs do not have these tcp shown?? Only have udp.
Please help.

Eileen 04-16-2006 11:22 PM

Gosh, I am really desperate.

When I did this:
# mount -o proto=tcp 10.80.104.121:/export /export/rootfs/target

I got this error message:
mount: 10.80.104.121:/export failed, reason given by server: Permission denied

Why?? Please help!

druuna 04-17-2006 04:46 AM

Hi,

Quote:

Originally Posted by Eileen
My /etc/exports is :
/export/rootfs/target *(rw,no_root_squash,async)

So do I add this in my /etc/fstab :
/export/rootfs/target / nfs soft,tcp 0 0

Am I correct?? I need to change my nfs from udp to tcp. Is this the correct method? Do I have to restart any services after changing my fstab?

This looks correct. Just to make sure: If you made these changes while NFS was running and connections where set up, you need to re-mount the NFS partitions you changed.

Quote:

100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs <- How do I get my nfs to be set as tcp??
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
I don't understand the question: The bottom three are already tcp, the top 3 are udp. Or did you manually edit this output?

Use netstat (netstat -a -n | grep 2049)to check connections:

Output Server side:
Code:

If NFS is not running:
<no output is shown>

If NFS is running, but no connections are made from the outside:
tcp        0      0 0.0.0.0:2049            0.0.0.0:*              LISTEN     
udp        0      0 0.0.0.0:2049            0.0.0.0:*

If NFS is running and there is one tcp connections from the outside:
tcp        0      0 0.0.0.0:2049            0.0.0.0:*              LISTEN     
tcp        0      0 1.2.100.12:2049        1.2.100.10:798          ESTABLISHED
udp        0      0 0.0.0.0:2049            0.0.0.0:*

Output client side:
Code:

No connections:
<no output shown>

1 tcp connection to NFS server:
tcp        0      0 1.2.100.10:798          1.2.100.12:2049        ESTABLISHED

To (un)mount all NFS connections (client side) you can do this:
Mount: mount -t nfs -a
Unmount: umount -t nfs -a

If you cannot get it to work, please post the following information:

Server side (NFS is running):

- /etc/exports
- netstat -a -n | grep 2049
- rpcinfo -p | egrep 'nfs|nlock'

Client side:

- grep nfs /etc/fstab
- rpcinfo -p | grep nlock
- netstat -a -n | grep 2049

Hope this helps.

Eileen 04-17-2006 05:05 AM

This is the configuration from my Linux PC

# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 32768 status
100024 1 tcp 32768 status
391002 2 tcp 32769 sgi_fam
100011 1 udp 742 rquotad
100011 2 udp 742 rquotad
100011 1 tcp 745 rquotad
100011 2 tcp 745 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100021 1 udp 32770 nlockmgr
100021 3 udp 32770 nlockmgr
100021 4 udp 32770 nlockmgr
100005 1 udp 32771 mountd
100005 1 tcp 32770 mountd
100005 2 udp 32771 mountd
100005 2 tcp 32770 mountd
100005 3 udp 32771 mountd
100005 3 tcp 32770 mountd

# mount -o proto=tcp 10.80.104.121:/export/rootfs/target /home
nfs server reported service unavailable: Address already in use


What is going on? I cannot even configure my nfs to tcp. =(

Eileen 04-17-2006 05:11 AM

Is it my nfs-utils is too old for me to add tcp into nfs?

# rpm -qa | grep nfs
redhat-config-nfs-1.0.4-5
nfs-utils-1.0.1-2.9


Do I have to install a newer version of this nfs?? Sorry for my stupid question as I am considerable a newbie to linux. Thanks!

druuna 04-17-2006 05:14 AM

Hi,

Sorry but I cannot help if you don't post the information I asked for. The info you just posted (#9) is the same (more or less) then post #4 and #6.

Eileen 04-17-2006 05:38 AM

Ok, I am so sorry! Here is my answer.

Server side (NFS is running):

# /etc/exports
/export/rootfs/target *(rw,no_root_squash,async)
# netstat -a -n | grep 2049
udp 0 0 0.0.0.0:2049 0.0.0.0:*
# rpcinfo -p | egrep 'nfs|nlock'
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100021 1 udp 32774 nlockmgr
100021 3 udp 32774 nlockmgr
100021 4 udp 32774 nlockmgr

Client side:

# grep nfs /etc/fstab
<--- Blank
# rpcinfo -p | grep nlock
rpcinfo: can't contact portmapper: RPC: Remote system error - Connection refused
# netstat -a -n | grep 2049
<----- Blank too

druuna 04-17-2006 06:09 AM

Hi,

There should be an entry in your /etc/fstab (client side, as stated before (post #2). Something like:

<servername>:/export/rootfs/target /client/side/mointpoint nfs _netdev,rsize=8192,wsize=8192,soft,tcp

<servername> => name of the server that nfs runs on
/client/side/mointpoint => client side mointpoint (should exist).

About the 'Connection refused' message: portmap is probably not running (client side).

PS: Why are you using async in the exports entry? It does improve performance a bit, but the downside is data loss/corruption if a crash occurs.

Hope this gets you going again.

Eileen 04-17-2006 08:20 PM

For the making of my Linux PC kernel, do I have to activate the following:

- File systems -> Network File Systems -> NFS file system support [y] ?
-> Provide NFSv3 client support [y] ?
-> NFS Server support [y] ?
-> Provide NFSv3 server support [y] ?

Can someone advise me on the make xconfig of /usr/src/linux-2.4.20-8 in order to my nfs set to tcp?

Thank you!

druuna 04-17-2006 11:43 PM

Hi,

Maybe this wil help:

Setting up NFS

Eileen 04-18-2006 02:32 AM

Thanks! =D


All times are GMT -5. The time now is 06:06 PM.