3

I only found 1 or 2 other posting on this, without any solution, so I am creating a new, more specific question for my case.

System set up: NFS server running NFSv4. NFS client running RedHat 6, idmapd running with the following in /etc/idmapd.conf:

    [General]
    Verbosity = 7
    Domain = localdomain

    [Mapping]
    Nobody-User = nobody
    Nobody-Group = nobody

    Method = nsswitch

The issue is chown/chgrp for certain users fail with 'Invalid argument' error, as follows, even though the user exists on local host:

# chown oracle m
chown: changing ownership of `m': Invalid argument
# grep oracle /etc/passwd
oracle:x:54321:54321::/home/oracle:/bin/bash

# chown mysql m
# grep mysql /etc/passwd
mysql:x:496:496:MySQL server:/var/lib/mysql:/bin/bash

Why does idmapd not recognize certain users but it works with others (root, nobody, and even mysql, which is non-standard, are OK)?

Any specific setting I am missing above? I thought when Domain is set to localdomain then everything should just work using local passwd/group files, etc. (And yes, nsswitch.conf lists passwd and group as files)?

Thanks in advance!

1 Answer 1

1

I just wanted to close the loop on this one. I found the answer. The issue here is when rpcidmapd is on, NFSv4 uses it to do mapping but this means NFS sends username@domainname vs UID/GID to the server.

When the server does not understand this username@domainname (maybe because the server is not set up with the same directory or some other reasons), it does not allow chown/chmod.

Apparently this default behavior is INCORRECT. In later Linux kernel, this was fixed by the NFS maintainer in the kernel so that default for NFSv4 is to NOT use idmapping. See the commit here: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=074b1d12fe2500d7d453902f9266e6674b30d84c

To fix this yourself, you can do this (RHEL specific):

echo "options nfs nfs4_disable_idmapping=1" >> /etc/modprobe.d/nfs.conf

Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .