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.
10
  • 2
    do lsattr <directory> please and share the output Commented Mar 21, 2017 at 13:19
  • 2
    Does your unmovable files is residing in any readonly partition? Commented Mar 21, 2017 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. Commented Mar 21, 2017 at 14:37
  • Question was updated with all requested info. Commented Mar 21, 2017 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? Commented Mar 21, 2017 at 19:00

1 Answer 1

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.

1
  • In my case, I just closed VSCode and it worked. Commented Dec 7, 2020 at 16:27

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.