Binding a directory with mount onto another forces mv to copy/delete under every circumstances

Asked by Freebirth One

Binary package hint: util-linux

Following circumstances:

I am binding a directory with "mount -o bind directory newdirectory", which both reside on the same partiton with ext3 as fs.

When I want to move a file from a directory which is on the same partition like both of the above into newdirectory, it does a full copy/delete.

I expected only the inode-Entry (?) to change instead of moving the whole data for moving the file, because the old location as well as the new location of it are both on the same partition.

I suppose the bind option of mount is messing with this but am not really sure.

Is this a bug or does it lie it within the design of ext3 and mount?

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: mount 2.17.2-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-22.37~ppa1~loms~lucid-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
Architecture: i386
Date: Mon Jun 28 00:31:36 2010
InstallationMedia: Xubuntu 9.10 "Karmic Koala" - Release i386 (20091028.3)
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: util-linux

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
Freebirth One
Solved:
Last query:
Last reply:
Revision history for this message
Freebirth One (freebirth-one) said :
#1
Revision history for this message
Charlie Kravetz (cjkgeek) said :
#2

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug report so we are closing it and converting it to a question in the support tracker. We appreciate the difficulties you are facing, but it would make more sense to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. For help on reporting bugs, see https://help.ubuntu.com/community/ReportingBugs .

Revision history for this message
Charlie Kravetz (cjkgeek) said :
#3

To the best of my knowledge, this is expected behavior. If the directories were on different partitions, this would be the expected results. The application is not differentiating on same vs different partitions.

Revision history for this message
Freebirth One (freebirth-one) said :
#4

Thanks for the answer.

I supposed, that after binding a directory into another the system thinks that this new directory points to another partiton, no matter whether it really does so or not. Your answer confirms my thoughts, thanks for that.

So the best thing would be a simple use of symlinks.