Posts tonen met het label Gentoo. Alle posts tonen
Posts tonen met het label Gentoo. Alle posts tonen

vrijdag 13 februari 2009

Konqueror: nfs, "The file or folder ... does not exist"

I really like konqueror because I can browse alot of sources with one application: mobile phone, ftp, files, nfs, ...

I use a FreeBSD host as nfs-server. And a gentoo box as a client.

After starting konqueror and typing the address of my nfs server in the location bar:
nfs://location

I see the different shares (as defined in /etc/exports).
However, when I click on one of the shared directories, I get an error:
The file or folder ... does not exist
.

This is strange as I am sure the permissions are correct. I mounted the share as root earlier, so an "Access Denied" message would be more appropriate then if faulty permissions where the cause.

When I tried it running Konqueror as the root user everything worked as expected. So I went digging in the Konqueror settings and stuff. I couldn't find anything.

So I decided to look on the nfs server. In /var/log/messages I found messages like this:
Feb xx 16:10:15 nfs-server mountd[53679]: mount request from 172.16.1.5 from unprivileged port


I did some research on the internet and found out why this message is displayed (however it is at first sight unclear if it is a warning, info or error message; if you have no access then you get "permission denied").
nfs sees connections from unprivileged ports (ports higher then 1024) as insecure. As konqueror is running as a normal user, it can't use privileged ports.

Now we know the cause, we still need to know what the solution for this is.
On a linux nfs server it is the "insecure" option in /etc/exports which also allows requests from unprivileged ports.
So I thought I put it in on my FreeBSD /etc/exports file.
However, when I restarted the nfs server I got this in /var/log/messages on the server (I also tried some other options that work in linux):
Feb xx 14:02:25 nfs-server mountd[52665]: bad exports list line /myvolume/filestorage 172.16.1.5(ro,insecure,all_squash,anon_uid=65534,anon_gid=65534)


It took me a while to find out that FreeBSD NFS and Linux NFS configs are not compatible:
Linux: http://linux.die.net/man/5/exports
FreeBSD: http://www.freebsd.org/cgi/man.cgi?query=exports&sektion=5
As you can see, FreeBSD has no such option in /etc/exports.

I looked again at the message in /var/log/messages and noted a very important detail: mountd.
Mountd is the process which is complaining. So I should be looking into the mountd manual.
So I did and found the -n option.
-n Allow non-root mount requests to be served. This should only be

specified if there are clients such as PC's, that require it. It
will automatically clear the vfs.nfsrv.nfs_privport sysctl flag,
which controls if the kernel will accept NFS requests from
reserved ports only.


This seems exactly what I want to accomplish. So I killed mountd and restarted it with the -n option:
killall mountd
mountd -r -n


It works!

To make this change permanent put one of the following two in /etc/rc.conf:
mountd_flags="-r -n"

or
weak_mountd_authentication="YES"

The last one I found in /etc/defaults/rc.conf (which is a very important file to see what defaults are used(and it is the proper way of doing this).

It took me a long time to solve this so I hope this helps somebody!

dinsdag 16 oktober 2007

Gentoo vs Sabayon

I have been a Gentoo user for a while but lately gave it up and tried ArchLinux.
The reason was that packages sometimes break and all the compiling and the lengthy install process.
What I really really like about gentoo is the package management. For each package you can choose whether you want the stable (extensively tested) or the unstable (you shouldn't take this unstable not very literally; ~x86) version.
Further, it is possible for each package to determine which specific version you want. Or if a version does not work, you can just mask it and it will go back to the old version.
If there is a newer version (than the masked one) it will be installed.

Now, Sabayon Linux is based on Gentoo.
But it uses an overlay (package repository that the Sabayon team have made available).
Also it has a very easy and fast installation. It let's you choose between a desktop (KDE, Gnome, Fluxbox) install and for example a server (core install).
Sabayon has announced Enthropy, which is a package manager which uses precompiled packages. Yes, indeed this has some disadvantages for optimizing all packages for your architecture but it saves you loads of time and it will still be possible to compile the packages.

So be ready for some post about Sabayon Linux