[Top][All Lists]

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

curious behavior in cp --- is it a bug?

From: Paul E Condon
Subject: curious behavior in cp --- is it a bug?
Date: Sat, 17 Jan 2009 20:52:31 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

This is an directory ownership issue.

On a host which I've named 'gq', I am copying a file structure the is
rooted a /db2/chkpnt. All the files under /db2/ (and /db2 itself) have
ownership root:root

I copy the whole structure to an external HD that is mounted at on
another computer, hostname 'big'. On big the HD is mounted at

The connection from gq to big is via sshfs. /media on big is mounted
at /var/mnts/big/media on gq. All directories and mount points along this
path have ownership root:root.

On WDP-5, there are three levels of directories. I am putting the copy
of /db2/chkpnt into /media/WDP-5/mystuff/chkpnt/

The command that I use to do this is:

cp -au --backup=none /db2/chkpnt /var/mnts/big/media/WD-5/mystuff/

This copies the whole chkpnt file structure into mystuff, but I get
error messages. One of them is, e.g.;

cp: failed to preserve ownership for \
/var/mnts/big/media/WDP-5/mystuff/chkpnt/gq/etc/resolv.conf: \
No such file or directory

Why error messages? I find that ownership of several directories are
not root:root, namely:

/media is pec:pec
/media/WDP-5 is pec:root, and
/media/WDP-5/mystuff is pec:pec .

I'm user pec on both hosts. When I chown these three directories to
root:root, the error messages stop, so I call this curious behavior,
as I'm not stopped from progress until it's fixed.  But is this
reasonable behavior? Why is cp noticing and commenting on ownership of
objects that it is not copying? It should not, in fact, have attempted
to change ownership of any of these three directories. And it didn't
attempt it.  I know because it was running as root, and certainly
could have done chown.

Nothing about the actual wording of the message indicates that it 
succeeded in doing its job, anyway.

By the way, the contents of /db2/chkpnt were generated by several
invocations of cp -au ... that put backup copies of /etc /home , etc.
into chkpnt. I like the numbered backup feature. Good Show!

Paul E Condon           

reply via email to

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