Creating Hard Disk Partitions

The latest hard disks are now quite large. Partitions help you configure hard disks in manageable chunks . When configured correctly, partitions can help protect your system. For example, if someone overloads your FTP server with files, the right partitions ensure that your system still has room to run.

Alternatively, if you have a smaller hard disk (less than 4GB), you ll need to be efficient. If you over-partition a drive, you may not have enough space for certain types of additional files.

You can organize each physical hard disk into primary , extended , and logical partitions. The details depend on whether you re configuring a regular IDE (Integrated Drive Electronics) hard disk or a SCSI (Small Computer Systems Interface) hard disk.

Linux is organized into directories. You can mount different directories onto partitions according to the Filesystem Hierarchy Standard. We cover the FHS and typical partition configurations for Red Hat Linux in Chapter 07 .

Partition Styles

You can even configure different operating systems on the same hard disk, using different partitions. Each filesystem can be formatted to different filesystems, such as the default Red Hat Third Extended Filesystem (ext3) or Microsoft s FAT32. In this vein, there are four ways to partition a hard drive:

Primary partition You can have up to four different primary partitions on a hard drive. One primary partition must be marked as active and can include a bootloader, such as the Grand Unified Bootloader (GRUB). If you mount a Linux directory on a primary partition, it is also known as a volume .

Extended partition If four partitions are not enough, you can convert one of the primary partitions into an extended partition. You can then subdivide the extended partition into as many logical partitions as you need. But you can t mount a directory on an extended partition.

Logical partition You can subdivide an extended partition into as many logical partitions as you need. Although you can t set up a Linux directory in an extended partition, you can set up Linux directories on logical partitions. Therefore, logical partitions are also volumes . In the Microsoft world, these would be logical drives .

Swap partition In Linux, it is common to set up a swap partition as an exclusive area for the virtual memory on your hard drive. Swap partitions aren t a different kind of partition per se; they can be mounted on a primary or logical partition. While the appropriate size of a swap partition is highly debatable, Red Hat recommends that you set up a swap partition with twice the amount of memory in your RAM.

Partition Names

The Linux naming convention for hard disk partitions is straightforward. The naming system also applies to any CD that doesn t require a direct connection to a sound card. The first two letters of the name reflect the kind of disk you have. If you have a regular IDE hard disk, the letters are hd . If you have a SCSI hard disk, the letters are sd .

The third letter depends on your hard disk s position. The first hard disk is designated as a , the second disk is designated as b , and so on. In other words, if you have two different physical IDE hard disks attached to the primary controller, the second (slave) disk is known as hdb . In contrast, SCSI hard disk letters correspond to their designated ID numbers . For example, if you have two SCSI drives with IDs of 0 and 1, the SCSI drive with an ID of 0 is known as sda; the SCSI drive with an ID of 1 is known as sdb . For naming purposes, CD and DVD drives are also categorized as hard disks.

The character in the fourth position reflects how you ve partitioned that disk. Because you can have up to four primary partitions, they are designated as 1, 2, 3, and 4. The first logical drive that you create is in position number 5, even if you have only one primary partition.

Every partition is associated with a Linux device file in the /dev directory. When you mount a directory on a partition, you re associating it with the device file. Some examples of different partition device files are shown in Table 2.1.

Table 2.1: Typical Partition Device Names




The third primary partition on the master hard disk on the primary IDE controller; depending on your configuration, it may also be an extended partition.


The fourth logical partition on the third SCSI hard disk.


The third logical partition on the slave hard disk on the primary IDE controller.


The first primary partition on the first SCSI hard disk.


Since there is no number, this refers to a CD or DVD drive attached as the slave on the primary IDE controller.


Since there is no number, this refers to a CD or DVD drive attached to the third position on a SCSI interface.

On an IDE drive, you can have up to 16 partitions. On a SCSI drive, you can have up to 15 partitions.


Mastering Red Hat Linux 9
Building Tablet PC Applications (Pro-Developer)
ISBN: 078214179X
EAN: 2147483647
Year: 2005
Pages: 220 © 2008-2017.
If you may any questions please contact us: