LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   NFS - Permission Denied Error (https://www.linuxquestions.org/questions/linux-newbie-8/nfs-permission-denied-error-602396/)

yusufs 11-26-2007 02:35 AM

NFS - Permission Denied Error
 
Hai all,

I tried mounting a drive on the remote server and it is mounted and when am trying to create any directory in the mounted drive : am
getting the following error :


Client machine :
******************
[root@test ]# mkdir tes1
mkdir: cannot create directory `tes1': Permission denied


server :
*********
[root@oracle oracle]# cat /etc/exports

/d03 test.sud.com.kw(rw)
/d02 test.sud.com.kw(rw)
/d05 test.sud.com.kw(rw)

where /d05 is the drive which was mounted on the client test.


******************************************************
[root@oracle oracle]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
LABEL=/stage /stage ext3 defaults 1 2
none /sys sysfs defaults 0 0
LABEL=SW-cciss/c0d0p3 swap swap defaults 0 0
/dev/sda5 /d01 ext3 defaults 0 0
/dev/sda6 /d02 ext3 defaults 0 0
/dev/sda7 /d03 ext3 defaults 0 0
/dev/sdb /d04 ext3 defaults 0 0
/dev/sdc1 /d05 ext3 defaults 0 0
/dev/hda /media/cdrom auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
*****************************************************************
where /d05 is the drive mounted on the client..

etc/fstab in the client
***********************
root@test ]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
LABEL=/stage1 /stage ext3 defaults 1 2
none /sys sysfs defaults 0 0
LABEL=SW-cciss/c0d0p3 swap swap defaults 0 0
/dev/sda5 /d01 ext3 defaults 0 0
/dev/sda6 /d02 ext3 defaults 0 0
/dev/sda7 /d03 ext3 defaults 0 0
oracle:/d05 /d08 nfs defaults 0 0oracle:/d02 /oracle nfs defaults 0 0

/dev/hdb /media/cdrecorder auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0

*********************************************************************
where /d08 is the drive am mouting in the client machine..

Please help

Yusuf

james.farrow 11-26-2007 02:52 AM

The 1st place I would look is /var/log/messages and see what is being reported.

yusufs 11-26-2007 03:35 AM

Quote:

Originally Posted by james.farrow (Post 2970862)
The 1st place I would look is /var/log/messages and see what is being reported.


Hai james,

I coul'd nt find any informative messages there ,, if u can please let me know..

file follows :


[root@alioracle oracle]# cat /var/log/messages
Nov 25 04:02:07 alioracle syslogd 1.4.1: restart.
Nov 25 04:02:07 alioracle kernel: audit(1195952527.972:10): avc: denied { write } for pid=3947 comm="syslogd" name="logs" dev=cciss/c0d0p1 ino=848644 scontext=user_u:system_r:syslogd_t tcontext=user_u:object_r:root_t tclass=dir
Nov 25 04:02:07 alioracle kernel: audit(1195952527.972:11): avc: denied { write } for pid=3947 comm="syslogd" name="logs" dev=cciss/c0d0p1 ino=848644 scontext=user_u:system_r:syslogd_t tcontext=user_u:object_r:root_t tclass=dir
Nov 25 08:50:31 alioracle sshd(pam_unix)[15446]: session opened for user oraprod by (uid=0)
Nov 25 09:31:13 alioracle remote(pam_unix)[19273]: session opened for user support by (uid=0)
Nov 25 09:31:13 alioracle -- support[19273]: LOGIN ON pts/3 BY support FROM 10.0.60.105
Nov 25 09:31:21 alioracle su(pam_unix)[19310]: session opened for user root by support(uid=500)
Nov 25 10:25:26 alioracle remote(pam_unix)[19273]: session closed for user support
Nov 25 10:25:26 alioracle su(pam_unix)[19310]: session closed for user root
Nov 25 15:53:12 alioracle sshd(pam_unix)[15446]: session closed for user oraprod
Nov 26 08:54:04 alioracle sshd(pam_unix)[17291]: session opened for user oraprod by (uid=0)
Nov 26 10:00:05 alioracle sshd(pam_unix)[23585]: session opened for user root by root(uid=0)
[root@alioracle oracle]#

james.farrow 11-26-2007 04:31 AM

Usually when you mount a exported nfs directory on the client machine, the nfs server will have a system message saying mount authenticated from client.example.com: or something similar.
On the sever, I would create a mount point and type showmount -e nfsserver.example.com ( or whatever it is) and see if you can mount the nfs export on the nfs server 1st, and check messages for authentication. Then try the same from the client and check messages on both machines.
mount -t nfs server.example.com:/nfsexport /mnt/nfs

Give the above a go.

jschiwal 11-26-2007 04:57 AM

What are the properties of the directory you are sharing?

zoranp 11-26-2007 05:19 AM

Do not forget that local user root is user nobody on mounted nfs filesystem.

If you feel that you need to be root on nfs mounted filesystem try "no_squash_root" in /etc/exports.

yusufs 11-26-2007 05:38 AM

Quote:

Originally Posted by james.farrow (Post 2970960)
Usually when you mount a exported nfs directory on the client machine, the nfs server will have a system message saying mount authenticated from client.example.com: or something similar.
On the sever, I would create a mount point and type showmount -e nfsserver.example.com ( or whatever it is) and see if you can mount the nfs export on the nfs server 1st, and check messages for authentication. Then try the same from the client and check messages on both machines.
mount -t nfs server.example.com:/nfsexport /mnt/nfs

Give the above a go.

Thanks James,

but the same error ,

I unmounted it and mounted again :

when I mount the file like :

[root@alioracle ~]# mount -t nfs oracle:/d05 /d08
[root@alioracle ~]#

it does'nt give any message. it went silent..


server
*******
[root@oracle ~]# showmount -e
Export list for oracle.ali.com.kw:
/d05 alioracle.ali.com.kw
/d02 alioracle.ali.com.kw
/d03 alioracle.ali.com.kw


[root@oracle ~]# exportfs -rvexportfs: /etc/exports [2]: No 'sync' or 'async' option specified for export "alioracle.ali.com.kw:/d03".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: /etc/exports [3]: No 'sync' or 'async' option specified for export "alioracle.ali.com.kw:/d02".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: /etc/exports [4]: No 'sync' or 'async' option specified for export "alioracle.ali.com.kw:/d05".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exporting alioracle.ali.com.kw:/d05
exporting alioracle.ali.com.kw:/d02
exporting alioracle.ali.com.kw:/d03


i tried restarting NFS at both the nodes. but still,

Please guide
Yusuf


All times are GMT -5. The time now is 04:34 PM.