7

Situation:

  • I am using Bash with Linux subsystem for Windows(10); I am logged in as root.
  • All folders and files in my current directory have rwxrwxrwx, and the same is true for descendant files and folders.
  • There is no system file in my current directory nor in the descendants.
  • None of folders is synchronized with git.

Problem:

  • I cannot change the name of one particular directory. However I can do this for every single other directory or file - whether in the current directory, or inside the un-mv-able directory in question.

I can copy a whole directory to another one and then freely change its name, or I can copy its contents to the folder with the desired name, and those solutions are acceptable, but using just mv would be easier. For the sake of knowledge - as a bash and Linux beginner - I really would like to understand the problem.


Additional info as requested
root@MARVIN:/mnt/h/testing# mv test1.pl otherName
mv: cannot move ‘test1.pl’ to ‘otherName’: Permission denied
root@MARVIN:/mnt/h/testing# lsattr test1.pl
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/css
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/fonts
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/index.html
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/index2.html
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/index3.html
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/index4.html
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/index5.html
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/js
lsattr: Inappropriate ioctl for device While reading flags on test1.pl/notes.txt

Given various operations I was doing on partition directory resides on, I guess it is not read-only, but for the record:

root@MARVIN:/mnt/h/testing# mount
rootfs on / type rootfs (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=204320k,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
none on /run/shm type tmpfs (rw,nosuid,nodev,relatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755)


Solution

The directory was in fact blocked by Atom editor (installed on Windows not WSL).

Details

enter image description here

The directory in question is directory A.

  • If one of files Aa, Ab, Ac is opened in the editor, I can mv Dir A.
  • If one of files AAa ... ABc is opened I get Permission denied.
  • If contents of Dir A are visible it Atom project browser, I can mv it.
  • If contents of Dir AA or Dir AB are visible in Atom p. b., I get Permission denied.
bart5
  • 73
  • 1
  • 1
  • 5
  • 2
    do `lsattr ` please and share the output – 13dimitar Mar 21 '17 at 13:19
  • 2
    Does your unmovable files is residing in any readonly partition? – Thushi Mar 21 '17 at 14:23
  • 1
    Perhaps it would help if you could post the output of `pwd` and both the `mv` command you are trying and its output. – dhag Mar 21 '17 at 14:37
  • Question was updated with all requested info. – bart5 Mar 21 '17 at 15:28
  • 1
    Does `otherName` already exist (including all variations, capitalized or not)? Have `test1.pl` or `H:\testing` recently been modified by an ordinary (non-WSL) Windows program? – Mark Plotnick Mar 21 '17 at 19:00
  • `otherName` does not exist; sibling-directories to the directory in question could have their names changed to `otherName` without a problem. About the modification - AFAIK: no. I may add that `test1.pl` is directory for the virtual host of Apache, but still, as well are neighbouring directories that could be `mv`-ed freely. – bart5 Mar 21 '17 at 20:03
  • I have inadvertently killed experimental subject. To verify if directory is attached to some Windows service I copied it and tried to remove it - sadly not with Windows "delete" but `rm -r`. Much to my surprise directory vanished without a single objection. I then renamed the copy of directory to the original name `test1.pl` and now I obviously can `mv` it, but further troubleshooting may be difficult. I will report if the problem will come back after next reboot. – bart5 Mar 21 '17 at 20:16
  • If this happens again, try renaming it in windows explorer - it might give a more precise error message. – Mark Plotnick Mar 22 '17 at 11:51
  • @Mark Plotnick I updated my question. I guess your suggestion that Windows program modifies this directory was correct, but - at least for me - it was happening in a hard to notice way. – bart5 Mar 22 '17 at 11:54
  • More details: https://github.com/Microsoft/WSL/issues/3738 https://github.com/microsoft/WSL/issues/1529 – mPrinC Nov 13 '19 at 20:32

1 Answers1

12

I think that a service or a program of windows is perhaps using or accessing the same file , i used to have the same problem when i first installed the linux subsystem on windows 10.

Kingofkech
  • 998
  • 2
  • 10
  • 24