# how to start with nfs?

## fourhead

i just bought a nice small notebook as a second computer. it had a very strange OS on it, so i just formatted it and put gentoo on it  :Smile:  now, i of course want to connect it to my main gentoo box. in particular, i want to do the following:

get access to the internet trough my desktop machine,

share my data folders so i can access them on the notebook

share my printer so i can - guess what - print

share /usr/portage so that i save disk space & bandwidth

i just need a little hint where to start. i already know how to make my desktop an inet gateway, i've already done that before. but how do i share a dir/partition with NFS? what else do i need besides the nfs client/server modules in the kernel?

for cups, i think i know how to make cups listen to request not coming from localhost, but how do i tell cups on the notebook to print on the networked printer?

and for portage: could i just share /usr/portage on my desktop, mount it into /usr/portage on my notebook and thats it? i suppose i could then just rsync on my desktop, and then do an emerge --update world on the notebook, am i right?

thanks for your answers

tom

----------

## ebruning

You will need to emerge nfs-utils (i think that is what is is called). You will then need to edit your /etc/exports file and set which directories to share. To keep things simple you should make sure your user on both machines have the same UID. 

You can search the forums for examples of the exports file. I'm not on my gentoo machine right now or i would post mine, sorry.

You can configure cups on the laptop with a web browser, i think it listen on port 631 but not sure you will need to look at the config files to be sure and then instead of using the local host you specify the ip and printer name(ipp://ipaddress/printers/Photosmart). There used to be a post called Cups to Cups printing that was really good, but I cant seem to find it now.

Yes you can share your /usr/portage directory and just run emerge sync once. I used to do that.

----------

## fourhead

thanks, that'll help me a lot. i just didn't know where to start. so at least i know about /etc/exports  :Smile:  about the uid's: it doesn't matter how the users on the desktop and the notebook are called, as long as they have the same uid and are in the same group, they appear as the 'same' user to the system (at least when it is about file system permissions)?

tom

----------

## appetitus

read the Networking Howto for background if you need it

read the NFS Howto, it has most details

emerge nfs-utils

add to rc-update portmap and nfsmount  - on client, on server it is 'nfs'

add remote mount to /etc/fstab - on client

read system logs for error info

works fine here, about 5-6 machines share /usr/portage, about the only problems were

with using names rather than IP addresses in /etc/hosts.allow and /etc/exports.  NFS starts before BIND, so IP addresses are required.  Be VERY careful with whitespace in these config files, just use "one" space and be sure that it is in the right place.

--

For your printer, use cups or samba

For routing, you need to enable IP forwarding in /etc/conf.d/ after getting the network up.

----------

## peaceful

 *appetitus wrote:*   

> 
> 
> read the NFS Howto, it has most details
> 
> 

 

Where is the "NFS Howto"??  I've searched the forums and looked in the "User Docs" section on the main Gentoo site and haven't been able to find it.

----------

## neysx

Get all howto's with

emerge -s howto

or visit

http://nfs.sourceforge.net

----------

## peaceful

 *neysx wrote:*   

> Get all howto's with
> 
> emerge -s howto
> 
> or visit
> ...

 

"emerge -s howto" doesn't bring up any NFS howtos, but there is a link on the sourceforge page to:

http://nfs.sourceforge.net/nfs-howto/

which works for me.  Thanks.

----------

