Sarasota PC Monitor
Tech Talk (03/04)
Whys & Wherefores of Partitioning Hard Drives (Part 1)
by Brian K. Lewis, Ph.D.*
Member of the Sarasota Personal Computer Users Group, Inc.From a simplistic perspective, partitioning is simply dividing your hard drive into usable segments. However, since many of you have only one hard drive with a single partition, the question frequently arises as to why do I need a partition? In order to fully understand partitions, we need to consider the structure of the hard disk and the effects of formatting. That also means some explanation of the terminology used in talking about all of these structures and functions. (Sounds like I'm getting ready to give an anatomy and physiology lecture.)
![]()
To start with, we need to look at how a hard disk is structured. Basically they are discs stacked on top of each other with read/write heads floating over each surface. Data is stored on both sides of each disk. As you can see in figure 1, the disks are divided into tracks and the tracks are subdivided into sectors. Today's hard drives contain 38,000 tracks per inch or more. This contributes to the high capacity of the very small 2.5 inch and 3.5 inch drives. Tracks are further divided into sectors to improve the data storage efficiency. A track can hold 100,000 bytes or more which would be very inefficient for storing small files. So the standard sector is designed to hold 512 bytes of data plus an additional 59 bytes used by the sector header and trailer. Unfortunately, the data capacity of today's drives and the number of sectors further complicate data storage. As a result, the cluster is the basic unit for management of data. Each cluster is a specified number of sectors. Technically, the name cluster was replaced by the term "allocation unit", but hardly anyone uses the newer term. So I'll stick to cluster. The file system being used and the size of the hard disk determine the number of bytes in a cluster. In general, a cluster will consist of 4 to 64 sectors depending on the file system in use. And, the file system is generally determined by which operating system will control the partition.
O.K., so we are starting to make some progress in understanding the disk layout. There is another term that needs to be clarified: cylinders. As you can see in figure 2, a cylinder is composed of a set of tracks from each disk in the drive. So a single disk with two read/write heads and 160 tracks would have 80 cylinders. All of this will become more pertinent as we delve further into the functions of low-level formatting, partitioning and high-level formatting.
All hard drives are low-level formatted at the factory before being shipped out for sale. This process divides the tracks into a specific number of sectors. It also creates intersector and intertrack gaps. The sector header and trailer information is written to the disk. The program then fills each sector's data area with a dummy byte value or a pattern of test values. This allows the program to check the read/write ability of the drive. From this information a bad block table is written to the drive. If the same number of sectors were written to each track of a hard drive they would vary in physical size. The sectors closest to the hub would be smaller than those on the outside track. This would limit the drive capacity to the density of the shortest track. Consequently, most modern drives use zoned-bit recording. This allows each sector to be the same size as shown in figure 3. It also means that more sectors will be present on the outermost track than on the inner tracks. This method greatly increases the storage capacity of the drive.
The next step in the preparation of the drive is partitioning. This is done as part of the installation of the operating system (OS). If the computer is to have more than one operating system installed, then there must be multiple partitions. However, if we are only going to install one OS, then the drive must still have at least one partition. When you use Microsoft's Fdisk software to partition a drive, it sets up a (1) master boot record (MBR); (2) a partition table; (3) and a volume boot record or sector. Since this is a single drive, single partition system, the bootcode will also be written to the drive. In this instance this would be referred to as the primary, or active partition since it contains the boot information.
The MBR is written to cylinder 0, head 0, sector 1 of the hard drive. The MBR contains both the primary partition table and the code that is loaded to a standardized address in RAM by the ROM BIOS. It is the ROM BIOS that initiates the boot process from the hard drive. The partition table is written to the same sector as the MBR. Each table is 16 bytes long, which allows a maximum of four partitions to be defined. However, if any of the three additional partitions are defined as an extended partition, it can be further subdivided in logical partitions. The extended partition can not be assigned a drive letter. It functions only as a container for the logical partitions. Each logical partition can then be assigned a drive letter. The extended partition can contain an "unlimited" number of logical partitions. However, remember that only the primary partition can be designated "active" and be a bootable partition. This is outlined in the following table:
Partn Type Function
Primary Bootable, contains boot code and partition table.
Extended Container for logical, non-bootable partitions.
Logical Non-bootable partition for applications or data.
Let's take a look at the partition table. The first field in the table is the boot indicator. The code indicates whether or not this is the system partition. If it is, then after checking the partition table, the code jumps to the boot sector to load the OS. The partition table contains the code for the starting read/write head, the starting sector and the starting cylinder. The next field has a system ID that defines the volume type. This identifies the file system that is being used; FAT16 (primary or logical), extended partition, FAT32 primary, NTFS primary or extended partition. The final fields in the partition table identify the end of the partition and the total sectors. Only after this information has been written to the drive can a high-level format be performed. Fdisk also allocates space for the File allocation table (FAT) or tables. (FAT32 uses a backup table.)
If you partition your hard drive with a third-party disk manager, such the OnTrack Disk Manager, then the MBR and the partition table will not be written to cylinder 0, head 0, sector 1. Instead, it will contain code that jumps to the disk manager software located elsewhere on the disk. Under these circumstances, if you want to repartition the drive with Fdisk, you must first restore the MBR to the standard location. Third-party software such as Symantec's Partition Magic will work with drives partitioned by disk managers such as OnTrack.
Once the drive is partitioned, then it must be formatted and the OS installed. The primary partition is also referred to as the System partition and it contains the boot files installed by the partitioning software. This is code that simply allows a jump to the location of the system files in a region referred to as the boot partition. These are the OS files and are the ones loaded into RAM to operate the computer. It is these files that load the Windows logo and all the drivers, graphics files, explorer, systray, etc.
This discussion primarily relates to Windows 98/ME and XP using the FAT32 file system. There are differences when you use NTFS under Windows NT, 2000 or XP. Next month I'll continue with the function of the high level format provided by Windows format command. I'll also see if I can shed some light on the NTFS partition system.
*Dr. Lewis is a former university & medical school professor. He has been working with personal computers for more than thirty years. He can be reached via e-mail at bwsail@yahoo.com. :
Copyright 2004. This article is from the March 2004 issue of the Sarasota PC Monitor, the official monthly publication of the Sarasota Personal Computer Users Group, Inc., P.O. Box 15889, Sarasota, FL 34277-1889. Permission to reprint is granted only to other non-profit computer user groups, provided proper credit is given to the author and our publication. We would appreciate receiving a copy of the publication the reprint appears in, please send to above address, Attn: Editor. For further information about our group, email: admin@spcug.org/ Web: http://www.spcug.org/The Sarasota Personal Computer Users Group, Inc. has 1,100+ members and was established in 1982. We are members of the Assoc. of PC User Groups (APCUG), the Florida Assoc. of PC Users Groups, Inc., and we are members of the America Online Ambassador Program.
See http://www.spcug.org for all reviews from the Sarasota PC Monitor, go to the Newsletter Section.