Organizing Data on Magnetic Disk

Before to store data on the magnetic disk, it is prepare through operating system. Actually the disk’s surface is magnetically mapped. The process of mapping the surface of disk is called formatting or initializing.

During formatting a disk, the disk drive creates a set of magnetic concentric circles, called tracks, on each side of the disk. A floppy disk has 80 tracks on each side of the disk. Similarly, a hard disk may have hundred tracks on each side of each platter. Each track is further divided into pie-shape areas called sectors. The information is stored into sectors. In one sector, 512 bytes are stored. The disk surface may have some bad sectors. When a disk is formatted, the operating system marks the bad sectors as unusable and these are not used to store data.

The number of tracks on the disk and number of sectors per track depend on the density of the disk. Each track and sector is assigned a unique number or address. The data is read or write with reference of sector number. The computer goes directly to the specified sector and reads or writes data. The disk drive reads or writes whole sector at a time.

[ad#200x90]

For reading and writing purposes sectors are grouped into clusters, A cluster is a smallest unit of disk space. Each cluster, also called an allocation unit, consists of two to eight or more sectors. The number of sectors per cluster depends upon the size and type of the disk as well as depends upon the operating system. For example, a cluster consists of four sectors for floppy disk and up to sixty-four sectors for hard disk. Each cluster holds data of only one file, however if the size of file is large than the cluster then that file may be stored in many clusters. Similarly, if the size of file is very small, i.e. 10 bytes, then it uses an entire cluster and other sectors of the cluster remained unused.

The Windows operating system divides the disk into four areas. These are:

  1. Boot Master Record
  2. File Allocation Table (FAT)
  3. Root Folder
  4. Data Area

1. Master Boot Record

It is area of the disk that contains boot record and other information about the disk such as the number of byte per sector and the number of sectors per track of the disk. The boot record is a small program that helps to load the operating system from disk into memory during booting process. The boot record is stored in this area of disk when operating system is transferred on the disk. In case of non-system disk, this area of disk is not used by operating system. The boot record is activated through BIOS when computer is switched on. A boot sector virus is usually attacked on the master boot record.

2. File Allocation Table (FAT)

FAT is a log that contains the record of each file stored on the disk and status of each section. When a file is stored on the disk, the operating system checks the status of disk, stores the data of file in unused data area, writes the file name, its size, its location etc. in the FAT.

When a file is opened and new data is added into it, the operating system checks the FAT for free areas and stores data in it. The data of a single file may be stored in different areas (nonadjacent areas) on the disk. These areas are linked together through pointers. The pointers in the FAT allow accessing all data of the file. This technique to store files on disk is called fragmented files. The fragmented files take longer time to save and to load data.

3. Root Folder

A folder is also called directory. The files are organized into folders on the disk. A folder may contain files or other folders (known as subfolders). The top folder on any disk is known as the root folder. Other folders and subfolders (directory structure) are created under Root Folder. The root folder is created automatically by operating system when disk is formatted. It cannot be deleted

4. Data Area

The part of the disk where actual data of files is stored is the Data Area. The FAT contains the record of this area. The data of files is accessed from this area with the reference of FAT. If the FAT area is corrupted then data stored in Data Area cannot be accessed.