Computing Staff
  • 1

Duplicate Folder Names (Different Case) – NTFS

  • 1

Hello!

I have a weird situation and not quite sure how to resolve. I have a folder, on Drive D: (NTFS). Inside that folder are two folders with the exact same name.

I didn’t think this was possible considering that NTFS was a case-preserving, but case-insensitive file-system yet here I am.

Proof (since I know none of you will believe me):

Screenshot from Windows Explorer:
https://i.imgur.com/da3u1KV.png

Screenshot from an Administrative command prompt with dir /A output:
https://i.imgur.com/gbZwlVX.png

Same as above but with the “/W” wide-format switch so you can see Windows isn’t showing any additional characters either in-front or at the end of the directory names:
https://i.imgur.com/8fBly0M.png

And last, screen shots from the Explorer “Properties” view for both of the folders. They’re the exact same size. They’re duplicates!

“Data” folder Properties:
https://i.imgur.com/eQVhP2F.png

“data” folder Properties:
https://i.imgur.com/CDuhCAS.png

So my question is:
How can I delete one of those folders? 🙂

How all this started was I was trying to back up the parent folder with 7-Zip and 7-Zip kept on failing on me:
https://i.imgur.com/Leh8Dlm.png

Share

1 Answer

  1. I believe this may be related to the Linux Subsystem for Windows.

    From: https://blogs.msdn.microsoft.com/ws…

    Linux abstracts file systems operations through the Virtual File System (VFS), which provides both an interface for user mode programs to interact with the file system (through system calls such as open, read, chmod, stat, etc.) and an interface that file systems have to implement. This allows multiple file systems to coexist, providing the same operations and semantics, with VFS giving a single namespace view of all these file systems to the user.

    VFS implements the various system calls for file system operations by using a number of data structures such as inodes, directory entries and files, and related callbacks that file systems must implement.

    Unlike Linux, Windows file systems are by default case preserving, but not case sensitive. In actuality, Windows and NTFS do support case sensitivity, but this behavior is not enabled by default.

    As discussed above, Linux diverges from Windows in several ways for file systems. VolFs must provide support for several Linux features that are not directly supported by Windows.

    Case sensitivity is handled by Windows itself. As mentioned earlier, Windows and NTFS actually support case sensitive operations, so VolFs simply requests the Object Manager to treat paths as case sensitive regardless of the global registry key controlling this behavior.

    I do remember working in these directories under bash via the Linux Subsystem for Windows.


    I’ve found a solution.

    Using 7-Zip I can create a 7z archive of the “Data” folder. Call it “Data-1.7z”.

    And another archive of just the “data” folder. Call it “Data-2.7z”.

    Then I can safely delete both “data” folders (they are identical as I proved above).

    Then I can safely extract both archives and Windows should create them as one folder.

    • 0