When operating system wants to access the file, it reads the information in file system first and then locates the corresponding content on the disk. The entry is stored in file system, and it includes information like file name, path, size, type, time created and modified, etc. When a file is written to a hard drive, its file entry and content are stored on separated parts of the disk, which works similar to a book. First, let's see how files are stored on hard drive and what happens when you format a hard drive. It depends on how you format the hard drive.