NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
webpex
Jul 18, 2013Aspirant
cp -p failed to preserve ownership invalid argument
I have two CentOS servers which mount a ReadyNAS 2120 for backup purposes. One was an existing database server, the other is new. The existing database server can mount and copy files with the 'cp -p...
JohnnyB11
Jul 20, 2013Aspirant
webpex wrote: Any ideas on why the older one works and new one doesn't? Or how to fix this? Been pulling my hair out over this.
Maybe. But first:
1. Your server running CentOS release 5.9 mounts /NAS_BACKUP with type nfs.
2. Your server running CentOS release 6.4 mounts /NAS_BACKUP type nfs but uses the mount option vers=4.
So, what NFS version do you really want to use? The version used is important because NFSv4 needs a different fsetxattr call. The second parameter must be "system.nfs4_acl" instead of "system.posix_acl_access". The latter is used by your "cp -p" as shown in the strace output above. So what might happen is: Your server running CentOS release 6.4 respects the mount option and uses NFSv4 for the "connection". However, your server itself thinks it is NFSv3 since mount says so. Thus, the wrong fsetxattr call is used by "cp -p". Your server running CentOS release 5.9 uses NFSv3 for the "connection", too, and there the fsetxattr with parameter "system.posix_acl_access" works fine.
And, even if your server running CentOS release 5.9 used NFSv4, you would not see the error. This is because there was a bug in coreutils <6.12 such that "cp -p" silently ignored the EOPNOTSUPP error code of fsetxattr and thereby removed the ACL, see https://bugzilla.redhat.com/show_bug.cgi?id=454072
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!