LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 04-13-2006, 04:09 AM   #1
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Rep: Reputation: 15
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!
 
Old 04-13-2006, 09:15 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
Old 04-16-2006, 07:56 PM   #3
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
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!!
 
Old 04-16-2006, 08:16 PM   #4
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
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
 
Old 04-16-2006, 08:17 PM   #5
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
Currently nfs do not have these tcp shown?? Only have udp.
Please help.
 
Old 04-16-2006, 11:22 PM   #6
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
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!
 
Old 04-17-2006, 04:46 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.

Last edited by druuna; 04-17-2006 at 05:27 AM.
 
Old 04-17-2006, 05:05 AM   #8
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
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. =(
 
Old 04-17-2006, 05:11 AM   #9
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
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!
 
Old 04-17-2006, 05:14 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
Old 04-17-2006, 05:38 AM   #11
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
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
 
Old 04-17-2006, 06:09 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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.
 
Old 04-17-2006, 08:20 PM   #13
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
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!
 
Old 04-17-2006, 11:43 PM   #14
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Maybe this wil help:

Setting up NFS
 
Old 04-18-2006, 02:32 AM   #15
Eileen
Member
 
Registered: Oct 2004
Posts: 99

Original Poster
Rep: Reputation: 15
Thanks! =D
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is NFS performance faster with UDP vs TCP? Thaidog Linux - Networking 1 12-26-2005 02:05 PM
UDP over TCP The_Nerd Programming 7 07-21-2004 09:45 PM
nfs client should it use tcp or udp to nfs serve rportmapper andersonas Linux - Networking 2 06-30-2004 12:05 PM
Switching nfs from udp to tcp 850NA Linux - Networking 0 09-01-2003 10:11 PM
TCP vs. UDP mikeshn Linux - Networking 5 05-17-2003 04:14 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration