> Date: Mon, 31 Mar 2003 14:17:08 +0100 > From: Tim Waugh <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: directory mounted with --bind causes cp -R to fail > Message-ID: <[EMAIL PROTECTED]> > > Original bug report at: > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=86302 > > Under Linux it is possible to have a special 'bind' mount type, which > has the effect of remounting part of the file hierarchy somewhere > else. But this confuses 'cp --preserve=links': > > Run these commands as root: > mkdir -p src/{x,y} > mount --bind src/x src/y > cp --archive --one-file-system src dst > > Is this a cp bug, or expected behaviour? > > Tim.
Hi Tim, Thanks for forwarding that. Could it be that there's a problem with the way `mount --bind' works? With linux-2.4.19, I see that the two directories created above have the same dev/inode numbers. That doesn't seem right. I would have expected the device numbers to be different. This shows they have the same device numbers (using your example): # cd src; stat --format='%d %n' [xy] 773 x 773 y But are they really both on the same `device'? If so, I should be able to make a hard link from a file in one to the other: # touch x/foo # ln x/foo y/bar ln: creating hard link `y/bar' to `x/foo': Invalid cross-device link [Exit 1] Whoops. We can't do that. And the failure suggests that they really are on separate devices. So what's the deal? I suspect that this is all due to a deeper problem. BTW, the fact that rsync succeeds merely shows that rsync doesn't complain about hard-linked directories. `cp -a' could do the same thing, but then we wouldn't have discovered this inconsistency :-) _______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-coreutils
