Nearly every modern-day operating system uses disk partitions, and Red Hat Linux is no exception. When installing Red Hat Linux, it will be necessary to work with disk partitions. If you have not worked with disk partitions before (or would like a quick review of the basic concepts) please read Appendix C before proceeding.
Please Note: If you intend to perform a workstation- or server-class installation, and you already have sufficient unpartitioned disk space, you do not need to read this section, and may turn to Section 2.9. Otherwise, please read this section in order to determine the best approach to freeing disk space for your Red Hat Linux installation.
In order to install Red Hat Linux, you must make disk space available for it. This disk space needs to be separate from the disk space used by other operating systems you may have installed on your computer, such as Windows, OS/2, or even a different version of Linux. This is done by dedicating one or more partitions to Red Hat Linux.
Before you start the installation process, one of the following conditions must be met:
Let's look at how this can be done.
There are three possible scenarios you may face when attempting to repartition your hard disk:
Let's look at each scenario in order.
Please Note: The figures in this section are based on those used in Appendix C, and represent the sequence of events necessary to free disk space for Red Hat Linux. If these figures do not make sense to you, you should read Appendix C before proceeding any further. Keep in mind that these illustrations are simplified in the interest of clarity, and do not reflect the exact partition layout that you will encounter when actually installing Red Hat Linux.
In this situation, the partitions already defined do not span the entire hard disk, leaving unallocated space that is not part of any defined partition. Figure 3 shows what this might look like.
If you think about it, an unused hard disk also falls into this category; the only difference is that all the space is not part of any defined partition.
In any case, you can simply create the necessary partitions from the unused space. Unfortunately, this scenario, although very simple, is not very likely (unless you've just purchased a new disk just for Red Hat Linux).
Let's move on to a slightly more common situation.
In this case, maybe you have one or more partitions that you just don't use any longer. Perhaps you've dabbled with another operating system in the past, and the partition(s) you've dedicated to it never seem to be used anymore. Figure 4 illustrates such a situation.
If you find yourself in this situation, you can use the space allocated to the unused partition. You'll first need to delete the partition, and then create the appropriate Linux partition(s) in its place. You can either delete the partition using DOS fdisk, or you'll be given the opportunity to do so during a custom-class installation.
This is the most common situation. It is also, unfortunately, the hardest to work with. The main problem is that, even if you have enough free space, it's presently allocated to a partition that is in use. If you purchased a computer with pre-installed software, the hard disk most likely has one massive partition holding the operating system and data.
Aside from adding a new hard drive to your system, you have two choices:
After creating a smaller partition for your existing software, you can reinstall any software, restore your data, and continue with your Red Hat Linux installation. Figure 5 shows this being done.
Please Note: As Figure 5 shows, any data present in the original partition will be lost without proper backup!
While the process of non-destructive repartitioning is rather straightforward, there are a number of steps involved:
Let's take a look at each step in a bit more detail.
-- As Figure 6 shows, the first step is to compress the data in your existing partition. The reason for doing this is to rearrange the data such that it maximizes the available free space at the ``end'' of the partition.
This step is crucial; without it, it is possible that the location of your data could prevent the partition from being resized to the extent desired. Note also that, for one reason or another, some data cannot be moved. If this is the case (and it restricts the size of your new partition(s)), you may be forced to destructively repartition your disk.
-- Figure 7 shows the actual resizing process. While the actual end-product of the resizing operation varies depending on the software used, in most cases the newly freed space is used to create an unformatted partition of the same type as the original partition.
It's important to understand what the resizing software you use does with the newly freed space, so that you can take the appropriate steps. In the case we've illustrated, it would be best to simply delete the new DOS partition, and create the appropriate Linux partition(s).
-- As the previous step implied, it may or may not be necessary to create new partitions. However, unless your resizing software is Linux-aware, it is likely you'll need to delete the partition that was created during the resizing process. Figure 8 shows this being done.
[Intel Systems: The following information is specific to Intel-based computers only.]
As a convenience to our customers, we provide the fips utility. This is a freely available program that can resize FAT (File Allocation Table) partitions. It's included on the Red Hat Linux/Intel CD-ROM in the dosutils directory.
Should you decide to use fips, be aware that after fips runs you will be left with two partitions: the one you resized, and the one fips created out of the newly freed space. If your goal is to use that space to install Red Hat Linux, you should delete the newly created partition, either by using fdisk under your current operating system, or while setting up partitions during a custom-class installation.
Linux refers to disk partitions using a combination of letters and numbers which may be confusing, particularly if you're used to the ``C drive'' way of referring to hard disks and their partitions. In the DOS/Windows world, here is how partitions are named:
Red Hat Linux uses a naming scheme that is more flexible and conveys more information than the approach used by other operating systems.
The naming scheme is file-based, with filenames in the form:
/dev/xxyN
Here's how to decipher the partition naming scheme:
Please Note: There is no part of this naming convention that is based on partition type; unlike DOS/Windows, all partitions can be identified under Red Hat Linux. Of course, this doesn't mean that Red Hat Linux can access data on every type of partition, but in many cases it is possible to access data on a partition dedicated to another operating system.
Keep this information in mind; it will make things easier to understand when you're setting up the partitions Red Hat Linux requires.
[Intel Systems: If Red Hat Linux/Intel will coexist on your machine with OS/2, you must create your disk partitions with the OS/2 partitioning software---otherwise, OS/2 may not recognize the disk partitions. During the installation, do not create any new partitions, but do set the proper partition types for your Linux partitions using the Linux fdisk.]
One area that many people new to Linux find confusing is the matter of how partitions are used and accessed by the Linux operating system. In DOS/Windows, it is relatively simple: If you have more than one partition, each partition gets a ``drive letter.'' You then use the drive letter to refer to files and directories on a given partition.
This is entirely different from how Red Hat Linux deals with partitions and, for that matter, with disk storage in general. The main difference is that each partition is used to form part of the storage necessary to support a single set of files and directories. This is done by associating a partition with a directory through a process known as mounting. Mounting a partition makes its storage available starting at the specified directory (known as a mount point).
For example, if partition /dev/hda5 were mounted on /usr, that would mean that all files and directories under /usr would physically reside on /dev/hda5. So the file /usr/doc/FAQ/txt/Linux-FAQ would be stored on /dev/hda5, while the file /etc/X11/gdm/Sessions/Gnome would not.
Continuing our example, it is also possible that one or more directories below /usr would be mount points for other partitions. For instance, a partition (say, /dev/hda7) could be mounted on /usr/local, meaning that, for example, /usr/local/man/whatis would then reside on /dev/hda7 rather than /dev/hda5.
At this point in the process of preparing to install Red Hat Linux, you will need to give some consideration to the number and size of the partitions to be used by your new operating system. The question of ``how many partitions'' continues to spark debate within the Linux community and, without any end to the debate in sight, it's safe to say that there are probably as many partition layouts as there are people debating the issue.
Keeping this in mind, we recommend that, unless you have a reason for doing otherwise, you should create the following partitions:
[Intel Systems: The following partition is specific to Red Hat Linux/Intel installations.]
Please Note: Make sure you read Section 2.8.6 -- the information there applies to the /boot partition!
[Alpha Systems: The following partition is specific to Red Hat Linux/Alpha installations.]
[Intel Systems: LILO (the LInux LOader) is the most commonly used method to boot Red Hat Linux on Intel-based systems. An operating system loader, LILO operates ``outside'' of any operating system, using only the Basic I/O System (or BIOS) built into the computer hardware itself. This section describes LILO's interactions with PC BIOSes, and is specific to Intel-compatible computers. ]
[Alpha Systems: Alpha owners may skip ahead to Section 2.9.]
[SPARC Systems: SPARC owners may skip ahead to Section 2.9.]
LILO is subject to some limitations imposed by the BIOS in most Intel-based computers. Specifically, most BIOSes can't access more than two hard drives and they can't access any data stored beyond cylinder 1023 of any drive. Note that some recent BIOSes do not have these limitations, but this is by no means universal.
All the data LILO needs to access at boot time (including the Linux kernel) are located in the /boot directory. If you follow the partition layout recommended above, or you are performing a workstation- or server-class install, the /boot directory will be in a small, separate partition. Otherwise, it will reside in the root partition. In either case, the partition in which /boot resides must conform to the following guidelines if you are going to use LILO to boot your Red Hat Linux system:
As mentioned earlier, it is possible that some of the newer BIOSes may permit LILO to work with configurations that don't meet our guidelines. Likewise, some of LILO's more esoteric features may be used to get a Linux system started, even if the configuration doesn't meet our guidelines. However, due to the number of variables involved, Red Hat Software cannot support such extraordinary efforts.
Please Note: Disk Druid as well as the workstation- and server-class installs take these BIOS-related limitations into account. However, if you decide to use fdisk instead, it is your responsibility to ensure that you keep these limitations in mind.