Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upmv cannot move files between Windows mount and linux file system #37
Comments
Look at it as different environments. |
Well, they most certainly are different environments, no question, but if I can copy from one to the other, edit Windows files from within the Linux environment, create and remove Windows files from within the Linux environment...kinda seems like move should work too, and yet it fails. As a side note I believe the assertion that one would never touch /mnt/c/ is incorrect. The whole point of giving Windows developers Bash was so it could work harmoniously with their Windows environment, not as a completely separate system. |
Yeah, I can confirm for @mphaney's thought process. You can also |
Same happens in /root for say, CPAN....it unzips the files in /root/.cpan, then can't move the directory to a build directory under /root/.cpan - insufficient permissions. Yet looking at ls output, things are fine... |
Just put actions on /root as UAC actions on that mini kernel. |
And I know hundreds to hack a developer, trust me, my job |
Thanks for reporting this issue. We were returning ENOENT instead of EXDEV for the rename syscall. When that is addressed mv will switch to "copy then remove original" behavior. |
mphaney commentedon Apr 7, 2016
Moving a file (with mv) within the Windows file system or within the Linux file system works exactly as it should, but moving between the two file systems yields the error:
mv: cannot move 'filename' to a subdirectory of itself, '/destination/filename'
Here is a complete test scenario:
root@localhost:~# cd /mnt/c/Users/Mark/
root@localhost:/mnt/c/Users/Mark# echo test > testfile
root@localhost:/mnt/c/Users/Mark# mkdir windir
root@localhost:/mnt/c/Users/Mark# mv testfile windir/
root@localhost:/mnt/c/Users/Mark# mv windir/testfile .
root@localhost:/mnt/c/Users/Mark# mv testfile /root/
mv: cannot move ‘testfile’ to a subdirectory of itself, ‘/root/testfile’
root@localhost:/mnt/c/Users/Mark# cp testfile /root/
root@localhost:/mnt/c/Users/Mark# rm testfile
root@localhost:/mnt/c/Users/Mark# cd /root
root@localhost:~# mkdir linuxdir
root@localhost:~# mv testfile linuxdir/
root@localhost:~# mv linuxdir/testfile .
root@localhost:~# mv testfile /mnt/c/Users/Mark/
mv: cannot move ‘testfile’ to a subdirectory of itself, ‘/mnt/c/Users/Mark/testfile’
root@localhost:~# cp testfile /mnt/c/Users/Mark/
root@localhost:~# rm testfile