Partitions and File Systems

November 1 (Day); October 24 (Night)

  • Hard Drive Partitions:
  • It is too difficult to store data on the basis of those cylinders, heads, and sectors that we talked about during the last lecture (p. 203).
  • A partition is a chunk of a hard drive used to structure and organize data on a hard drive (p. 203).
  • The concept of partitions was originally developed to allow multiple operating systems, each with different file systems, to co-exist on a single hard drive.
  • Today, partitions are used to divide a single drive into multiple volumes used by the same operating system.
  • A computer learns about its partitions during booting. The boot sector is a specific place on the hard drive that stores all partition information. It consists of the following information (p. 204):
  • The Master Boot Record (MBR) which is a small program that assists the operating system in finding the correct partition.
  • The partition table contains entries for up to four partitions. It contains information such as the beginning and ending sector on the hard drive and how many sectors are used by the partition.
  • Types of Partitions:
  • There are two types of partitions: primary and extended.
  • The primary partition is the more common type (p. 204).
  • The primary partition is bootable.
  • The operating system is installed on the primary partition.
  • Windows assigns the drive letter C: to the primary partition.
  • Generally, there can only be one primary partition.
  • Extended partitions are optional (p. 204).
  • An extended partition is not bootable.
  • Extended partitions can not be assigned drive letters directly.
  • Extended partitions are divided into logical drives. Logical drives are assigned drive letters.
  • An extended partition can be broken into 23 logical drives (D: - Z:). Each appearing as separate drive letter to the operating system.
  • Partitioning:
  • Partitioning is the process of creating partitions. You must have a partition on the hard drive before you install an operating system (p. 216).
  • FDISK is the manual partitioning program used the most often. FDISK is a small command-line based program that can be found on most Windows boot disk (p. 216).
  • File Systems:
  • A file system defines the name of the files and keeps track of which sector stores which file. It also allows you to create folders so that you can organize your files. In short, the file system helps you organize your data (p. 205).
  • Clusters:
  • Rather than storing information about each sector on a hard drive, the file system stores information about groups of sectors known as clusters.

Cluster Size = # of Sectors * 512 bytes OR

Cluster Size = # of Sectors * .5 KB

  • The smallest space that one file can occupy is one cluster. For example, if a file is even one bit larger than the size of one cluster, the file will take up two clusters.
  • Types of File Systems:
  • The File Allocation Table system uses two tables to store information about clusters: FAT Directory, FAT Table.
  • The FAT Directory stores information about each file.
  • The FAT Table stores information about each cluster on the disk.
  • FAT16 uses 16 bits to store the address of each cluster (p. 205).
  • It can address a maximum of 65,536 (216) clusters.
  • Supports partitions of up to 2 GB.
  • Used by DOS and Windows 3.1.

FAT16 Directory (Source: Upgrading and Repairing PCs – Eleventh Edition)

Filename / Starting Cluster / Size
file1.txt / 1000 / 4
file2.txt / 1007 / 3

FAT16 Table

Cluster # /

Value

/ Meaning
00001 / First Available Cluster
…… /

……

/ ……
01000 / 1001 / In use, points to next cluster
01001 / 1002 / In use, points to next cluster
01002 / 1003 / In use, point to next cluster
01003 / EOF / End of File
01004 / 0 / Cluster available
01005 / 0 / Cluster available
01006 / 0 / Cluster available
01007 / 1008 / In use, points to next cluster
01008 / 1009 / In use, points to next cluster
01009 / EOF / End of File
…… /

……

/ ……
65536 / Last Available Cluster
  • FAT32 uses 32 bits to store the address of each cluster (p. 205).
  • It can address a maximum of 4,294,967,296 (232) clusters.
  • Supports partitions of up to 32 GB.
  • Used by Windows 95, Windows 98, and Windows ME.
  • NTFS is the newest file system (p. 205).
  • NTFS is a very secure file system with a lot of advanced features.
  • Supports partitions of up to 2 TB.
  • Used by Windows NT, Windows 2000, and Windows XP.
  • If we can make our hard drives larger by increasing the number of entries in the FAT table, why is there not a FAT64 or a FAT128?
  • Remember that the FAT table is loaded into memory at bootup. If we dedicated 128 bytes, for instance, to each cluster on our hard drive, the FAT table will become very large and overuse our memory.
  • If we are limited in the number of clusters that we can use in our FAT table, how might we increase the capacity of our hard drive?
  • We increase the size of clusters, so that more data is stored for each entry in the FAT table.
  • Cluster Waste:
  • Wasted space is the problem of increasing the size of your clusters. To demonstrate this point, pretend that you have a file that is 10 KB in size.
  • If you have a cluster size of 32 KB, then you will waste 22 KB of space to store this file.
  • If you have a cluster size of 16 KB, then you will waste only 6 KB of space to store this file.
  • Because some files waste a little bit of a cluster and some files waste a lot of a cluster, each file is assumed to waste one-half of a cluster.
  • Here’s the calculation:

Cluster Waste = # of Files * (Size of cluster * .5)

  • Pretend that you have 5000 files on your hard drive and are using cluster sizes of 16 KB.

Cluster Waste = 5000 * (16 KB * .5)

= 5000 * (8 KB)

= 40,000 KB

  • Pretend that you have 5000 files on your hard drive and are using cluster sizes of 32 KB.

Cluster Waste = 5000 * (32 KB * .5)

= 5000 * (16 KB)

= 80,000 KB