gentoo.LinuxHowtos.orgedit this article

Portage via NFS

You have multiple gentoo installations in your network and don't want to waste disc space for the portage tree and bandwidth to sync them all?

Just read ahead :)

installing nfs server and client

First you have to install an nfs server on the server you picked and nfs utils on the clients.
emerge nfs-utils
Next you need to enable nfs server/client support in the kernel of the machines you use. (Usually this is already enabled)

Add the needed initscripts to the runlevel and nfs should work.

server: rc-update add nfs default
client: rc-update add nfsmount default

exporting your portage tree

On the server side you need to export your portage tree:
nano -w /etc/exports
add
/usr/portage     192.168.0.0/24(rw,sync,no_root_squash)
(modify the ip/netmask according to your network settings)

start the nfs server and nfs clients

Now, start the init scripts.

cleaning clients old portage tree

Next step has to be repeated on all client machines, NOT on the server
cd /usr/portage
rm -r *
This cleans the existing portage tree.

mounting the server's tree

add this to the /etc/fstab file on each client
192.168.0.1:/usr/portage  /usr/portage  nfs  rw
mount the new tree
mount /usr/portage
if all went fine, you should see the portage tree in /usr/portage

once again, this time with the cache

repeat the steps above with the directory /var/cache/edb/dep/usr/portage this way, portage uses the server's portage cache, which speeds up things a bit.

summary

In this setup one client fetches a file, all client can use it, this saves bandwidth and time, but creates more internal network load.
Every user can sync the tree now or you could create a crontab on the server to have it sync every week. Please don't sync more than once a day.
rate this article:
current rating: average rating: 1.0 (13 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back