Solved

problem in UID's in mounting a partition using NFS

Posted on 2013-01-07
16
569 Views
Last Modified: 2013-01-24
Hello All,

I have one nfs share need to mount on a client with same uid and user - is it possible ..because on client there is already a user with same UID with diff name.
0
Comment
Question by:apunkabollywood
  • 8
  • 7
16 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38750501
Yes, that's possible, because names are irrelevant here.

You should be aware that the share's files/dirs will appear on the client machine as being owned by the user as named on that client, but will still appear on the server as being owned by the user as named on the server.

Running an "ls -ln [...]" against the share will exhibit the files/dirs as being owned by the same UID on both sides, however.
0
 

Author Comment

by:apunkabollywood
ID: 38750615
Okay let me explain:

DIR A is in Server and owned by UserA:Sysgroup   (UID 2001)

When mounted on Client

DIR owned by nobody:sysgroup

Note: On client there is no UserA but yes UserB is there with same UID 2001

Hope it helps u to understande and pls advice how to reoslve it- as i dont want to touch USERB but need same UID to show as its a need of application
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38750626
This is implausible.

If there is a user B on the client with UID 2001 then DIR owned by UID 2001 on the server will show up as owned by user B and not by "nobody" on the client.

Please recheck: What do you see with "ls -ln DIR" on server and client?

Which NFS versions (3/4) are in use?
0
 

Author Comment

by:apunkabollywood
ID: 38750740
On Client

nfs-utils-1.2.3-15.el6.x86_64

ln -ln dir gives

99:200
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38750776
So DIR is owned by UID 99 and not by UID 2001.

Is UID 99 also available on both sides?

And with NFS version I meant to ask for the protocol version, not the software version.

By the way, a possible scenario where an exported share can show up as being owned by "nobody" is when the share has been exported using the option "all_squash".
0
 

Author Comment

by:apunkabollywood
ID: 38750820
yes but on server its owned by 2001 only  and it shared as (rw,sync) only now i want 2001 on client also ...99 is nobody and available on both but we need 2001 UID to be the owner on clinet
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38750841
>> shared as (rw,sync) only  <<

Do you see the above with "mount" on the client or by examining /etc/exports on the server?

"all_squash" along with several other options does not show up with "mount".

Could it be that your users are defined via NIS?

In this case you must add to or change in  /etc/idmapd.conf on the client:

[Translation]
Method = nsswitch

(NFS V4 only)
0
 

Author Comment

by:apunkabollywood
ID: 38750864
Yes on server /etc/exports - Folder shared as (rw,sync)only

No users are not defined as NIS and no change also done for any particular user in NFS also.

Still you want me to make changes in /etc/idmapd.conf ...and what service need to be restart or change after that?

Client File below(Its RHEL 6.2):

[Mapping]

Nobody-User = nobody
Nobody-Group = nobody

[Translation]

# Translation Method is an comma-separated, ordered list of
# translation methods that can be used.  Distributed methods
# include "nsswitch", "umich_ldap", and "static".  Each method
# is a dynamically loadable plugin library.
# New methods may be defined and inserted in the list.
# The default is "nsswitch".
Method = nsswitch

# Optional.  This is a comma-separated, ordered list of
# translation methods to be used for translating GSS
# authenticated names to ids.
# If this option is omitted, the same methods as those
# specified in "Method" are used.
#GSS-Methods = <alternate method list for translating GSS names>
 
#-------------------------------------------------------------------#
# The following are used only for the "static" Translation Method.
#-------------------------------------------------------------------#
#[Static]

# A "static" list of GSS-Authenticated names to
# local user name mappings
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38750878
idmapd.conf looks OK so far.

What's in its "[General]" section under  "Domain="? Should be your local domain name.

Restart rpc.idmapd on client (and server, who knows?) after making changes.

Is this daemon running at all?
0
 

Author Comment

by:apunkabollywood
ID: 38753713
# The default is the host's DNS domain name.
#Domain = local.domain.edu

restarting rpcidmapd will it effect other services?
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38753768
No, not as far as I know. But I think you should umount the share (if possible), then restart idmapd, then mount the share again.
0
 

Author Comment

by:apunkabollywood
ID: 38785530
sorry for delay in response hard luck still same problem :(
0
 

Author Comment

by:apunkabollywood
ID: 38795484
I have tried same u adviced ... On server restart service rpcidmapd
than on client umount the point than restart rpcidmapd service than again mount but still same proble nobody is picking
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 38798917
In fact I suggested changing /etc/idmapd.conf and restarting idmapd  on the client!

The change I meant to suggest was removing the comment (#) sign in front of "Domain" and adding the actual name of the client's local domain in the client's /etc/idmapd.conf, like (just examples!)

Domain = my.domain.com

or

Domain = apunkabollywood.com

Umount the share before restarting idmapd on client and server, mount it again afterwards.
0
 
LVL 19

Expert Comment

by:simon3270
ID: 38799061
If you don't want to touch UserB, you could change the UID of UserA on the server, and create a UserA with the same new UID on the client.
0
 

Author Closing Comment

by:apunkabollywood
ID: 38815195
Many Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now