Chown: changing ownership of `.’: Invalid argument

chownpermissions

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)

Best Answer

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.

Related Topic