View previous topic :: View next topic |
Author |
Message |
Iced-Tux Apprentice
Joined: 14 Apr 2004 Posts: 183 Location: Germany, Cologne
|
Posted: Fri Jan 19, 2007 5:18 pm Post subject: Problem with NFS server |
|
|
Hi all,
i have a litte problem.
I am trying to export my mp3 collection on my external USB-HDD which is mounted by IVMAN.
Code: |
drwxrwx--- 8 ivman plugdev 16K 1. Jan 1970 usbext/ |
My export looks like this:
Code: | cat /etc/exports
# /etc/exports: NFS file systems being exported. See exports(5).
/media/usbext/Media 192.168.2.0/24(async,ro,no_subtree_check) |
My problem is this:
I can mount the share BUT as the gid/ui for plugdev/ivman on my NFS-server are not the same as on my NFS-client Code: | gid_server_plugdev != gid_client_plugdev and uid_server_ivman != uid_client_ivman | I can not access my files.
So my question is:
Are there any options to
* tell my NFS-server to export with different gid/uid
OR
* to mount on my client with different gid/uid.
Thx
iced-tux _________________ !! The road to hell is full of good intentions !! |
|
Back to top |
|
|
chrbecke Guru
Joined: 12 Jul 2004 Posts: 598 Location: Berlin - Germany
|
Posted: Fri Jan 19, 2007 5:46 pm Post subject: |
|
|
Have a look at man exports:
you have to specify the UID/GID of your user/group on the client system as anonuid and anongid parameters and the all_squash parameter in the servers /etc/exports.
HTH |
|
Back to top |
|
|
Iced-Tux Apprentice
Joined: 14 Apr 2004 Posts: 183 Location: Germany, Cologne
|
Posted: Fri Jan 19, 2007 6:19 pm Post subject: |
|
|
First of all, thx for your reply:
I tried to add the suggested opions:
Code: |
cat /etc/exports
# /etc/exports: NFS file systems being exported. See exports(5).
/media/usbext/Media 192.168.2.0/24(async,ro,no_subtree_check,all_squash,anonuid=1000,anongid=1000) |
Nonetheless on the client gets the uid_ivman_server/gid_plugdev_ivman.
Any other suggestions? _________________ !! The road to hell is full of good intentions !! |
|
Back to top |
|
|
chrbecke Guru
Joined: 12 Jul 2004 Posts: 598 Location: Berlin - Germany
|
Posted: Fri Jan 19, 2007 6:27 pm Post subject: |
|
|
What's the output of on the server? |
|
Back to top |
|
|
Iced-Tux Apprentice
Joined: 14 Apr 2004 Posts: 183 Location: Germany, Cologne
|
Posted: Fri Jan 19, 2007 6:32 pm Post subject: |
|
|
Code: | exportfs -v
/media/usbext/Media
192.168.2.0/24(ro,async,wdelay,root_squash,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
|
_________________ !! The road to hell is full of good intentions !! |
|
Back to top |
|
|
chrbecke Guru
Joined: 12 Jul 2004 Posts: 598 Location: Berlin - Germany
|
Posted: Fri Jan 19, 2007 8:08 pm Post subject: |
|
|
That looks allright.
Setting anonuid and anongid in /etc/exports will not change the ownership of existing files/dirs on the share (it's not like the uid/gid mount option for vfat or ntfs - it just makes any remote access to files on the share appear to come from a user with uid/gid set to the values you specified with the anonuid/anongid options). But if you create new files/dirs on the share from the client, they will be owned by uid:gid you set in /etc/exports on the server. If you want the existing files to be owned by this uid:gid, you have to run Code: | chown -R uid_on_client:gid_on_client /media/usbext/Media | on the server.
The exports manpage mentions a tool called rpc.ugidd which should do dynamic uid/gid mapping, which is probably what you want - but I couldn't find neither an ebuild nor sources for it on the web...
If you want the same uid/gid for your users all your systems, you could change uids/gids (if you've only got a few systems) or set up a NIS or LDAP server to manage user accounts (if you've got a larger network).
To change uids/gids, have a look at usermod and find, e.g.
find out the uid of user foo and gid of group foo:
(say foo's uid is aaa and foo's gid is bbb)
change uid/gid of user/group foo to new uid xxx and new gid yyy:
Code: | groupmod -g yyy foo
usermod -u xxx foo |
find all files owned by uid aaa (foo's old uid) and change to the new uid:
Code: | find / -uid aaa -exec chown xxx {} ';' |
Same for group foo:
Code: | find / -gid bbb -exec chgrp yyy {} ';' |
HTH. |
|
Back to top |
|
|
Iced-Tux Apprentice
Joined: 14 Apr 2004 Posts: 183 Location: Germany, Cologne
|
Posted: Sat Jan 20, 2007 8:07 am Post subject: |
|
|
The problem is:
My USB-HDD is mounted by IVMAN. I COULD change the way ivman mounts the share, e.g. to my uid/gid. BUT other services also need to access these files, namely ftp, shoutcast and mpd, and I don't want to have these user/groups have access to anything else I own. _________________ !! The road to hell is full of good intentions !! |
|
Back to top |
|
|
|