LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 02-19-2005, 02:15 PM   #1
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Rep: Reputation: 30
Networking using NFS


I have a laptop and a desktop both running Debian 3.1. I have a crossover cable plugged into eth1 on the desktop and eth0 on the laptop. I want to set up NFS so I can share files and folders. I will just share the /root/ folder on both. On the LAN, the laptop's IP is 192.168.0.2 and the desktop's is 192.168.0.1. The LAN is working, because the laptop accesses the internet through the desktop. How do I share files and folders?
 
Old 02-19-2005, 02:32 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

You need to set up a nfs server (probably your desktop) and a nfs client (probably your notebook).

Take a look here for some good info about NFS and how to install/configure.

Hope this helps.
 
Old 02-19-2005, 04:18 PM   #3
eflester
Member
 
Registered: Sep 2003
Location: Washington
Distribution: Ubuntu, Ubuntu studio
Posts: 75

Rep: Reputation: 17
This is as good a place as any for me to relate some recent tribulations regarding NFS.

I use a 400MHz box as a file server. It runs Red Hat 9.

My client has run various distros, at the moment Mandrake 10.0 Official. At one time the client was also running RH9, and I had only problem #2, not problem #1.

Problem #1: When I changed from RH9 to another distro, I suddenly got into access problems with the nfs shares. Turns out that the new distro assigned my user "eric" a different UID number than RH9 had. In order to fix this I had to change my uid number on the client to match the server. (Guess I could have gone the other way around just as well.) I did this with the "find" command. My user 'eric' needed to be uid 500, but was set to 501:

#find / -uid 501 -exec chown 500 {} \;

I found this command to be very particular. There are TWO spaces between the "500" and the {}, and ONE between the {} and the \.

This worked -- but --

Problem #2: This seemed to happen only when I used Open Office to open/save/write a document from the client to the server. "Only," however, is kind of an unimportant word here, as that is probably the number one usage of NFS for me. This problem tracked me from one distro to another, seemingly insensitive to any efforts I made to fix it. What I THINK was causing this: the onboard NIC on my el-cheapo "ASROCK" board. I just installed a Linksys 10/100 NIC on the PCI bus and I am reluctant to say this categorically but I think the problem is gone. I just edited a complicated document with no problems. This almost never happened before. I had gotten in the habit of using scp to move the docs to my client, work on them, and scp them back. A little unwieldy you must admit.

So, I hope these remarks may help someone, including the originator of this thread.

Regarding problem #1: You may, of course, simply make your NFS share "world writeable," and that's what I've done at this point after changing loads on the client several times. It's too much to keep changing the ID numbers, and there's nobody behind my firewall but me. I have tried messing with group membership, but the server seems wise to that, and apparently doesn't count my uid from the client as a valid member of a group on the server. So reluctantly I chmodded my home directory on the server to 777 and all is fine with access.

What do people do in the "real" world? Is there something better than NFS for Linux/Linux networks? I hate to use Samba, but I'm tempted. I use it to my Windows box and it works fine, but why shouldn't I be able to use NFS without all this fiddling?

As always, I really appreciate this forum and everyone's contributions.
 
Old 02-19-2005, 06:15 PM   #4
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
I went through that NFS setup guide, and I set the desktop up as the server and the laptop up as the client. When I try to access files on the desktop from the laptop I get a permission denied by server error and when I try to access files on the laptop from the desktop I get:

mount: RPC: Program not registered
Please check that the disk is entered correctly.

Please help me get these problems worked out...
 
Old 02-19-2005, 06:39 PM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

Are your /etc/host.allow and /etc/host.deny files on your server (desktop) set up correctly? Your laptop is not allowed access.

BTW: If your desktop is a NFS server and your laptop is client, you cannot access files on your laptop from your desktop. Only the other way around.
 
Old 02-19-2005, 08:24 PM   #6
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
This is the hosts.allow file for the desktop:

ALL: 192.168.0.2
portmap: 192.168.0.2
lockd: 192.168.0.2
rquotad: 192.168.0.2
mountd: 192.168.0.2
statd: 192.168.0.2

This is the hosts.deny for the desktop:

portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

Please help.

Also, how can I share and browse files on both computers?

Also, isn't there a script or program I can run that will set all this up for me?

Last edited by WolfCub; 02-19-2005 at 08:31 PM.
 
Old 02-19-2005, 11:55 PM   #7
nonzero
Member
 
Registered: Feb 2005
Distribution: Debian FC4 LFS Slackware
Posts: 174

Rep: Reputation: 31
Peer to Peer

http://people.cs.uct.ac.za/~gmushwan/

RedHat's solution

http://www.redhat.com/software/rha/gfs/
(kinda expensive though)

http://nfs.sourceforge.net/
with http://www.linux-consulting.com/Amd_.../autofs-3.html

and
http://www.tldp.org/HOWTO/NIS-HOWTO/

I am currently experimenting with the Andrew File System with Kerberos but I don't have enough experience with it to be of any use to you.

