View previous topic :: View next topic |
Author |
Message |
rasmus Tux's lil' helper
Joined: 14 Jul 2002 Posts: 78
|
Posted: Tue Aug 27, 2002 1:28 am Post subject: NFS-sharing /usr/portage? |
|
|
I'm about to install gentoo on my laptop (my stationary computer already runs it), and got the idea to simply make /usr/portage/distfiles on an NFS share so I wouldn't have to download everything twice. Then I thought, why not share the entire /usr/portage?
Any reason why this would be a bad idea? The only reason I would use NFS is that I haven't tried the other network file systems and don't know how they work.
By the way, is there any NFS support on the install disk or do I have to wait until I have a running system before doing this? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Tue Aug 27, 2002 3:36 am Post subject: Re: NFS-sharing /usr/portage? |
|
|
rasmus wrote: | Any reason why this would be a bad idea? |
I do it. There are a couple of gotchas. You have to make /usr/portage/distfiles world-writeable, if you have root-squash on. Ditto for /usr/portage/packages if you're building binary packages. What I do is to have all files in the shared /usr/portage belong to a non-root user, who used to synchronize via CVS with the upstream portage tree, until this service was apparently turned off. qpkg hits the network, and therefore becomes considerably slower.
Quote: | By the way, is there any NFS support on the install disk or do I have to wait until I have a running system before doing this? |
I believe there is NFS support on the 1.4 betas, but not in previous versions. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Thu Nov 07, 2002 8:44 pm Post subject: |
|
|
I am intersted in this method as i have a couple of note books and a main server and would llike to get rid of usr/portege on the note books to save soem harddrive space.
How do you set the system to use the NFS share when booting? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Thu Nov 07, 2002 9:17 pm Post subject: |
|
|
carpman wrote: | How do you set the system to use the NFS share when booting? |
Just add an entry in /etc/fstab. Use hostname:/directory in the first field, and type "nfs". I use options rw,hard,intr. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
sgipan n00b
Joined: 04 Nov 2002 Posts: 21 Location: Montevideo, Uruguay
|
Posted: Tue Nov 12, 2002 4:03 pm Post subject: |
|
|
rac wrote: | carpman wrote: | How do you set the system to use the NFS share when booting? |
Just add an entry in /etc/fstab. Use hostname:/directory in the first field, and type "nfs". I use options rw,hard,intr. |
hm, doesn't work for me.... got to mount it manually each time I boot up.
here's my fstab entry: Code: |
192.168.0.1:/tmp/test /mnt/nfs nfs rw,hard,intr 0 0 |
What am I doing wrong?
sgipan |
|
Back to top |
|
|
choenig Tux's lil' helper
Joined: 04 Nov 2002 Posts: 83 Location: EDDK, Germany
|
Posted: Tue Nov 12, 2002 7:07 pm Post subject: |
|
|
Hi,
to enable nfs-mounting on bootup, you got to add netmount to runlevel default.
Code: | rc-update add netmount default |
take care, have fun
/christian |
|
Back to top |
|
|
sgipan n00b
Joined: 04 Nov 2002 Posts: 21 Location: Montevideo, Uruguay
|
Posted: Tue Nov 12, 2002 9:49 pm Post subject: |
|
|
nevertheless wrote: | Hi,
to enable nfs-mounting on bootup, you got to add netmount to runlevel default.
Code: | rc-update add netmount default |
take care, have fun
/christian |
Thanx; it is already installed in the default runlevel. However, the share is not being mounted at boot up.
Even added the auto-option in fstab:
Code: | 192.168.0.1:/tmp/test /mnt/nfs nfs auto,rw,hard,intr 0 0 |
but no luck
Another idea?
- Stephan |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Tue Nov 12, 2002 9:59 pm Post subject: |
|
|
I have my NFS shares listed as pass 2, but fstab's man page says that only affects fsck. What version of baselayout do you have? There have been some dependency changes recently in the init scripts. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
sgipan n00b
Joined: 04 Nov 2002 Posts: 21 Location: Montevideo, Uruguay
|
Posted: Tue Nov 12, 2002 10:41 pm Post subject: |
|
|
rac wrote: | I have my NFS shares listed as pass 2, but fstab's man page says that only affects fsck. What version of baselayout do you have? There have been some dependency changes recently in the init scripts. |
Hm, found 3 files in /usr/portage/sys-apps/baselayout:
baselayout-1.8.3.ebuild
baselayout-1.8.4.1.ebuild
baselayout-1.8.4.2.ebuild
However, which version is installed I don't know. The latest one? How do I find out?
When checking emerge -up baselayout, I get
[ebuild U ] sys-apps/baselayout-1.8.4.2 to /
....
If I just wanted to update baselayout (just in case), there is a problem: glibc would also be updated to glibc-2.2.5-r7 But glibc crashes on compile, tried that before... Don't know how to solve that one yet.
But anyways: it doesn't look like I have an ancient version of baselayout, does it?
- Stephan |
|
Back to top |
|
|
choenig Tux's lil' helper
Joined: 04 Nov 2002 Posts: 83 Location: EDDK, Germany
|
Posted: Tue Nov 12, 2002 10:56 pm Post subject: |
|
|
For netmount it is only necessary, that /etc/init.d/netmount has a part, which looks like this:
Code: | depend() {
local myneed="net"
local myuse=""
#
# Only have Portmap as a dependency if there is a nfs mount in fstab
# that should be mounted at boot time. Also filter out comments.
#
local nfsmounts="$(awk '!/^#/ && $3 == "nfs" && $4 !~ /noauto/ { print $
0 }' /etc/fstab)"
if [ -n "${nfsmounts}" ]
then
local myneed="${myneed} portmap"
local myuse="${myuse} nfs"
fi
need ${myneed}
use ${myuse}
}
|
The important thing about that is the "need ${myneed}" at the end, if there is another variable given then specified in "local myneed", then you have to change it to that name given by "local myneed"
This is a bug, i recently "submitted".
take care, have fun
/christian |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Tue Nov 12, 2002 10:58 pm Post subject: |
|
|
sgipan wrote: | However, which version is installed I don't know. The latest one? How do I find out? |
Code: | $ emerge -s baselayout |
Quote: | If I just wanted to update baselayout (just in case), there is a problem: glibc would also be updated to glibc-2.2.5-r7 |
You can always mask or inject packages like this, but I really don't recommend doing it.
Quote: | But glibc crashes on compile, tried that before... Don't know how to solve that one yet. |
Do you have a link? I skimmed your posting history, but couldn't find it. Inability to compile glibc is often indicative of subtle hardware problems, and it's something I would try to fix immediately if I were you.
Quote: | But anyways: it doesn't look like I have an ancient version of baselayout, does it? |
If you haven't updated it since you installed, because of the glibc issue (and you may have an open security issue if you don't upgrade glibc), you may very well have an old enough baselayout that it would be worth looking into. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
sgipan n00b
Joined: 04 Nov 2002 Posts: 21 Location: Montevideo, Uruguay
|
Posted: Tue Nov 12, 2002 11:20 pm Post subject: |
|
|
nevertheless wrote: | For netmount it is only necessary, that /etc/init.d/netmount has a part, which looks like this:
Code: | depend() {
local myneed="net"
local myuse=""
#
# Only have Portmap as a dependency if there is a nfs mount in fstab
# that should be mounted at boot time. Also filter out comments.
#
local nfsmounts="$(awk '!/^#/ && $3 == "nfs" && $4 !~ /noauto/ { print $
0 }' /etc/fstab)"
if [ -n "${nfsmounts}" ]
then
local myneed="${myneed} portmap"
local myuse="${myuse} nfs"
fi
need ${myneed}
use ${myuse}
}
|
The important thing about that is the "need ${myneed}" at the end, if there is another variable given then specified in "local myneed", then you have to change it to that name given by "local myneed"
This is a bug, i recently "submitted".
take care, have fun
/christian |
COOOOOOOOOOOOOOOOOOOOOOOOOOOL! that did it! Wouldn't have found that problem in this century nor in the next.
Thanx a fat lot!
Gruß aus Uruguay
- Stephan |
|
Back to top |
|
|
sgipan n00b
Joined: 04 Nov 2002 Posts: 21 Location: Montevideo, Uruguay
|
Posted: Tue Nov 12, 2002 11:25 pm Post subject: |
|
|
rac wrote: | sgipan wrote: | However, which version is installed I don't know. The latest one? How do I find out? |
Code: | $ emerge -s baselayout |
|
Thanks. It's 1.8.3
rac wrote: | Quote: | But glibc crashes on compile, tried that before... Don't know how to solve that one yet. |
Do you have a link? I skimmed your posting history, but couldn't find it. Inability to compile glibc is often indicative of subtle hardware problems, and it's something I would try to fix immediately if I were you.
|
Oh-oh.... well, thanx. I'll look around in the forums.... don't have *any* idea what that might be now. However, the System is only 1 week old, so hopefully it's not that urgent.....
Ah, what the heck, we're real men, right?
Cheers, Stephan |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Tue Nov 12, 2002 11:31 pm Post subject: |
|
|
For the record, the version of /etc/init.d/netmount in baselayout 1.8.4.2 (1.19 2002/10/13) seems to have this line - nevertheless, what's the bug number? _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
choenig Tux's lil' helper
Joined: 04 Nov 2002 Posts: 83 Location: EDDK, Germany
|
Posted: Wed Nov 13, 2002 8:42 am Post subject: |
|
|
@rac:
Quote: | For the record, the version of /etc/init.d/netmount in baselayout 1.8.4.2 (1.19 2002/10/13) seems to have this line - nevertheless, what's the bug number? |
I didn't submit it to the bugtracking system, but I talked to some guys on #gentoo (openprojects.net) and some days later, this was fixed.
take care, have fun
/christian |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Nov 13, 2002 8:44 am Post subject: |
|
|
nevertheless wrote: | I talked to some guys on #gentoo (openprojects.net) and some days later, this was fixed. |
Thanks for taking the time to research the issue and submit the feedback. Contributions like this make Gentoo better for all of us. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
rizzo Retired Dev
Joined: 30 Apr 2002 Posts: 1067 Location: Manitowoc, WI, USA
|
Posted: Wed Jan 29, 2003 11:13 pm Post subject: |
|
|
Coming back to this. I have no knowledge of nfs.
I have this in my /etc/exports file. Could someone please give me a non-RTFM validation:
Code: | /usr/portage *.lan.domain.org(rw,no_root_squash) |
Basically I want the users who mount this to be able to write to it if they emerge something and a new distfile is downloaded.
Also do you recommend just sharing the distfiles directory as opposed to all of portage, since rsyncing the ebuilds doesn't take that much.
Side Edit: I wasn't able to get "*.lan.domain.org" to work. When I tried to mount from the client machine it said the server said permission denied. If I specify the hostname then it at least tries and hangs. (see next note) :p
Last edited by rizzo on Thu Jan 30, 2003 8:02 pm; edited 1 time in total |
|
Back to top |
|
|
rizzo Retired Dev
Joined: 30 Apr 2002 Posts: 1067 Location: Manitowoc, WI, USA
|
Posted: Thu Jan 30, 2003 7:49 pm Post subject: |
|
|
OK well I tried it with this in my /etc/fstab:
Code: | nfsbox.lan.domain.org:/usr/portage /usr/portage nfs auto,rw,hard,intr 0 0 |
on my client machine. However when I run "mount /usr/portage" it hangs and goes defunct so that I can't even kill it.
Can anyone who's done this post their /etc/exports and /etc/fstab files for a lowly newb? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Thu Jan 30, 2003 9:07 pm Post subject: |
|
|
rizzo, make sure that portmap is installed and running on the client machine as well as the server. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
rizzo Retired Dev
Joined: 30 Apr 2002 Posts: 1067 Location: Manitowoc, WI, USA
|
Posted: Thu Jan 30, 2003 9:18 pm Post subject: |
|
|
Hmm that might be my problem. Of course now my session hangs when I try to do anything with the portage directory (even ls -l /usr). So it might have to wait until I get home. |
|
Back to top |
|
|
axxackall l33t
Joined: 06 Nov 2002 Posts: 651 Location: Toronto, Ontario, 3rd Rock From Sun
|
Posted: Thu Jan 30, 2003 9:36 pm Post subject: |
|
|
Quote: | got the idea to simply make /usr/portage/distfiles on an NFS share so I wouldn't have to download everything twice. |
I use Squid (http proxy) by few gentoo boxen and in most of cases they take their files from the cache. I have to use squid anyway as they are behind the firewall.
As for the rest portage... I have to patch it (mostly unmasking, but still some patching) from time to time in few ebuilds and I do it diff way on diff boxen as they are very diff by hardware component, CPU platform and functional reqs. So, I am thinking of using some more fine-grained replication. Coda perhaps? |
|
Back to top |
|
|
rizzo Retired Dev
Joined: 30 Apr 2002 Posts: 1067 Location: Manitowoc, WI, USA
|
Posted: Thu Jan 30, 2003 11:35 pm Post subject: |
|
|
rac wrote: | rizzo, make sure that portmap is installed and running on the client machine as well as the server. |
Yup that was the problem. Thanks for the tip. I was getting frustrated as hell.
edit: actually there is one more issue. In my /etc/exports I have to specify each host in my lan by name, it isn't accepting wildcards like *.lan.com. Any takers? |
|
Back to top |
|
|
cbreaker Tux's lil' helper
Joined: 05 Feb 2003 Posts: 105 Location: Pawtucket, RI
|
Posted: Wed Feb 12, 2003 7:18 am Post subject: |
|
|
Perhaps it's trying to look up the hostnames by IP address, and reverse DNS lookups aren't working.
Try to nslookup your workstation by IP address and see if it resolves the right/any name. If it doesn't, it could be the problem. |
|
Back to top |
|
|
Koon Retired Dev
Joined: 10 Dec 2002 Posts: 518
|
Posted: Thu Jun 12, 2003 9:02 am Post subject: Re: NFS-sharing /usr/portage? |
|
|
rasmus wrote: | Any reason why this would be a bad idea? |
What would happen if two workstations sharing the same tree do an emerge sync at the same time ? What if two workstations download the same distfile ? Would NFS figure it out correctly or would it lead to strange bugs ?
-K |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9522 Location: beyond the rim
|
Posted: Thu Jun 12, 2003 11:46 pm Post subject: |
|
|
If you're using nfs to share PORTDIR make sure you don't try to write on it from different hosts at the same time. The critical parts of portage for this are fetching distfiles and syncing the tree. emerge sync can be solved easiely by putting a cronjob on the server machine and simply forget about it
The distfiles problem is a bit more severe, if you tend to update your machines at the same time. When fetching a bigger package like kernel or mozilla you might end up with corrupt distfiles. |
|
Back to top |
|
|
|