[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Failed to preserve ownership" exit(1) bug in mv?

From: Jim Minter
Subject: "Failed to preserve ownership" exit(1) bug in mv?
Date: Fri, 2 Jun 2017 17:07:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0


A behaviour that surprised me with mv, moving files to an NFS-mounted filesystem with all_squash set (in a Vagrant box running Fedora 25, coreutils 8.25).

(/vagrant is NFS-mounted as described in the example below).

==== 8< ====
[vagrant@default ~]$ sudo -i
[root@default ~]# ln -s thing symlink
[root@default /]# mv symlink /vagrant
mv: failed to preserve ownership for /vagrant/symlink: Operation not permitted
[root@default /]# echo $?
[root@default /]# ls . /vagrant

==== 8< ====

The surprise to me is that mv exits early in this case (after copying the symlink across volumes, before removing the source symlink).

Doing the same operation as root but with a regular file, I get the same warning message, but the move completes as expected, and mv returns exit status 0. I had expected the same behaviour when moving a symlink.

(As non-root, mv works as expected both for a file and for a symlink - object moved, chown syscall fails, no warning message).

The knock-on effect I've seen which is particularly problematic, is that this issue causes mv to fail when moving an entire directory tree as root to an NFS-mounted filesystem, if that directory tree contains a symlink anywhere within it. Can the exit(1) in this case be considered a bug?

Best regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]