Rabu, 26 Januari 2011

Primary, Extended and Logical Partitions

Source : http://www.pcguide.com/ref/hdd/file/structPartitions-c.html

In order to use the space in a hard disk, it must be partitioned. Partitioning is the process of dividing the hard disk's space into chunks, so they can be prepared for use, or even dedicated to different uses. Even if the entire disk is intended to be left in one piece, it must be partitioned so that the operating system knows that it is intended to be left in one piece. There are many different considerations that go into deciding how to partition a hard disk.

The rules that determine how partitions are used were set down very early in the original design of the PC, and have remained virtually unchanged since that time. Recall that when the PC was first invented there was only (really) one type of file system. Still, it was envisioned that in the future, multiple operating systems and/or file systems might be wanted on a single machine. Therefore, provision was made in the partitioning scheme to allow for several different partitions. The rules that govern partition setup are as follows:

  • A maximum of four partitions can be placed on any hard disk. These are sometimes called primary partitions. The limitation of four is one that is imposed on the system by the way that the master boot record is structured.
  • Only one partition may be designated, at any given time, as active. That partition will be used for booting the system. See here for more on active partitions and switching active status between partitions.
  • DOS (and the operating systems that depend on it for booting, which includes all consumer Windows operating systems) will only recognize the active primary partition. Any other primary partitions will be ignored.
  • One of the four partitions may be designated as an extended DOS partition. This partition may then be subdivided into multiple logical partitions. This is the way that two or more logical DOS volumes can be placed on a single hard disk.

Alright, I realize that this is somewhat confusing, so let's take a look at some examples of systems, to show you how this scheme is used:

  • Single Partition Windows PC: Many PCs have all of their disk space made into a single partition, and use one of the FAT file systems. Such a machine would have just a single FAT primary partition on it, and nothing else. The other three "slots" for partitions on the disk would be empty.
  • Multiple Partition Windows PC: To use more than one partition at a time on a DOS/Windows system, two partitions are used. One is a regular DOS primary partition (which becomes the "C:" drive). The other is the extended DOS partition. Within the extended DOS partition, all the other logical drives are created. So a drive with four logical drive letters would have the first (C:) be the active primary partition, and the other three (D:, E: and F:) would be logicals within the extended DOS partition.
  • Multiple Operating System PC: A system with multiple operating systems could use one primary partition for each of up to four different file systems.

If you want, you can also combine multiple partitions with multiple operating systems. For example, you could have a primary DOS partition, an extended DOS partition, and a Linux partition. Such setups are far less common than the simpler examples above.

The extended DOS partition causes most of the confusion on the part of those setting up new DOS/Windows PCs. It really functions as a "container" that holds all DOS partitions except for the first (primary) volume. The reason that this structure was used is that the original design, with its limit of four partitions, was too restrictive. The extended DOS partition system allows you to have up to 24 disk partitions in a single system, without violating compatibility with older hardware and software designed based on the original four-partition limit. Of course, nobody would use that many partitions on a system in most cases, because it would be a data organization nightmare! :^)

Within the extended DOS partition, the logical drives are stored in a linked structure. The extended partition's information is contained in the master partition table (since the extended partition is one of the four partitions stored in the master boot record). It contains a link to an extended partition table that describes the first logical partition for the disk. That table contains information about that first logical partition, and a link to the next extended partition table which describes the second logical partition on the disk, and so on. The extended partition tables are linked in a chain starting from the master partition table.

In terms of how the disk is used, there are only two main differences between a primary and a logical partition or volume. The first is that a primary partition can be set as bootable (active) while a logical cannot. The second is that DOS assigns drive letters (C:, D: etc.) differently to primary and logical volumes.

Here's an example to hopefully make all of this a bit more clear. Let's suppose you are setting up a new system and starting with an empty 60 GB hard disk. You could create a single 60 GB partition, which would be a primary DOS partition. However, in many cases dividing up such a large disk will make it easier to manage the space, will reduce lost disk space due to slack, and will reduce defragmentation time on partitions containing more actively-used data. (See here for much more on the issues involved in partitioning.) So instead, let's say you want to split up this drive as follows:

  • One 8 GB primary partition for Windows and other operating system and program files.
  • One 12 GB partition for data.
  • One 16 GB partition for games.
  • The rest of the disk in a 24 GB partition for large multimedia files, short-term backups and "future expansion".

I'm assuming no complicating factors here, just a simple example. To do this, you will first set up a primary DOS partition 8 GB in size. This is the first of your four partitions. You will then create an extended DOS partition that is 52 GB in size. This is the second partition on the hard disk. Within the extended DOS partition you will create three logical volumes: one 12 GB, one 16 GB and one 24 GB. These are your second, third and fourth volumes (logical partitions). The first partition will be your C: drive from which you boot the machine, and DOS will (normally) assign D:, E: and F: to the other three logical partitions. Your hard disk will have one primary DOS partition, and one extended DOS partition containing three logical DOS volumes.

Graphical depiction of the partitioning of a 60 GB hard disk,
as described in the example above. Each square represents
1 GB of space on the hard disk. The blue squares are the 8 GB
primary partition; the green, red and purple squares are the
12 GB, 16 GB and 24 GB partitions respectively. The latter
three partitions are logical partitions contained within an extended
DOS partition, indicated by the larger, gray-shaded rectangle.

Once the system is set up, there is no functional difference between these partitions, other than the fact that C: is the only bootable one and is where all the DOS system files reside. Regular files can reside wherever you want them to.

Source : http://www.pcguide.com/ref/hdd/file/structPartitions-c.html

Next: Volume Boot Sectors

Tiada ulasan:

Catat Ulasan

My Card