How the Operating System Finds Data on a Disk

How the Operating System Finds Data on a Disk


A computer's operating system can locate data on a disk because each track and each sector are labeled, and the location of all data is kept in a special log on the disk. The labeling of tracks and sectors is called logical formatting, Different operating systems can format disks in different ways. Each formatting method configures the disk's surface in a different manner, resulting in a different file system--a logical method for managing the storage of data on a disk's surface. A commonly used logical format performed by Windows is called the FAT file system because it relies on a standardized file allocation table (FAT) to keep track of file locations on the disk.

When a diskette is formatted with the FAT file system, four areas are created on the disk.

  • The boot sector contains a program that runs when you first start the computer. This program determines whether the disk has the basic components that are necessary to run the operating system successfully. If the program determines that the required files are present and the disk has a valid format, it transfers control to one of the operating system programs that continue the process of starting up. This process is called booting because the boot program makes the computer "pull itself up by its own bootstraps." The boot sector also contains a form that describes other disk characteristics, such as the number of bytes per sector and the number of sectors per track-information that the operating system needs to access data on the disk.
  • The file allocation table (FAT) is a log that records the location of each file and the status of each sector. When you write a file to a disk, the operating system checks the FAT to find an open area, stores the file and then logs the file's identity and its location in the FAT. When a program needs to locate data on the disk, the operating system checks the FAT to see where that data is stored. During formatting, two copies of the FAT are created; both copies are always maintained to keep their information current.
  • The root folder is the "master folder" on any disk. A folder (also called a directory) is a tool for organizing files on a disk. Folders can contain files Or other folders, so it is possible to set up a hierarchical system of folders on your computer, just as you can have folders within other folders in a file cabinet. The topmost folder is known as the root, but may also be called the root folder or root directory, This is the folder that holds all the information about all the other folders on the disk. When you use the operating system to view the contents of a folder, the operating system lists specific information about each file in the folder, such as the file's name, its size, the time and date that it was created or last modified; and so on.
  • The data area is the part of the disk that remains free after the boot sector, the FAT, and the root folder have been created. This is where data and program files are actually stored on the disk.

During logical formatting, the operating system also groups sectors together, into storage units called clusters. A cluster, therefore, is simply a group of sectors that the OS sees as a single unit. A cluster is the smallest space allocated to a single file, and a cluster may store an entire file or just part of a file. Cluster sizes vary, depending on the size and type of the disk, but they can range from four sectors for diskettes to 64 sectors for some hard disks. Cluster usage is tracked in the file allocation table. selected these files.

Different operating systems use different file systems:

  1. File Allocation Table (FAT). This file system, which is also known as FAT16, was used in MS-DOS and was the basis for the early Windows operating systems. In fact, all versions of Windows support FAT, although it is no longer the preferred file system; newer file systems offer better security and greater flexibility in managing files.
  2. FAT32. Introduced in Windows 95, FAT32 is an extended edition of the original FAT file system, providing better performance than FAT. It continues to be supported in Windows 2000 and Windows XP.
  3.  New Technology File System (NTFS). Introduced with Windows NT and the basis for later operating systems, NTFS was a leap forward from FAT, offering better security and overall performance. NTFS also Windows to use long file names (file r. umes longer than eight characters) for the first time. NTFS 5. This updated version of NTFS is used in Windows 2000 and XP

  4. High-Pr File System (HPFS). This was designed for use with IBM's OS/2.

Other operating systems (such as UNIX), and even some network operating systems (such as Novell NetWare), use their own file systems. Although each file system has different features and capabilities, they all perform the same basic tasks and enable a computer's disks and operating system to store and manage data efficiently.