[clug] NFSv4 "Invalid argument"

Bob Edwards Robert.Edwards at anu.edu.au
Mon Oct 13 16:40:54 MDT 2014


On 13/10/14 20:57, George at Clug wrote:
>      HI,
>
> I am unable to understand how NFS works with user permissions.  Does
> anyone have experience with NFS shares in Debian Wheezy and could
> explain to me how to manage user permissions for an NFS share ? Maybe
> it is not even needed?
>
> I searched the Internet but did not find anything useful, I did find
> mentions of libnss-mysql and nfs4_disable_idmapping but I could not
> find any detail on how this related to Debian.
>
> # umount 192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1/kvm-images/images
>
> # mount -t nfs  -v
> 192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1/kvm-images/images
> /var/lib/libvirt/images
> mount.nfs: timeout set for Mon Oct 13 20:42:13 2014
> mount.nfs: trying text-based options
> 'vers=4,addr=192.168.0.12,clientaddr=192.168.0.137'
>
> # chown root:root
> /var/lib/libvirt/images/ISO/debian-7.5.0-amd64-DVD-1.iso
> chown: changing ownership of
> `/var/lib/libvirt/images/ISO/debian-7.5.0-amd64-DVD-1.iso': Invalid
> argument
>
> # ls -al /var/lib/libvirt/images/ISO
> total 11143136
> drwxr-sr-x 2 nobody nogroup       4096 Oct 11 08:50 .
> drwx--s--x 3 nobody nogroup       4096 Oct 11 09:45 ..
> -rw-r--r-- 1 nobody nogroup 3938795520 Oct 11 08:49
> debian-7.5.0-amd64-DVD-1.iso
>

Hi George,

Would really need to see your /etc/exports file on the server (as
Scott pointed out).

Standard behaviour of NFS is to treat files owned by root on the
server as if they belonged to "nobody" when mounted over NFS. This
_can_ be over-ridden by exporting with "no-root-squash" in the
/etc/exports file, but you need to be really careful about what
you are exporting in this case...

Why do you want to chown the files to root on the client anyway?

If you were to chown them on the server to some other user other
than root (and the client and server both agree on uid to username
mapping in some way), then they will appear as that user on the
client. This may be closer to what you actually want.

Cheers,

Bob Edwards.

> I also tried the following;
> # umount 192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1/kvm-images/images
>
> # mount -t nfs -o
> auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800  -v
> 192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1/kvm-images/images
> /var/lib/libvirt/images
> mount.nfs: trying text-based options
> 'nolock,bg,nfsvers=3,intr,tcp,actimeo=1800,addr=192.168.0.12'
> mount.nfs: prog 100003, trying vers=3, prot=6
> mount.nfs: trying 192.168.0.12 prog 100003 vers 3 prot TCP port 2049
> mount.nfs: prog 100005, trying vers=3, prot=6
> mount.nfs: trying 192.168.0.12 prog 100005 vers 3 prot TCP port 33224
>
> # chown root:root
> /var/lib/libvirt/images/ISO/debian-7.5.0-amd64-DVD-1.iso chown:
> changing ownership of
> `/var/lib/libvirt/images/ISO/debian-7.5.0-amd64-DVD-1.iso': Operation
> not permitted
>
>
>



More information about the linux mailing list