Cannot delete a folder on a network drive in Windows 7 after using Cygwin

I am using Windows 7 and Cygwin is installed on it. Using Cygwin, I recently tried to write a new file using Vim in a network drive. When trying to save it, Vim complained that the file was read-only ( ls -la showed that the files on this drive have very few permissions, which seems strange since the permissions are very different if I try to use the same with Git Bash )

I forced Vim to write the file anyway, but after exiting the file it wasn’t in Windows Explorer or in any Unix shell. Then I tried to rename the folder where the files are stored ( Includes β†’ IncludesOld ), creating a new folder with the original name and moving all the files to a new folder. This left the original folder ( IncludesOld ) empty, but I could not delete it. If I try to delete it, an error message will not appear, but the folder still remains.

I assume that this is because Cygwin maintains its own idea of ​​the file system, which is incompatible with the one that I see, but I'm not sure what to do with it.

Running mount produces the following result:

 C:/cygwin64/bin on /usr/bin type ntfs (binary,auto) C:/cygwin64/lib on /usr/lib type ntfs (binary,auto) C:/cygwin64 on / type ntfs (binary,auto) B: on /cygdrive/b type udf (binary,noacl,posix=0,user,noumount,auto) C: on /cygdrive/c type ntfs (binary,noacl,posix=0,user,noumount,auto) D: on /cygdrive/d type ntfs (binary,noacl,posix=0,user,noumount,auto) E: on /cygdrive/e type ntfs (binary,noacl,posix=0,user,noumount,auto) O: on /cygdrive/o type ntfs (binary,noacl,posix=0,user,noumount,auto) S: on /cygdrive/s type ntfs (binary,noacl,posix=0,user,noumount,auto) T: on /cygdrive/t type ntfs (binary,noacl,posix=0,user,noumount,auto) U: on /cygdrive/u type ntfs (binary,noacl,posix=0,user,noumount,auto) W: on /cygdrive/w type ntfs (binary,noacl,posix=0,user,noumount,auto) X: on /cygdrive/x type ntfs (binary,noacl,posix=0,user,noumount,auto) 

This folder is on the W: drive, but running umount /cygdrive/w gives me umount: /cygdrive/w: Invalid argument , and I just assume that this is what I should do anyway.

+5
source share
3 answers

AFAIK, folders can be easily deleted with rm -rf <folder name> . If the problem occurs, you can try sudo chown <username:group> <folder name> and run rm -rf . If the problem persists, add to the question what lsattr <folder name> returns.

0
source

I assume that you tried to remove IncludesOld using both cygwin and windows native methods. Since you mentioned that the directory is in the network holder, I would go to the computer on which this folder is located and try to delete from there directly using the native OS method that is running on this computer. If this does not work, I would check the disk size for file system errors.

0
source

I posted this question for almost two years, so I'm going from memory here, but I believe that I managed to fix it by right-clicking the ( includesOld ) folder in Windows Explorer and going to the Security tab, I vaguely remember something that I do not have all access rights and security settings to give me complete control. After that, I was able to remove it.

0
source

Source: https://habr.com/ru/post/1207647/


All Articles