PDA

View Full Version : mounting an nfs filesystem


ariskk
2007-12-23, 11:48 AM CST
Hi, I'm trying to do a simple thing, mount a folder from machine A to machine B.

My setup is:

2 linux boxes, A & B

A has a folder /mnt/java
B must mount this folder under /mnt/java as well.

In A, I tried modifying /etc/exports but whenever I do a :

mount 192.168.1.4:/mnt/java /mnt/java

I get a "mount: mount to NFS server '192.168.1.4' failed: RPC Error: Program not registered." error.

Any ideas?

Thanks, Kostas

erikpkn
2007-12-23, 01:27 PM CST
What does your /etc/exports look like? You have to export your mounts in that file.

Or maybe it's a firewall issue? Deactivate the firewalls on both machines to see if it works. Then we'll take it from there.

Erik.

ariskk
2007-12-23, 05:51 PM CST
Hi Erik, thanks for your reply.

I've just managed to make it work. My /etc/exports in machine A:

[root@server ~]# cat /etc/exports
/mnt/java 192.168.1.2(rw)

and I issued this command on machine B:

mount 192.168.1.4:/mnt/java /mnt/java

And it worked! Machine B's Ip is 192.168.1.2 and the server (A) is 192.168.1.4.

Since the server is not on all the time, I'll need to auto-mount the /mnt/java folder.I'll google around and ask for help if I run into troubles.

Thanks again,

Kostas

ariskk
2007-12-23, 06:20 PM CST
damn, ok, I can mount an nfs filesystem, but I can't write to it, only read.

Maybe it has something to do with groups. my server folder (/mnt/java) belongs to user/group ariskk/ariskk . Changed that to root/root but again I can only read files from the client machine.

Any suggestions?

erikpkn
2007-12-25, 07:46 AM CST
User authentication is a bit tricky in NFS because the UID and GID (userid and groupid, not username and groupname) must be the same on both sides of an NFS network. To open a share to anyone try adding all_squash to the export:/mnt/java 192.168.1.2(rw,all_squash)Also I'm not sure you're using your IP's the right way around. You can setup a mount point for the entire subnetwork:/mnt/java 192.168.1.0/24(rw,all_squash)Erik.

ariskk
2007-12-27, 04:11 PM CST
Hi, thanks for the reply. Unfortunatelly I still can't write to the shared folder.

my /etc/exports:

/mnt/java 192.168.1.0/24(rw,all_squash)

my client's fstab:

server.lan:/mnt/java /mnt/java nfs

I still can see the folder with read-only permissions.
(ofcourse I did a "service nfs restart")

I don't have firewall and selinux is disabled.

Regards,

Kostas

lazlow
2007-12-27, 07:01 PM CST
Did you check the RW permissions on the local mount point(client)?