# NFS portage and distfiles NOT working?

## The Doctor

Okay, this is truly odd. My setup is that my 'server' has no direct internet access or portage tree. It doesn't need it for its function of running programs in the background.

In order to keep it up to date and avoid over-syncing it shares my desktop's /usr/portage over NFS.

This is where the problem is. I want to emerge  sys-apps/portage-2.2.18 before anything else. I emerge it like normal, but it insists it must download the package. However, the package exists in /usr/portage/distfiles/portage-2.2.18.tar.bz2, exactly where it is supposed to. The current portage is sys-apps/portage-2.2.8-r2. Clearly, it shouldn't do this. I can see the file, I can touch the file, but I can't emerge the package.

It looks like it has the right permissions -rw-rw-r-- 1 portage portage 942561 Apr 25 21:37 /usr/portage/distfiles/portage-2.2.18.tar.bz2

And I can emerge some other packages, eudev for example, which just confuses me more.

My exports file

```
# /etc/exports: NFS file systems being exported.  See exports(5).

/export                 192.168.2.0/24(rw,fsid=0,no_subtree_check)

/export/portage         192.168.2.0/24(rw,nohide,insecure,no_subtree_check,no_root_squash)
```

I'd be happy to post anything else that is needed.

EDIT: Looks like a clock sync problem between the two boxes.

EDIT2: Nope, must be something else.

----------

## Irre

It works fine for me. I'm using a tiny raspberry pi as a gigantic fileserver   :Smile: 

All other systems share distfiles, portage, linux-source.

On "server":

/etc/exports/

```
# /etc/exports: NFS file systems being exported.  See exports(5).

/export                 *(rw,fsid=0,no_subtree_check)

/export/distfiles       *(rw,nohide,insecure,no_subtree_check,no_root_squash)

/export/portage         *(rw,nohide,insecure,no_subtree_check,no_root_squash)

/export/linux-src       *(rw,nohide,insecure,no_subtree_check,no_root_squash)

/export/transfer        *(rw,nohide,insecure,no_subtree_check,no_root_squash)
```

/etc/fstab

```
/sda2/linux-src         /export/linux-src auto          bind            0 0

/sda2/distfiles         /export/distfiles auto          bind            0 0

/sda2/portage           /export/portage   auto          bind            0 0

/sda2/transfer          /export/transfer auto           bind            0 0
```

On "clients":

/etc/fstab

```
192.168.1.2:/ /sdb2 nfs4 rw,noatime 0 0

/sdb2/linux-src         /usr/src        nfs             bind            0 0
```

/etc/portage/make.conf

```
DISTDIR="/sdb2/distfiles"

PORTDIR="/sdb2/portage"

PKGDIR="/sdb2/transfer/bindist64"
```

Server's vixie-cron runs "emerge --sync" every morning for me, but it can also be run from any client. 

Test on server:

```
rm  /sdb2/distfiles/portage-2.2.18.tar.bz2

emerge portage

 ls -l  /sdb2/distfiles/portage-2.2.18.tar.bz2

-rw-rw-r-- 1 portage portage 942561 Mar  4 21:13 /sdb2/distfiles/portage-2.2.18.tar.bz2
```

----------

## toralf

 *The Doctor wrote:*   

> but I can't emerge the package.

 error message ?

----------

## NeddySeagoon

The Doctor,

Permissions on the file?

----------

## toralf

Or wrong digest sum

----------

## szatox

 *Quote:*   

> And I can emerge some other packages, eudev for example, which just confuses me more. 

 is that portage tree over NFS actually mounted over local /usr/portage?

You surely have some older version.

Also, do you keep distfiles on the same filesystem that stores your /usr/portage? NFS ignores mountpoints, so separating those requires another line in exports.

----------

## The Doctor

Thanks for the thoughts.

@toralf

No error message. It just tries to download the package without a working internet connection. It shouldn't because the right package is there with the right permissions.

My desktop sees the file as being perfectly valid.

@NeddySeagoon

portage portage, as I believe it should be. I checked and my desktop and server both see the file as having the same permissions and it works from the desktop.

```
ls -l /usr/portage/distfiles/portage-2.2.18.tar.bz2 

-rw-rw-r-- 1 portage portage 942561 Apr 25 21:37 /usr/portage/distfiles/portage-2.2.18.tar.bz
```

@szatox

The server doesn't have anything at /usr/portage, just a mount point. My desktop exports the entire contents of /usr/portage which includes the portage tree, distfiles, and packages.

Which actually lead to an interesting conclusion. I could emerge the binary version of portage and a few other packages, but that seems to have broken sshd...

----------

## Jaglover

You better keep binpackages local, unless you have identical nodes.

----------

## toralf

and DISTDIR points to the right location (and you have only one of those location, right ?)

----------

## The Doctor

@Jaglover Yes, you are quite right. Normally I would have, but tired and not thinking leads to mistakes. Fortunetly, the two cpus are almost identical. I don't think it did any real harm.

@toralf

Yes, the DISTDIR points to the right place. Like I said, I could emerge eudev (which was an old file) but the newly downloaded portage didn't work.

Thinking on that, is it possible that clock skew is to blame here? I would have thought that if that was the case touching the file would solve that problem.

----------

## Jaglover

Out of sync clock can cause all kind of issues (that's why I run a NTP server in my router).

----------

## The Doctor

It looks like a clock problem. The dates  match within a minute, but still no joy with new packages, but the older ones are working. I'll get openntpd working and hopefully that will get this gremlin. I'll mark this as solved.

----------

## WWWW

hello,

anybody know whether NFS can have different root folders?

It make sense to have a root folder for something specific fsid=0.

But what if some different to share such as torrents? Can it be used fsid=1?

The fsid=0 concept is confusing.

thanks

----------

## The Doctor

It doesn't seem to be a clock problem. I have the times within a few seconds but portage still won't use the newer packages in the distfiles. It just tries to download them over again.

I let the packages sit for over 12 hours. This is getting really annoying.

----------

## NeddySeagoon

The Doctor

If old files work and new ones don't it has to be permissions.

Do you have FEATURES=userfetch now and didn't before?

Is portage the same userID on both boxes.  Its IDs that matter over NFS, not usernames.

----------

## The Doctor

I wish it where that simple. On my desktop

```
ls -l /usr/portage/distfiles/openntpd-5.7p3.tar.gz && id portage 

-rw-rw-r-- 1 portage portage 409734 Apr 27 13:32 /usr/portage/distfiles/openntpd-5.7p3.tar.gz

uid=250(portage) gid=250(portage) groups=250(portage)

```

On my server 

```
ls -l /usr/portage/distfiles/openntpd-5.7p3.tar.gz && id portage

-rw-rw-r-- 1 portage portage 409734 Apr 27 13:32 /usr/portage/distfiles/openntpd-5.7p3.tar.gz

uid=250(portage) gid=250(portage) groups=250(portage)
```

I have never had FEATURES=userfetch

EDIT:corrected partial info

----------

