删除一堆符号链接后,文件夹变得无法访问

删除一堆符号链接后,文件夹变得无法访问

我使用命令创建了多个符号链接(指向现有文件)mklink,然后使用 Windows 资源管理器继续删除它们(仅限符号链接本身,目标文件仍然存在)。

符号链接所在的父目录现在变得无法访问,我无法使用 Explorer 在文件夹内导航,无法打开“安全”选项卡,无法删除它。我还以 SYSTEM 用户身份启动了 cmd.exe ( psexec64 -i -h -s cmd.exe) 并尝试takeown访问rmdir目录,但无济于事 ( Access denied)。目录本身不是符号链接,只是一个普通目录。

这是什么诅咒?该如何对抗它?

似乎由于删除符号链接(目录仅包含符号链接,没有其他内容),该目录的文件系统条目已变得无效。

更新:我尝试在不同的目录中重现它:

mkdir C:\SymLinksHere\
cd C:\SymLinksHere\
mklink FileA.txt "D:\Other\FileA.txt"
mklink FileB.txt "D:\Other\FileB.txt"

然后使用 Windows 资源管理器删除文件,目录正常。看起来这是不可重现的。

更新2:

我已经重新启动机器来运行chkdsk C: /F(按照建议DOBRESCU_Mihai),然后,惊喜的是:目录不见了! Chkdsk 日志不包含任何“错误已修复”的指示,但有一些“清理 3020 个未使用的索引条目”:

Checking file system on C:
The type of the file system is NTFS.


A disk check has been scheduled.
Windows will now check the disk.                         

Stage 1: Examining basic file system structure ...
  1085952 file records processed.                                                         
File verification completed.
  19690 large file records processed.                                    
  0 bad file records processed.                                      

Stage 2: Examining file name linkage ...
  1043 reparse records processed.                                       
  1541940 index entries processed.                                                        
Index verification completed.
  0 unindexed files scanned.                                         
  0 unindexed files recovered to lost and found.                     
  1043 reparse records processed.                                       

Stage 3: Examining security descriptors ...
Cleaning up 3020 unused index entries from index $SII of file 0x9.
Cleaning up 3020 unused index entries from index $SDH of file 0x9.
Cleaning up 3020 unused security descriptors.
Security descriptor verification completed.
  227995 data files processed.                                            
CHKDSK is verifying Usn Journal...
  36066240 USN bytes processed.                                                            
Usn Journal verification completed.

Windows has scanned the file system and found no problems.
No further action is required.

 243193677 KB total disk space.
 142111640 KB in 839896 files.
    475496 KB in 227996 indexes.
         0 KB in bad sectors.
   1202953 KB in use by the system.
     65536 KB occupied by the log file.
  99403588 KB available on disk.

      4096 bytes in each allocation unit.
  60798419 total allocation units on disk.
  24850897 allocation units available on disk.

Internal Info:
00 92 10 00 f9 31 10 00 0c 2f 1c 00 00 00 00 00  .....1.../......
1c 02 00 00 f7 01 00 00 00 00 00 00 00 00 00 00  ................

Windows has finished checking your disk.
Please wait while your computer restarts.

尽管它是如何以及为何发生的仍然是个谜,但问题已经解决。

相关内容