How Data's Location Is Found in a HDD

Solution
I'm no expert, so please correct me if I'm wrong. This is my understanding of how things work.


For Windows it's this: there's a section of the disk where information is stored on where files are and some other pieces of information. It's called the MFT, the Master File Table. Microsoft is still quite hush hush about how it actually works for some reason. In the end Windows reads the MFT to find out where a file resides and then gives the HDD specific instructions to go the location of that file.

You probably know that a file isn't gone when you delete it, instead the disk space where the file resides is opened up to overwriting. This is done by removing all references to that file from the MFT. At that point the file doesn't exist...

Vexillarius

Reputable
Aug 23, 2014
1,434
0
5,960
I'm no expert, so please correct me if I'm wrong. This is my understanding of how things work.


For Windows it's this: there's a section of the disk where information is stored on where files are and some other pieces of information. It's called the MFT, the Master File Table. Microsoft is still quite hush hush about how it actually works for some reason. In the end Windows reads the MFT to find out where a file resides and then gives the HDD specific instructions to go the location of that file.

You probably know that a file isn't gone when you delete it, instead the disk space where the file resides is opened up to overwriting. This is done by removing all references to that file from the MFT. At that point the file doesn't exist anymore to the OS.
 
Solution

Paperdoc

Polypheme
Ambassador
I understood the old FAT32 file system. In that, for every file there were two primary information trackers. The file name is in the Directory for that sub-directory, along with a whole bunch of info about it like file size, date, type, etc. One thing it has is the number of the cluster of disk Sectors that contains the FIRST data of the file. (A disk may have its data stored in individual Sectors, of it may be arranged as groups of Sectors called Clusters or Allocation Units.) That number also is the first entry in a chain of entries in s key second table called the FAT (File Allocation Table). Each entry there points to the NEXT Cluster that is part of this file. The entry in the FAT that contains the LAST Cluster of the file has a special code in it to label it as the last. So, the Directory entry points to the first Cluster, and the FAT entries keep on pointing to the Next cluster until the Last one is identified.

The HDD has one Root Directory with a limited number of entries possible, and the FAT for the entire HDD, also with a limited number of entries. The key "trick", though, is the system of sub-directories. A sub-directory is treated as just another special file type, and it does NOT have a limit on the number of entries it can hold. And of course, it can contain references to more sub-directories under it. The effect is that an almost unlimited number of files can be stored in nested sub-directories. In modern Windows, those sub-directories are now called Folders. The sub-directories, or Folders, being just a special type of file, can be located anywhere on the disk. But they all use that one common FAT at the beginning of the disk to track the use of Sectors or Clusters of Sectors.

OP, note that, in your post, you list a "name" for the hypothetical file that is really the complete list of nested sub-directories, from root entry to the actual place the file is located, and THEN the actual file name at the end. That is how the OS can find the right sub-sub-sub-directory, and then search there for that file name. If you do not tell it all that detail, the system will only look inside the current sub-directory it is already in. If you don't know where the file is, you can use a Search tool to look through a whole bunch of sub-directoies to find it, and that takes a lot of time.

The link provided by photonboy provides details of the newer NTFS File System that replaced FAT systems. NTFS uses many more files that those first two types to track much more information than the FAT system ever did. It is faster and less likely to encounter errors. It's 'way more complicated than I can understand. But maybe the simpler FAT system I described can help OP understand the basics of how files are found and used.