Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


# 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


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?

share|improve this question
up vote 5 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.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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