Given:

# mv /mnt/hard/git-src/ /usr/portage/distfiles/

mv: inter-device move failed: /mnt/hard/git-src/' to /usr/portage/distfiles/git-src'; unable to remove target: Is a directory

And

cd /tmp; mkdir a b; mdkir a/c b/c;

touch a/c/1 b/c/1

mv a/c b/ mv: cannot move a/c' tob/c': File exists

rm a/c/1 b/c/1

mv a/c b/

So moving a dir to a dir with same name, when they contain similar files, is 'File exists'. What's the point of tagging it 'inter-device move' when using different partitions?

link|improve this question

77% accept rate
feedback

1 Answer

up vote 2 down vote accepted

mv on the same filesystem means moving a single directory entry from one directory to another. mv accross filesystems means copying the whole source tree and removing source files after they have been copied. The algorithm and code are different in the two cases, as are many of the failure modes, so mv makes it clear in its error message when it does a cross-filesystem move.

(Here, on the same filesystem, it is a rename systm call that returns an error. For a cross-filesystem move, it's an mkdir call, as part of the recreation of the directory tree.)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.