The contents of this blog are not old now as I have not updates it since long. The mobile trick wont work now.

How is the structure of a hard disk ?

Posted on Thursday, April 8, 2010 by Ajit

On this page, I’ll cover file structure on a hard drive. Tracks, sectors, cylinders, etc. Plus I’ll cover what happens when you format and partition a drive.

Basically, tracks, sectors, and cylinders are the divisions of the hard drive platters where information is stored. A track is a concentric ring around the platter containing information. Since a hard drive typically has two or more platters, each storing data on both sides, these tracks line up on each platter. The identically positioned tracks on each platter are called cylinders. To better help you understand a track and cylinder, let’s take a target used for target practice. You have a bunch of concentric circles, each bigger than the other, all sharing the same center, which is the bulleye. Now, each of the spaces between circles is similar to a track on a hard disk platter. Now, if you stack several of these targets on top of each other, each exactly the same, you can form a cylinder by simply taking a track and moving it down through all of the same tracks on the targets below.



Since typical hard drives are too large to deal with by the track, each track is divided into sectors. Its not that a track could not be dealt with, but since a track can hold as much as 50K sometimes, this would not be practical for storing large files. So, sectors are basically slices of the track. Different drives have different numbers of sectors per track.

Each sector is given an identity during low-level formatting to aid the controller in finding what it needs in the appropriate sector. These sector numbers are written to the beginning and the end of each sector, called the prefix portion and the suffix portion respectively. These identities take actual space on the hard drive. This explains why there is a difference between the capacity of an unformatted disk and a formatted one. On a floppy, the disk itself can hold 2M or so of data. When formatted and the identities placed, the capacity reduces to 1.44M. The same holds true for a hard drive. Drive manufacturers know this and publish formatted capacities to indicate drive size.

There are two types of disk formatting: low-level and high-level. These both are done in the preparation of a hard drive for use. First, one low-level formats, then partitions, then high-level formats. A low-level format turns the platter from a blank slate to a divided slate. It defines the data areas: creates tracks, separates into sectors, and writes the ID numbers to each sector. Low-level formatting typically has to be done using a specific utility released by the manufacturer of the drive. Almost all drives sold are already low-level formatted at the time of sale. In most cases, you do not need to ever do it again.

Partitioning segments the drive into separate areas, each capable of running its own operating system. At this point, the hard drive needs to be high-level formatted. High level formatting is the type of formatting most people think of when thinking of formatting. During high-level formatting, the file allocation tables (FATs) are dropped in. This is a “table of contents” for the drive, allowing the drive to later find files on the drive whereever they sit on the platter. The drive cannot be used until it is high-level formatted. This can be performed with the DOS FORMAT command, through Windows (if the drive is not master), or through a third party utility.

There are four types of file systems.


  • FAT16. The is the file system used by DOS, Win95 and Win98, unless you convert. It supports an eight letter file name max, with a three letter extension under DOS. With Windows it supports up to 255 characters. With this system, a partition can be no larger than 2G.

  • FAT32. The 32 means 32-bit. This is an optional file system introduced with Windows 95 OSR-2. The file allocation units are stored as 32-bit numbers. The main advantage is that it allows for partitions of up to 2048G with smaller clusters. There is an option to convert FAT16 to FAT32 under Windows 98, and Windows NT5 will support it as an option.

  • High Performance File System (HPFS). An unpopular file system only used with OS/2 or early versions of NT. File names can be 256 characters and partitions can be 8G.

  • Windows NT File System (NTFS). Just like the HPFS, but only for NT.

The FAT file system (specifically FAT32) is most used in PC’s today. The main problem with the original FAT16 was the inefficient use of disk space when defining clusters, or groups of sectors. The clusters were rather large, causing wasted space because a small file would still take up the entire cluster even though that cluster could hold more. With FAT32, 4 billion clusters are allowed, ultimately allowing 4K clusters. This significantly reduces disk waste. The concept of FAT explains why one can run out of disk space even when you are not storing the disk’s full capacity in files. For example, a 1G hard drive can run out of space with 160MB to spare. This is due simply to the FAT structure. With the original FAT, each cluster could hold 32K. But, if you are storing an 8K file, it still takes up a complete cluster, leaving the other 24K to waste. This wasted space is called slack. The only way around this is to re-partition the hard drive to two or more partitions. As the partition gets smaller the wasted space gets less. This, then is a tradeoff. The convenience of one partition, or the wasted disk space. With FAT32, the wasted space is much less because of the smaller clusters.

No matter what file system is used, a boot sector is written to the beginning of each disk in the first sector. This sector contains the boot program which tells the system what to do when you first turn it on. This is called the boot sector.

That completes the basic view of how files are stored on a hard drive.