Operating System - HP-UX
1748213 Members
3004 Online
108759 Solutions
New Discussion юеВ

not able to change the owner in a NFS directory.

 
ITlearner
Frequent Advisor

not able to change the owner in a NFS directory.

Hi,
We have a netapp mountpoint where we have mounted it on all servers.suddenly the owner of subdirectory of that directory are unable to write on those.when if I login thru root even I dont have permission to change the owner or edit the files in that.
chmod works but chown doenot work.It tells OT OWNER thru root login if I create a dir and list it it tells nobody and nogroup as owner and group.

I unmounted and remounted using the command

mount -F nfs -o rw source (netapp) /mountpoint.
But still it doesnot work.

I also tried giving rw permissions to this server but it patrially works for some dir and not for others.

Need help in this regard.

Thanks in Advance.
ITLearner.
10 REPLIES 10
Marco A.
Esteemed Contributor

Re: not able to change the owner in a NFS directory.

What sintax are you using to chang the ownership.?

Marc0
Just unplug and plug in again ....
ITlearner
Frequent Advisor

Re: not able to change the owner in a NFS directory.

chown root:other dir

chown loginname:group dir.

I tried doing with the owners login and root login but does not changes.

ITLearner
Marco A.
Esteemed Contributor

Re: not able to change the owner in a NFS directory.

Hello,

ok, try this..., with the fs un-exported in the server...

chown user /home/my_files
chmod u=rx,g=rx,o=rx /home/my_files

after that export the FS...

In the client, you need to define the permissions in the mount point you've defined.

After doing that, export the fs in the server and mount the fs in the client..

Let us know your results ..

Rgds,

Marc0
Just unplug and plug in again ....
ITlearner
Frequent Advisor

Re: not able to change the owner in a NFS directory.

what is the /home/my_files
is this the mountpoint dir you refer or anything else???
All my servers act as both nfs servr and client.

so let me tell as I understand. I have to first unmount and the where should i give the command (chmod,chown).
Regards.
ITLearner.
Marco A.
Esteemed Contributor

Re: not able to change the owner in a NFS directory.

You need to umount the units, and un-export the file systems ... after that, try to change the permissions, and mount and export the file systems.

Marc0
Just unplug and plug in again ....
ITlearner
Frequent Advisor

Re: not able to change the owner in a NFS directory.

Hi Marc,

Sorry I am unable to understand your statement.You have told that
"You need to umount the units, and un-export the file systems ... after that, try to change the permissions, and mount and export the file systems"

my netapp dir is "testmount" and I mount in in a dir as same "testmount" in each and evey server.So if i unmount the testmount where will i change the permission since the files and dir inside will be blank??

ITLearner
Marco A.
Esteemed Contributor

Re: not able to change the owner in a NFS directory.

You can change a file's permissions with the chmod command or the chmod() system call. You can change a file's permissions only if you are the file's owner. The one exception to this rule is the superuser: if you are logged in as superuser, you can change the permissions of any file.

1- Any file that is not mounted using NFS, that is.

See Chapter 20 for details at the following book. :
http://www.unix.org.ua/orelly/networking/puis/ch20_01.htm

For that reason I insist that you need to take down the filesystem, and apply the right permissions, and then re-mount the filesystem.

Hope this helps,

Marc0


Just unplug and plug in again ....
Peter Nikitka
Honored Contributor

Re: not able to change the owner in a NFS directory.

Hi,

when accessing a file over NFS, root is NOT a superuser-account any more, usually.
Only when configured in the exports file, a remote root from explicitly configured hostnames regains its superuser power.
Look at the man page of 'exports'.
This entry at host h1
cat /etc/exports
/data -rw=allgroup,root=thathost

and that mount on host thathost
mkdir /mountpoint
mount h1:/data

will lead to superuser capabilities at thathost under /mountpoint - but all other hosts of the netgroup 'allgroup' won't have them.

Something like
chown owner /data/myfile
on host h1 (i.e. on a lcal file) will not be influenced by any NFS settings.

I think, the one thing Marco tries to explain is: having something already NFS mounted, nothing changes when the corresponding /etc/exports is modified - you'll have to remount that filesystem.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
ITlearner
Frequent Advisor

Re: not able to change the owner in a NFS directory.

HI,

I got it .But the bad thing is i resolved the problem thru windows CIFS.i gave full permission to a user and then thru that login I changed the ownerhip od the dir's .

Anyway thanks for the reply .It was very useful for me to learn many things.

Thanks.
ITLearner.