Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to install some new files on our new server while our sysadmin is in holidays:

Here is my df

#  df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb3             273G   11G  248G   5% /
tmpfs                  48G  260K   48G   1% /dev/shm
/dev/sdb1             485M  187M  273M  41% /boot
xxx.xx.xxx.xxx:/commun
                       63T  2.2T   61T   4% /commun

as root , I can create a new directory and run chown under /home/lindenb

# cd /home/lindenb/
# mkdir X
# chown lindenb X

but I cannot run the same command under /commun

# cd /commun/data/users/lindenb/
# mkdir X
# chown lindenb X
chown: changing ownership of `X': Invalid argument

why ? how can I fix this ?

updated:

mount:

/dev/sdb3 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sdb1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
xxx.xx.xxx.xxx:/commun on /commun type nfs (rw,noatime,noac,hard,intr,vers=4,addr=xxx.xx.xxx.xxx,clientaddr=xxx.xx.xxx.xxx)

version:

$ cat /etc/redhat-release 
CentOS release 6.3 (Final)
share|improve this question
1  
Type mount and paste the output of this in your question. Also, what OS are you on? –  jwbensley Oct 31 '12 at 9:54
    
thanks. I've updated by question. –  Pierre Oct 31 '12 at 9:59
1  
I'm not very knowledgeable on NFS; But seeing as /commun/data/users/lindenb/ is not a local directory on your machine, but a network share accessed via NFS, I would start by examining your permissions on the NFS server (which is out of my knowledge scope) –  jwbensley Oct 31 '12 at 10:02
add comment

3 Answers

up vote 5 down vote accepted

The /commun file system is mounted from a remote server, and the error message suggests that is could be an nfsv4 mount (the same for earlier nfs versions is Permission denied). By default the remote file server will map remote root user to a nobody account so it cannot change the file ownership.

The easiest solution may be to use the local lindenb account to create the directories under the /commun directory. So as root

sudo -u linedb mkdir -p /commun/data/users/lindenb

If that doesn't work then there may be some id mapping taking place so you may have to mkae the directories on the server xxx.xx.xxx.xxx and change the ownership/permissions there.

share|improve this answer
    
thanks but that didn't work sudo -u lindenb mkdir -p /commun/data/users/TMP mkdir: cannot create directory /commun/data/users/TMP': Permission denied` –  Pierre Oct 31 '12 at 10:17
    
Your point about NFSv4 is a red herring but I'd agree with the rest of the answer as correct. –  DaveG Oct 31 '12 at 10:17
    
thanks for your answer anyway, I'm not skilled enough to make those changes alone. I'll wait for the end of the holidays of our sysadmin and I'll validate your answer if it was correct :-) –  Pierre Oct 31 '12 at 10:22
    
@DaveG: why is that ? If I try and chown a directory as root on an NFSv4 mount I get exactly the same error message as the OP and if I switch to NFSv3 I get Permission Denied so it's something to do with it and the way it interacts with user ids. –  Iain Oct 31 '12 at 10:25
2  
Because root gets squashed on NFSv3 as well therefore the error message might be different but he'd still be unable to create the directory as the root user. –  DaveG Oct 31 '12 at 10:28
show 2 more comments

This is indeed a NFS4 issue. You may have to consider rpc.idmapd the NFS4 mapping daemon in order to resolve such issues especially if lots of users will need the correct mapping between the client and the NFS server. Note that NFS3 (in CentOS < 6 for example) did not use a mapping daemon.

share|improve this answer
add comment
mount -t nfs -o vers=3 SERVER:PATH MOUNT_PATH

This worked for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.