Partitioning basics

When you buy a new hard drive, it usually comes in an unformatted state. There are no partitions or file systems on it and it is ready for partitioning and formatting. It usually comes with a disk with a formatting tool on it which will create one or more partitions on this hard drive based on Microsoft's FAT file system, but partition creation and formatting can be done with any partitioning tool, though there are certain issues when dealing with Windows on multi-boot systems, and with using Linux partition tools like GParted to modify Windows partitions). Upon launching GPartEd from the Ubuntu Live CD (selecting "System/Administration/Partition Editor" from the Launch Bar at top) and (if necessary) selecting the hard drive, the drive will look like this:


  • http://i400.photobucket.com/albums/pp84/ubun5uc/UnformDisk.png


Notice that the entire drive is marked "Unallocated" and is called "Free Space." The drive is ready to create partitions on. I will start with the types of partitions that can be created and their purposes. Drives which have already been partitioned and formatted will follow these conventions, so in order to successfully and efficiently repartition them requires knowledge of these conventions.

There are three types of partitions with which you will be dealing; Primary, Extended, and Logical partitions.

Partitioning Conventions

In "Partitioning Basics", I mentioned the "Unallocated Free Space" on a new drive. All partitions created in this Free Space are created under "Primary partition" rules and conventions.

Primary Partition Rules and Conventions

You can only create four Primary partitions on any single physical hard drive. This partition limit extends to the Linux Swap partition as well as for any Operating System installation or extra special purpose partitions, such as separate /root, /home, /boot, etc., that you might want to create.

If you attempt to create more than four Primary Partitions, you will see the following warning:


  • http://i400.photobucket.com/albums/pp84/ubun5uc/No-5th-Part.png


Notice that when I tried to create a fifth partition, GPartEd gave me a message warning that this could not be accomplished. How do we circumvent this limitation and create more partitions? With an Extended Partition.

Extended Partitions

While in most circumstances, such as a "Guided Install" from the Live CD on a new Windows computer, four partitions are enough, there are circumstances in which you might need to create more than four partitions. This is the reason for an Extended partition.

An Extended partition is a special type of partition that contains "Free Space" in which more than the four Primary partitions can be created. Partitions created within the Extended partition are called Logical partitions, and any number of Logical partitions can be created within an Extended partition. The following conventions apply to Extended partitions:

  1. When you create an Extended partition, it occupies one of the four Primary partition spots. When an Extended partition exists on a hard drive, only three Primary partitions may co-exist with it. (See Primary Partitions Rules and Conventions) If there are four Primary partitions already on a hard drive and you wish to create an Extended partition in which to create more, one of the Primary partitions must be deleted in order to create it.
  2. Only one extended partition may be created on a hard drive (though you can have one extended partition on each of the hard drives connected to your system). The partition editor will not allow it, and it would serve no purpose at any rate. If you need the extra Extended partition space, you only need expand the one you have.

  3. An Extended partition cannot be formatted with a filesystem, such as ext3, FAT, or NTFS, nor can it directly hold data. That is the function of the Logical Drives which are created within it.

Logical Partitions

A partition created within an Extended partition is called a Logical partition. Any number of Logical partitions may be created within an Extended partition, and they may be formatted with any filesystem.

All Operating Systems that I am aware of are able to access any Logical partition that is formatted to a compatible filesystem. For instance, while Windows will not recognize a Linux ext2 partition without a third-party driver, it will be able to access any partition formatted with FAT or NTFS, depending on the version of Windows. Linux, of course, will access all of these.

Next Page - Creating A Partition

Main Page


CategoryInstallation

HowtoPartition/PartitioningBasics (last edited 2009-05-01 17:51:29 by stevex)