All of the other solutions above (and I am sure there are others) require an investment of time and in my experience do not setup easlily out of the box. Also, in your situation, the dynamics of using a laptop on your lan adds additional complexity due to it's ability to be
disconnected and reconnected to the network.

Jus' my two cents,

nz
 
Old 02-20-2005, 09:06 AM   #8
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
OK, well NFS looks the simplest since its already mostly set up with just some permission errors, if we could fix those errors that would be great. I will maybe look into another solution at a later date if the need arises.
 
Old 02-20-2005, 09:16 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

Do you have a firewall running that prohibits access to the desktop?

What do your /etc/exports (desktop) and /etc/fstab (laptop) file look like?

What's the output of rpcinfo -p (both desktop and laptop)

Maybe a solution can be found with the above info.
 
Old 02-20-2005, 09:36 AM   #10
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
I do not have a firewall that I know of... /etc/exports on the desktop contains:

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
/home 192.168.0.2(rw,user,noauto)

rpcinfo -p on the desktop outputs:

debian:~# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 857 status
100024 1 tcp 860 status
100003 2 udp 2049 nfs
100003 2 tcp 2049 nfs
100005 1 udp 867 mountd
100005 2 udp 867 mountd
100005 1 tcp 870 mountd
100005 2 tcp 870 mountd
debian:~#

Last edited by WolfCub; 02-20-2005 at 09:41 AM.
 
Old 02-20-2005, 09:39 AM   #11
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
/etc/fstab for the laptop has:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / reiserfs notail 0 1
/dev/hda3 /mnt/backup reiserfs defaults 0 2
/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
192.168.0.1:/home /mnt/home nfs rw,hard,intr 0 0


and rpcinfo -p for the laptop outputs:

EvoN620:~# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 623 status
100024 1 tcp 626 status
EvoN620:~#
 
Old 02-20-2005, 10:21 AM   #12
nonzero
Member
 
Registered: Feb 2005
Distribution: Debian FC4 LFS Slackware
Posts: 174

Rep: Reputation: 31
You say you want to share /root but the exports file for one of your machines, is setup to export /home. It is not a good idea to export your root directory. The FAQS and HOWTOS will have you create a directory on your client under /mnt; i.e. /mnt/home. Then you will start an NFS server on machine1 (the server) and mount its /home directory on machine2's (the client's) /mnt/home directory. When the /etc/exports, /etc/hosts.allow and /etc/hosts.deny settings are correct you will be able to issue the command;
mount 192.168.0.1:/home /mnt/home and be able to move files back and forth.

nz

EDIT: Sorry, I just saw you had a /etc/fstab entry for your nfs mount. Have you created /mnt/home on your laptop?

Last edited by nonzero; 02-20-2005 at 10:31 AM.
 
Old 02-20-2005, 10:45 AM   #13
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

Your /etc/exports file doesn't look correct: /home 192.168.0.2(rw,user,noauto)
The user and noauto are no exports option, remove them. Take a look at man 5 exports for all the available options.

The /etc/fstab entry is also incorrect: 192.168.0.1:/home /mnt/home nfs rw,hard,intr 0 0
The rw and 0 0 are not correct for a nfs entry. See man 5 nfs for all nfs fstab options.

This is a better entry (left hard,intr I assume thats a personal choice:

192.168.0.1:/home /mnt/home nfs _netdev,hard,intr,rsize=8192,wsize=8192

Hope this helps.
 
Old 02-20-2005, 11:07 AM   #14
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
THANK YOU SOOOO MUCH!!!!!!!!!!! IT WORKS!!!!!!
 
Old 02-20-2005, 11:45 AM   #15
YetAnotherDave
Member
 
Registered: Feb 2005
Posts: 95

Rep: Reputation: 17
firewall check & sever config

Hi,

As druuna implied, you might have a firewall running. You said you do now have a firewall that you know of but it's probably worth double checking. What does "iptables -L" ( as root user ) show on the two machines?

A few weeks ago, I went through the process of setting up a central server. I ended up using samba for windows access and nfs for linux access. So far both seem to be working fine.

I also tried samba (smbclient) and something called "sfs" ( self-certifying file system ) for linux access to the sever. Both had problems. Smbclient was very slow and caused the client machine to hang frequently. Sfs was better but file renames/moves seemed to be missed. Of course, these problems could have been configuration error of some kind ( my fault ) but now that nfs is working I'm done looking at other options.

- Dave
 
  


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
NFS client = Linux, NFS server = Mac OS X Tiger --> Hell of a problem make Linux - Networking 9 03-10-2006 06:16 AM
Networking 2 linux boxes with NFS?? ludwig W SUSE / openSUSE 4 10-16-2005 04:09 PM
nfs client on knoppix 3.9 - problem mounting nfs drive Rod Butcher Linux - Networking 1 09-21-2005 05:18 AM
NFS problem networking 2 RH9 boxes rblampain Linux - Networking 11 10-25-2004 01:05 AM
calling all networking gurus (nfs install) N_A_J_M Linux - Networking 0 12-15-2002 07:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration