LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Networking using NFS (https://www.linuxquestions.org/questions/linux-networking-3/networking-using-nfs-292331/)

WolfCub 02-19-2005 01:15 PM

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?

druuna 02-19-2005 01:32 PM

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.

eflester 02-19-2005 03:18 PM

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.

WolfCub 02-19-2005 05:15 PM

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...

druuna 02-19-2005 05:39 PM

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.

WolfCub 02-19-2005 07:24 PM

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?

nonzero 02-19-2005 10:55 PM

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

WolfCub 02-20-2005 08:06 AM

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.

druuna 02-20-2005 08:16 AM

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.

WolfCub 02-20-2005 08:36 AM

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:~#

WolfCub 02-20-2005 08:39 AM

/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:~#

nonzero 02-20-2005 09:21 AM

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?

druuna 02-20-2005 09:45 AM

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.

WolfCub 02-20-2005 10:07 AM

THANK YOU SOOOO MUCH!!!!!!!!!!! IT WORKS!!!!!! :D:D:D:D:D

YetAnotherDave 02-20-2005 10:45 AM

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


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