NFS problem

Hey I’m trying to set up a NFS on one of my systems, I followed the some what guide in NFS - openSUSE along with using the YaST tool for both the server and client. As far as I can tell the server is running correctly but when trying to set up the client I get an error about problem in fstab, this is what I have in my fstab entry

192.168.2.16:/home/music        /mnt/music      nfs4    defaults 0 0

Then when I tried to mount it by hand I get this error

vendion@SE-03:~> sudo mount 192.168.2.16:/home/music /mnt/music
mount.nfs: access denied by server while mounting 192.168.2.16:/home/music

I did allow any host from 192.168.2.*/24 domain, which would be any machine on my local network.

What’s in the error log on the server side?

And what is in /etc/exports on the server?

Where in the server can I find the error log? Also here is what is in /etc/exports

/home/music  192.168.2.*/24(rw)

192.168.2.*/24 is not a legal subnet specification. What you want is 192.168.2.0/24.

Here’s a rough and ready method when you aren’t sure which log file a message goes to. Provoke the error and then see what was the latest update in /var/log:

ls -lrt /var/log

The latest files changed will be at the bottom. Assumptions: It was actually written to some log file. The log is in /var/log and not a major subdirectory like samba or apache2. Buffering has had time to flush the message. The server isn’t so busy that plenty of log files get updated.

If you really want to be sure, check the documentation for the category of NFS server messages and then look at /etc/syslog-ng/syslog-ng.conf to see where they are directed.

Well changing the host ip in /etc/exports and restarting the NFS server I still can’t get on and ls -lrt /var/log didn’t help because /var/log/messages was the last one and that is just showing me people are trying to break into my FTP server.

What does

/usr/sbin/exportfs -v

(as root of course) output?

ken yap wrote:

>
> What does
>
>> /usr/sbin/exportfs -v
>
> (as root of course) output?
>
>

Here is what it had

code:

/home/music 192.168.2.0/24(rw,wdely,root_squash,no_subtree_check)


“We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure.” Karl Popper

Do you have these services running:

nfsd
nfsd4
rpc.mountd
portmap
rpc.statd
rpc.idmapd

Also have you tried a mount from the server itself? It should work the same way.

mount -t nfs 192.168.2.16:/home/music /somewhere

And since you are attempting to mount nfs4, I think there are other things you need like authentication. You’d have to do a search, I’m still using nfs version 3 (it’s only a thin client).

ken yap wrote:

>
> Do you have these services running:
>
>
> Code:
> --------------------
> nfsd
> nfsd4
> rpc.mountd
> portmap
> rpc.statd
> rpc.idmapd
> --------------------
>
>
> Also have you tried a mount from the server itself? It should work the
> same way.
>
>
> Code:
> --------------------
> mount -t nfs 192.168.2.16:/home/music /somewhere
> --------------------
>
>
> And since you are attempting to mount nfs4, I think there are other
> things you need like authentication. You’d have to do a search, I’m
> still using nfs version 3 (it’s only a thin client).
>
>

nfsd, nfsd4 and rpc.mounted are not on my system, portmap, nfsserver, rpc.statd, rpc.idmapd are running. I am able to mount it locally and now remotely I don’t know if it just decided to work, or the fact that this time I added -t nfs even though when I was calling mount with out that it could tell I was mounting a NFS and used mount.nfs for it.

The way it looks from the YaST module, both server and client, the only thing that you need to do for nfs4 is a domain name on the server. Of course there could be more this is the only thing special for nfs4 I had to specify.

“We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure.” Karl Popper

Ah, I see you don’t know how to use the CLI ps to check for running processes, you were using YaST. nfsserver starts nfsd* and rpc.mountd IIRC.

ken yap wrote:

>
> Ah, I see you don’t know how to use the CLI ps to check for running
> processes, you were using YaST. nfsserver starts nfsd* and rpc.mountd
> IIRC.
>
>

Well I can mount the drives now, but my permissions are not carried over to the remote client, I want to clients to have read and write permissions but for some reason the client machine only has read. Is there something I need to do to the permissions?

“We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure.” Karl Popper

Did you export it rw and also mount it rw at the client end? Also remember that root gets mapped to nobody (that’s what root_squash means). Also possibly because your uids don’t match up? If you do ls -l at the client and the owner of the files is not what you expect, you have uid mismatch. The accounts on both machines (at least the ones that matter to you) must match.

I told both server and client to have rw, but I can’t even create a file on the NFS. Here is what mount says on the client side

192.168.2.16:/home/music on /mnt/music type nfs (rw,addr=192.168.2.16,nfsvers=3,proto=tcp,mountproto=udp)

and /etc/exports has this

/home/music 192.168.2.0/24(rw)

and the directory on the server is owned by vendion in the users group and has read write permissions to that.

Note: the user on the server is the same on the client, sorry I forgot to add that earlier and I wasn’t able to edit my message

I found the problem, there was a permission issue with /home/music but I am able to connect to it just fine now.

Just as a side remark: Did you open the firewall port? If not, go to yast2 -> Security and Users -> Firewall -> Allowed Services and add the nfs server.

Just found the solution to your problem.
Read http://nfsv4.bullopensource.org/doc/NFS3_NFS4_migration.pdf note the part about a virtual root with fsid=0 that worked for me