LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Noobie NFS4 question (https://www.linuxquestions.org/questions/linux-server-73/noobie-nfs4-question-859305/)

formar 01-28-2011 03:25 PM

Noobie NFS4 question
 
**Edit: path for mount was incorrect
Distro
Server: CentOS 5.5

Clients:
Fedora(latest)
OSX(latest)

Backround
I am attempting to setup a server in my house mostly(for the first time) for backups and file sharing. It is important to me that file permissions are preserved. So its my understanding that I must use idmapd in order for this to work. As of now I'm only working with the linux distros while osx will be dealt with once these two work together. portmapper is up and running, along with lockd on both machines. Firewalls are also down on both machines for now. The server side was all setup using the GUI interface with no extra options selected.

Problem
When attempting to "mount -t nfs4 10.0.0.2/$sharedfolder /mnt" I get an error operation not permitted with no error printing in /var/log/message. If I use "mount -t -o nolock nfs4 10.0.0.2/$sharedfolder /mnt" it mounts just fine. Ive checked both machines multiple times to make sure that lockd is up and running. In the idmapd.conf file I the domain as "localdomain" for both machines but I doubt that is right; like I stated above this is my first attempt at a server. I'm assuming the problem is a whole missing step that involves some kind of id mapping server I need to setup. If someone could point me in the right direction it would be much appreciated.

Thanks for your time
Anthony

*also UID and GID are the same on both machines

eSelix 01-28-2011 03:50 PM

Can you paste your /etc/exports file? Do you known that in NFS4 has changed format in comparison to NFS3?

formar 01-28-2011 04:05 PM

Quote:

Originally Posted by eSelix (Post 4240982)
Can you paste your /etc/exports file?

/tmp 10.0.0.0/24(rw,async,nohide,no_root_squash)

Quote:

Originally Posted by eSelix (Post 4240982)
Do you known that in NFS4 has changed format in comparison to NFS3?

I did not though I seem to get the same error either way, but thank you I'm sure you saved me some confusion after i fix this problem =D

eSelix 01-28-2011 04:11 PM

So you have configuration for NFS3. To mount directory exported that way try:
Code:

mount -t nfs 10.0.0.2/tmp /mnt
Give answer if this works or if you prefer NFS4.

formar 01-28-2011 04:19 PM

Wow special does not quite explain that....oversight. Thanks though! It did work though I would prefer nfs4 simple for the learning experience. Where/How did I go wrong?

eSelix 01-28-2011 04:38 PM

For NFS4 you have to:
1. Define root directory for sharing, for example I have /srv/nfs.
2. Create there directories which will act as mountpoints for shared directories, for ex.
Code:

mkdir -p /srv/nfs/tmp
mkdir -p /srv/nfs/Music

3. Mount there with option bind what you want to share, by fstab or manualy, for example in fstab
Code:

/tmp /srv/nfs/tmp none auto,bind 0 0
/home/data/Music /srv/nfs/Music none auto,bind 0 0

4. Modify /etc/exports (note fsid option):
Code:

/srv/nfs      10.0.0.0/24(rw,async,nohide,no_root_squash,fsid=0)
/srv/nfs/tmp  10.0.0.0/24(rw,async,nohide,no_root_squash)
/srv/nfs/Music 10.0.0.0/24(rw,async,nohide,no_root_squash)

5. And if you want to mount on the client you first specify -t nfs4 and second give path relative to root defined on the server in 1. point:
Code:

mount -t nfs4 10.0.0.2/tmp /mnt/tmp
mount -t nfs4 10.0.0.2/Music /mnt/Music

I think, you can also mount whole structure, but I do not tested that:
Code:

mount -t nfs4 10.0.0.2/ /mnt


All times are GMT -5. The time now is 03:26 PM.