mnis2008
asked on
NFS mount
I have an NFS server which is mounting /home onto another server. I am using NFS 4 to mount the FS
ON server
# cat /etc/exports
/exports *(ro,sync,insecure,root_sq uash,no_su btree_chec k,fsid=0)
/exports/home *(rw,nohide,sync,insecure, root_squas h,no_subtr ee_check)
ON client
mount SERVER:/home -o soft -t nfs4 /home_new
I am able to mount fine. But I went ahead and created a file on the server in home
drwxr-x--- 2 root root 4096 Apr 21 18:06 test
On the Client
home_new]# ls -ltr
total 0
I dont see the file, what might be the problem..
ON server
# cat /etc/exports
/exports *(ro,sync,insecure,root_sq
/exports/home *(rw,nohide,sync,insecure,
ON client
mount SERVER:/home -o soft -t nfs4 /home_new
I am able to mount fine. But I went ahead and created a file on the server in home
drwxr-x--- 2 root root 4096 Apr 21 18:06 test
On the Client
home_new]# ls -ltr
total 0
I dont see the file, what might be the problem..
ASKER
The command hangs
ASKER
I have used this link as reference
http://www.crazysquirrel.com/computing/debian/servers/setting-up-nfs4.jspx
http://www.crazysquirrel.com/computing/debian/servers/setting-up-nfs4.jspx
which command hangs?
Make sure you are not accessing the mounted file systems while you are restarting the service.
Also make sure that the exported folder permissions on the server is also correct.
Make sure you are not accessing the mounted file systems while you are restarting the service.
Also make sure that the exported folder permissions on the server is also correct.
ASKER
The touch command hangs I am still able to mount it.
On the server
# ls -l |grep home
drwxr-xr-x 4 root root 4096 Apr 21 18:06 home
On the server
# ls -l |grep home
drwxr-xr-x 4 root root 4096 Apr 21 18:06 home
ASKER
here is the error
# touch a
touch: cannot touch `a': Permission denied
# touch a
touch: cannot touch `a': Permission denied
ASKER
I figured out some thing, logging as root I am not able to write to the directories but as user I am able to write to those directories
That's the "root_squash" do:
The root user on clients that connect has the permissions of the user 'nfsnobody'.
The root user on clients that connect has the permissions of the user 'nfsnobody'.
ASKER
How do I check it, I have root_squash defined in the exports.
ASKER
Do u think the flags need to be modified in /etc/exports
- rw,nohide,sync,insecure,ro ot_squash, no_subtree _check
- rw,nohide,sync,insecure,ro
ASKER
NFSnobody exits on my server and client
Server - nfsnobody:x:4294967294:429 4967294:An onymous NFS User:/var/lib/nfs:/sbin/no login
Client - nfsnobody:x:65534:65534:An onymous NFS User:/var/lib/nfs:/sbin/no login
Server - nfsnobody:x:4294967294:429
Client - nfsnobody:x:65534:65534:An
Since in NFS /etc/exports has "root_squash" set,
so "root" on the client side will be treated as "nfsnobody".
So the permission on client /home
-----------
drwxr-xr-x 4 root root 4096 Apr 21 18:06 home
-----------
User "nfsnobody" has no permission to write. Unless you chmod o+rwx for /exports/home on NFS server
so "root" on the client side will be treated as "nfsnobody".
So the permission on client /home
-----------
drwxr-xr-x 4 root root 4096 Apr 21 18:06 home
-----------
User "nfsnobody" has no permission to write. Unless you chmod o+rwx for /exports/home on NFS server
User "root" has no permission to write since root is "nfsnobody" for this nfs mount.
ASKER
How do I give permissions to root
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just learnt that this is an insecure option, But I need this only till I copy some files to the share then I am going to remove the option and just use root_squash.
Thanks Chen
Thanks Chen
In Server file : /etc/export
Comment the first line
Then do
service nfs restart
Then on client
service netfs restart
Then issue this command and show me the output
touch /home/a