Chapter 26. An Introduction to Disk Partitions
26.1. Hard Disk Basic Concepts
Figure 26.1. An Unused Disk Drive
26.1.1. It is Not What You Write, it is How You Write It
Figure 26.2. Disk Drive with a File System
- A small percentage of the drive's available space is used to store file system-related data and can be considered as overhead.
- A file system splits the remaining space into small, consistently-sized segments. For Linux, these segments are known as blocks. 
Figure 26.3. Disk Drive with a Different File System
Figure 26.4. Disk Drive with Data Written to It
26.1.2. Partitions: Turning One Drive Into Many
Figure 26.5. Disk Drive with Partition Table
- The points on the disk where the partition starts and ends
- Whether the partition is "active"
- The partition's type
Figure 26.6. Disk Drive With Single Partition
Table 26.1. Partition Types
|Partition Type||Value||Partition Type||Value|
|Empty||00||Novell Netware 386||65|
|DOS 12-bit FAT||01||PIC/IX||75|
|XENIX root||02||Old MINIX||80|
|DOS 16-bit <=32M||04||Linux swap||82|
|DOS 16-bit >=32||06||Linux extended||85|
|OS/2 Boot Manager||0a||OpenBSD||a6|
|Win95 FAT32 (LBA)||0c||BSDI fs||b7|
|Win95 FAT16 (LBA)||0e||BSDI swap||b8|
|Win95 Extended (LBA)||0f||Syrinx||c7|
|PPC PReP Boot||41||DOS R/O||e3|
|GNU HURD||63||DOS secondary||f2|
|Novell Netware 286||64||BBT||ff|
26.1.3. Partitions within Partitions — An Overview of Extended Partitions
Figure 26.7. Disk Drive With Extended Partition
26.1.4. Making Room For Red Hat Enterprise Linux
- Unpartitioned free space is available
- An unused partition is available
- Free space in an actively used partition is available
184.108.40.206. Using Unpartitioned Free Space
Figure 26.8. Disk Drive with Unpartitioned Free Space
220.127.116.11. Using Space from an Unused Partition
Figure 26.9. Disk Drive With an Unused Partition
18.104.22.168. Using Free Space from an Active Partition
- Destructive Repartitioning
- Basically, you delete the single large partition and create several smaller ones. As you might imagine, any data you had in the original partition is destroyed. This means that making a complete backup is necessary. For your own sake, make two backups, use verification (if available in your backup software), and try to read data from your backup before you delete the partition.
WarningIf there was an operating system of some type installed on that partition, it needs to be reinstalled as well. Be aware that some computers sold with pre-installed operating systems may not include the CD-ROM media to reinstall the original operating system. The best time to notice if this applies to your system is before you destroy your original partition and its operating system installation.After creating a smaller partition for your existing operating system, you can reinstall any software, restore your data, and start your Red Hat Enterprise Linux installation. Figure 26.10, “Disk Drive Being Destructively Repartitioned” shows this being done.
Figure 26.10. Disk Drive Being Destructively RepartitionedIn Figure 26.10, “Disk Drive Being Destructively Repartitioned”, 1 represents before and 2 represents after.
WarningAs Figure 26.10, “Disk Drive Being Destructively Repartitioned”, shows, any data present in the original partition is lost without proper backup!
- Non-Destructive Repartitioning
- Here, you run a program that does the seemingly impossible: it makes a big partition smaller without losing any of the files stored in that partition. Many people have found this method to be reliable and trouble-free. What software should you use to perform this feat? There are several disk management software products on the market. Do some research to find the one that is best for your situation.While the process of non-destructive repartitioning is rather straightforward, there are a number of steps involved:
- Compress and backup existing data
- Resize the existing partition
- Create new partition(s)
22.214.171.124.1. Compress existing data
Figure 26.11. Disk Drive Being Compressed
126.96.36.199.2. Resize the existing partition
Figure 26.12. Disk Drive with Partition Resized
188.8.131.52.3. Create new partition(s)
Figure 26.13. Disk Drive with Final Partition Configuration
partedutility. This is a freely available program that can resize partitions.
parted, it is important that you be familiar with disk storage and that you perform a backup of your computer data. You should make two copies of all the important data on your computer. These copies should be to removable media (such as tape, CD-ROM, or diskettes), and you should make sure they are readable before proceeding.
parted, be aware that after
partedruns you are left with two partitions: the one you resized, and the one
partedcreated out of the newly freed space. If your goal is to use that space to install Red Hat Enterprise Linux, you should delete the newly created partition, either by using the partitioning utility under your current operating system or while setting up partitions during installation.
26.1.5. Partition Naming Scheme
- Each partition's type is checked to determine if it can be read by DOS/Windows.
- If the partition's type is compatible, it is assigned a "drive letter." The drive letters start with a "C" and move on to the following letters, depending on the number of partitions to be labeled.
- The drive letter can then be used to refer to that partition as well as the file system contained on that partition.
- This is the name of the directory in which all device files reside. Since partitions reside on hard disks, and hard disks are devices, the files representing all possible partitions reside in
- The first two letters of the partition name indicate the type of device on which the partition resides, usually either
hd(for IDE disks) or
sd(for SCSI disks).
- This letter indicates which device the partition is on. For example,
/dev/hda(the first IDE hard disk) or
/dev/sdb(the second SCSI disk).
- The final number denotes the partition. The first four (primary or extended) partitions are numbered
4. Logical partitions start at
5. So, for example,
/dev/hda3is the third primary or extended partition on the first IDE hard disk, and
/dev/sdb6is the second logical partition on the second SCSI hard disk.
26.1.6. Disk Partitions and Other Operating Systems
26.1.7. Disk Partitions and Mount Points
/dev/hda5is mounted on
/usr/, that would mean that all files and directories under
/usr/physically reside on
/dev/hda5. So the file
/usr/share/doc/FAQ/txt/Linux-FAQwould be stored on
/dev/hda5, while the file
/usr/would be mount points for other partitions. For instance, a partition (say,
/dev/hda7) could be mounted on
/usr/local/, meaning that
/usr/local/man/whatiswould then reside on
26.1.8. How Many Partitions?
/boot/efi/partition for Itanium systems), a
/var/partition for Itanium systems, and