LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-10-2007, 03:44 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Question NFS On Debian?


I was wondering if it was a hard process to get my Debian box to act as a NFS on my home LAN? I have one main machine that has many files on a directory which I would like to dish out to other machines in my LAN.

I tried searching around but was not able to find a guide or steps needed. When I searched APT, I find the following .deb's:

Code:
nfs-common - NFS support files common to client and server
nfs-kernel-server - Kernel NFS server support
nfs-user-server - User space NFS server
nfsboot - Allow clients to boot over the network
nfsbooted - Prepares your image for nfs boot
I don't see a normal NFS"d" dameon package so I don't know which to install.
 
Old 04-10-2007, 04:09 PM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
It's real easy to set up nfs, assuming all systems share the same user numbers. I used the following (really old) web page:http://www.aboutdebian.com/lan.htm

Basically, SAMBA is a pain to set up, but nfs is a breeze. On the server side, you do little more than:

1) "apt-get install nfs-kernel-server"

and

2) create the file /etc/exports and make an entry for each directory you want to share.

Each entry will look something like this:

/export/docs 192.168.1.*(rw)

First is the path, then whitespace, then the allowed client addresses and then options in parentheses (with no space in between!).

On the client side, you'll want to make manual entries into /etc/fstab. An entry will look something like:

192.168.1.5:/export/docs /export/docs nfs auto 0 0

First is the server name or IP address, then a colon, then the share's path on the server. Second is the mount point--I almost always make the mount point identical to the server's path so symbolic links work the same on both the clients and the server. Then comes the file system type (nfs), options (like automatically mounting on boot) and then...some numbers I always put on the end to make it work.
 
Old 04-10-2007, 04:14 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Thanks - I am trying this right now. Do I need to install anything for NFS on the client side or can any linux machine with a LAN connections work as long as I add the entry in /etc/fstab?
 
Old 04-10-2007, 04:33 PM   #4
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Oh, that's right--you do need to install nfs-common on the clients also, if it's not already on their by default (I forget whether it is).

That web page I linked describes how to restart the nfs server for when you create or adjust /etc/exports.
 
Old 04-10-2007, 04:55 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by IsaacKuo

Each entry will look something like this:

/export/docs 192.168.1.*(rw)
OK - Thanks. Now you added a wild card just to allow every machine on that subnet, correct? And also I can change /export/docs for /home/user if I wish to share a home directory, right?
 
Old 04-10-2007, 05:15 PM   #6
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Yes, although it's probably better to share /home entirely if you're going to do it at all. Personally, I do NOT like sharing /home. There's some software which doesn't appreciate being run on multiple computers at the same time with the same user, like Firefox (or at least, Firefox used to be like that). Also, I like having different font, icon size, and window sizes on different computers. This is important when some computers are running at 2048x1536 and others are at 800x600!

Basically, I like to create an entirely "new" directory for shared data which doesn't mean anything to the OS or to any software by default.
 
Old 04-10-2007, 06:46 PM   #7
SweetLou
Member
 
Registered: Oct 2004
Distribution: Debian Testing
Posts: 171

Rep: Reputation: 30
I used http://www.debianhelp.co.uk/nfs.htm when I first setup NFS on my LAN.
 
Old 04-13-2007, 04:06 PM   #8
BillyGalbreath
Member
 
Registered: Nov 2005
Location: Houston Texas
Distribution: Debian Sid
Posts: 379

Rep: Reputation: 31
On the server:

1)
Code:
apt-get install nfs-kernel-server
2) setup /etc/exports
Code:
/directory/to/share 192.168.1.101(rw,no_wdelay,sync,no_root_squash)
* 1 line per shared directory/machine - wildcards will work if you awnt to share the same directory to more than one machine.
3)
Code:
/etc/init.d/nfsd restart
On each Client:

1) Create directory to mount the share:
Code:
mkdir /nfs/shared_dir
2) edit fstab to handle this
Code:
192.168.1.5:/directory/to/share /nfs/shared_dir nfs auto,defaults,wsize=8192,rsize=8192,intr,hard 0 0
 
  


Reply



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 Port Number on debian Sarge jess1975 Debian 1 11-04-2005 06:59 AM
kernel parameters for debian over nfs? Duplicator Debian 1 04-27-2004 07:44 PM
setting up the nfs server in debian stable. graham Debian 1 02-15-2004 04:16 AM
trouble with NFS-server on debian ocularbob Linux - Software 1 11-26-2003 10:10 PM
Installing Debian Over a Network (NFS?) jjp001 Debian 3 11-23-2003 02:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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

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
Open Source Consulting | Domain Registration