1835679 Members
2610 Online
110082 Solutions
New Discussion

NFS Problem!

 
Mike_21
Frequent Advisor

NFS Problem!

I am having troublen with mounting an NFS filesystem. The client mounts the filesystem fine, and it shows up when I do a bdf, however, when I change to the NFS mounted directory and do an ls I get

#ls
. not found

Could the permissions be a problem?
Any tips to troubleshoot this?

Thanks
6 REPLIES 6
Satish Y
Trusted Contributor

Re: NFS Problem!

U try to open a file for ex. with vi editor and if u are able to do it it is definitely due to permission problem, try to give atleast "rx" permission or if possible(acceptable) u should give root permission to exported directories.

Cheers...
Satish.
Difference between good and the best is only a little effort
Kamlesh Shete
Advisor

Re: NFS Problem!

You are probably trying to list the contents of the directory as root. The problem is with permissions in the /etc/exports file on the NFS server:

On the NFS server, edit the /etc/exports file and for the entry of the filesystem, add this:

root=clientmachinename

then run the command exportfs -a and this should work

- KS
W.C. Epperson
Trusted Contributor

Re: NFS Problem!

Of course, when deciding whether to export the filesystem with root access, you need to understand that by doing so you effectively give root on the server to anyone with root on a client (if they can execute a command on the server in any fashion). One simple exploit is to put a copy of /usr/bin/ksh in the NFS mount, then chown it to root and chmod it to setuid. Instant root on the exporting system.
"I have great faith in fools; self-confidence, my friends call it." --Poe
Victor_5
Trusted Contributor

Re: NFS Problem!

If you can not list the contents, that means you did not get the read permission, it is seems that it is a permission problem. Two files you need check:

1. on NFS server
/etc/exports
check what is the permission for exported files or directories:ro, rw, or root, see man exports for details.

2. mount options
when you mount a file system by using mount command, the default permission is rw, however, you can change it when you need, so check your mount options

Another point I would like to mention is the mount point, if the mount point is not empty, after you mount a file system on this mount point, you can not see the previous contents of the same mount point, so try to use an empty mount point when you mount a file system from NFS server.

Sachin Patel
Honored Contributor

Re: NFS Problem!

Hi Mike,
Sure it is permission problem.
test: allow permission to everyone.
vi /etc/exports and add only filesystem
/myfiles
#exportfs -va
If it is not working with permissions check your patch.
I had a problem that when I add netgroup in exports file the client can't see the files on that directorys. Installed PHNE_22125 patch and it works now.

Sachin



Is photography a hobby or another way to spend $
Jim Hendrick
Advisor

Re: NFS Problem!

Hi,
One thing that I have run across that I do not see mentioned here is the permissions for the *underlying* mount point.

I have seen problems with (for example, on the client):

ls -ald /mountpoint
dr-xr-x--- 2 root sys /mountpoint

mount server:/filesystem /mountpoint

ls -ald /mountpoint
drwxrwxr-x root sys /mountpoint

and yet have permission problems (similar to what you describe) occur within the filesystem mounted on /mountpoint...

Hope this helps.

Jim H.