Maximum number of folders or directories in HD root or top?


  1. Posts : 28
    Win10 Pro 64Bit
       #1

    Maximum number of folders or directories in HD root or top?


    Windows 10 v22H2 (OS Build 19045.3448)

    Ok, this might be a "old" question but I'm not sure I've found a modern answer for Windows 10 (& above).

    I have a number of hard drives that contain a lot of video files from TV recordings, etc. For some reason, that may no longer apply, I've always thought (correctly or not) that there was limit to the number of folders or directories that can be created in the root folder or directory of a HD, even if NTFS is used.

    For example, I have 1 folder in the root, which then contains dozens or even hundreds of folders (and sub-folders):

    "E:"
    "E:\TV Shows01"
    "E:\TV Shows01\Show#1"
    "E:\TV Shows01\Show#2"
    and so on and so forth.

    Does this hard disk root folder/directory limit still exist?

    TIA...
      My Computer


  2. Posts : 28
    Win10 Pro 64Bit
    Thread Starter
       #2

    Thanks.

    So there is a limit ... although bigger than I thought.

    As HD's get bigger it's easy to end up with lots & lots of folders.

    On one 2TB drive I have 54 folders under "X:\TVShowsXX". This drive is full.

    Meanwhile, on a 8TB drive I have 555 folders under "X:\TVShowsXX" & there's 1.11TB free.

    Finally, on a 16TB drive I have 184 folders under "X:\TVShowsXX", with 12TB free.

    It might be wise to leave things as they are.

    PS. The above does not include sub-folders.
      My Computer


  3. Posts : 839
    Windows 7
       #3

    NTFS allows up to 4,294,967,295 (2^32 - 1) folders or files per volume. If you were to put all your files under the root folder, then 4 billion files would be the theoretical limit.

    But in reality, the number of folders or files can't exceed the total number of available volume clusters, defined by the cluster size when the volume was created. The larger the cluster size, then fewer clusters are created.

    Can you put millions of files in a single folder? Yes. But Windows will be crawling slower and slower way before you reach that point. If you know a specific folder or file's pathname, NTFS has an efficient way of looking up the item. But if you need to search for all the files under a folder (using Explorer or the DIR command), that becomes a time consuming process once you reach into a thousand files.

    It's not your disk speed that matters, but the processing overhead of collecting the items that slows Windows down.

    I wouldn't worry about creating as few folders as you're doing. The best way to organize content is by depth (multiple layers of folders) instead of breadth (keeping every folders in a single level).
      My Computer


  4. Posts : 757
    Windows 10/11
       #4

    @Pluginz I think it would be a good idea to delete your earlier post that suggests there is a limit of 255. Otherwise, future visitors may get the wrong idea.
      My Computer


  5. Posts : 6,470
    Windows 11 Pro - Windows 7 HP - Lubuntu
       #5

    BazzaG said:
    Thanks.

    So there is a limit ... although bigger than I thought.

    As HD's get bigger it's easy to end up with lots & lots of folders.

    On one 2TB drive I have 54 folders under "X:\TVShowsXX". This drive is full.

    Meanwhile, on a 8TB drive I have 555 folders under "X:\TVShowsXX" & there's 1.11TB free.

    Finally, on a 16TB drive I have 184 folders under "X:\TVShowsXX", with 12TB free.

    It might be wise to leave things as they are.

    PS. The above does not include sub-folders.
    I never heard about the 255 folders within each other limit.
    What I know is that there is a limit for the path length (260 characters). There is also a way to enable long paths.
    How to enable NTFS long paths in Windows
      My Computers


  6. Posts : 679
    Windows 10
       #6

    My bad and sorry i dont mean to push the wrong information to anyone. I'll delete the whole lot. It makes me feel better too
    Cant be right all the time and you never stop learning
      My Computer


  7. Posts : 1,201
    11 Home
       #7

    On NTFS, a directory is a file whose data contains a collection of name/file mappings, and, a directory entry in the MFT (Master File Table) contains the name of the file and a file reference, the latter being a (file number, sequence number) pair that identifies the file on the same volume that contains the MFT in question. The list of files that are located in the directory is stored as a B+ tree data structure in what's called an index. As with regular files, if the directory is small enough, it can fit entirely within the MFT entry. Only if the directory is larger, the top part of (the B+ tree of) the directory is in the MFT entry, which points to extents that contain the rest of the name/file mappings. So, due to the fact that a directory does not necessarily always use any extents, plus the fact that an MFT entry does not necessarily always take up a whole cluster, the maximum number of directories is not necessarily always limited by the number of clusters that the NTFS volume has. Rather, this factually depends.
      My Computers


  8. Posts : 1,201
    11 Home
       #8

    As for the relationship between search delay and royal pain... here is a solution:
    voidtools
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 21:52.
Find Us




Windows 10 Forums