Next Up Previous Contents Index

2.4 Disk Partitions

Disk Partitions

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.

A disk can be divided into different partitions. Each partition can be accessed as if it was a separate disk. Furthermore, each partition has a type that is used to indicate how information is stored in the partition. For example, there are different partition types used by DOS, OS/2, and Linux.

Even if you will be installing Red Hat Linux on its own hard disk, or on a computer which contains no other operating system, you'll still need to create partitions for Red Hat Linux to use. In this case it's pretty easy, as there are no other partitions on the hard disk to worry about.

On the other hand, you may wish to install Red Hat Linux on a disk which already contains software or data from a different operating system. Things can get a little trickier in this situation, since a mistake can destroy your existing partitions, not to mention the data they contain!

During the installation process, you'll be given the chance to create partitions for Red Hat Linux. At this point, your main concern is making sure you have sufficient disk space available to create those partitions. Let's review the different ways to free up space for Red Hat Linux partitions.

2.4.1 Repartitioning Strategies

Repartitioning Strategies

There are three possible scenarios you may face when attempting to repartition your hard disk:

Let's look at each scenario in order.

2.4.1.1 Using Unpartitioned Free Space

Using Unpartitioned Free Space

In this situation, the partitions defined do not span the entire hard disk, leaving unallocated space that is not part of any defined partition. 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 this case, you can simply create the necessary partitions from the unused space.

2.4.1.2 Using An Unused Partition

Using An Unused Partition

Last year you replaced that tiny 105MB hard drive on your Windows system with a 1.2GB monster. You partitioned it into two equal parts, figuring that you'd use the C: ``drive'' (really the drive's first partition) for Windows, and the D: ``drive'' (really the drive's second partition) for your collection of freeware programs downloaded from the Internet. Well, you'd been so used to using C: that you never put anything of substance on D:.

If you find yourself in this situation, you can use the space allocated to the unused partition. You'll need to delete the partition, and create the appropriate Linux partitions in its place.

2.4.1.3 Using Free Space From An Active Partition

Using Free Space From An Active Partition

This is the most common situation. It is also, unfortunately, the hardest to deal with. The main problem is that you have enough free space, but 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:

Destructive Repartitioning -- Basically, you delete the single large partition, and create several smaller ones. As you might imagine, any data you had in that 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. Note also that if there was an operating system of some type installed on that partition, it will need to be reinstalled as well.

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.

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; however, we recommend that you make backups of the partition being resized, just in case.

[Intel Systems: What software should you use to perform this feat? You can use the fips utility to resize FAT (File Allocation Table) partitions. It's included on the Red Hat Linux/Intel CD-ROM in the dosutils directory. Before using it, however, we highly recommend reading the fips documentation, located in the fipsdocs subdirectory.

Please Note: At the present time, the fips utility cannot resize the new FAT32-style partitions found on many newer computers. If your computer has a FAT32 partition, you can either use destructive repartitioning, or purchase commercial disk management software capable of shrinking FAT32 partitions. ]

2.4.2 Disk Partitions and Other Operating Systems

Disk Partitions and Other Operating Systems If your Red Hat Linux partitions will be sharing a hard disk with partitions used by other operating systems, most of the time you'll have no problems. However, there are certain combinations of Linux and other operating systems that require extra care. Information on creating disk partitions compatible with other operating systems is available in several HOWTOs and Mini-HOWTOs, available on the Red Hat Linux CD in the doc/HOWTO and doc/HOWTO/mini directories. In particular, the Mini-HOWTOs whose names start with Linux+ are quite helpful.

[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.]

2.4.3 One Last Wrinkle: Using LILO

One Last Wrinkle: Using LILO

[Intel Systems: LILO (the LInux LOader) is the most commonly used method to boot Red Hat Linux on Intel-based systems. Being 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. ]

[Alpha Systems: Alpha owners may skip ahead to Section 2.4.4.]

[SPARC Systems: SPARC owners may skip ahead to Section 2.4.4.]

2.4.3.1 BIOS-Related Limitations Impacting LILO

BIOS-Related Limitations Impacting LILO

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 (the 1024th cylinder) 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, which is normally part of the root part partition (known as /). Here are the guidelines you must follow if you are going to use LILO to boot your Red Hat Linux system:

On First Two IDE Drives -- If you have 2 IDE (or EIDE) drives, /boot must be located on one of them. Note that this two-drive limit also includes any IDE CD-ROM drives on your primary IDE controller. So, if you have one IDE hard drive, and one IDE CD-ROM on your primary controller, /boot must be located on the first hard drive only, even if you have other hard drives on your secondary IDE controller.

On First IDE Or First SCSI Drive -- If you have one IDE (or EIDE) drive and one or more SCSI drives, /boot must be located either on the IDE drive or the SCSI drive at ID 0. No other SCSI IDs will work.

On First Two SCSI Drives -- If you have only SCSI hard drives, /boot must be located on a drive at ID 0 or ID 1. No other SCSI IDs will work.

Partition Completely Below Cylinder 1023 -- No matter which of the above configurations apply, the partition that holds /boot must be located entirely below cylinder 1023. If the partition holding /boot straddles cylinder 1023, you may face a situation where LILO will work initially (because all the necessary information is below cylinder 1023), but will fail if a new kernel is to be loaded, and that kernel resides above cylinder 1023.

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.

2.4.4 How Many Partitions?

How Many Partitions?

Although you can install Red Hat Linux in a single large partition (subject to any of the partitioning considerations we've mentioned so far), it's a much better idea to split things up a bit. We recommend the following layout as a compromise between single-partition simplicity, and multi-partition flexibility:

Please Note: If you plan to install all the software packages accompanying Red Hat Linux, you may need to use even larger partitions.

A swap partition -- Swap partitions are used to support virtual memory. If your computer has 16 MB of RAM or less, you must create a swap partition. Even if you have more memory, a swap partition is still recommended. The minimum size of your swap partition should be equal to your computer's RAM, or 16 MB (whichever is larger).

A root partition -- The root partition is where / (the root directory) resides. It only needs to contain things necessary to boot your system, as well as system configuration files. A root partition of 50 MB to 80 MB works well for most systems.

[Intel Systems: Don't forget the LILO constraints we mentioned in Section 2.4.3!]

A /usr partition -- The /usr partition is where much of the software on a Red Hat Linux system resides. This partition should be between 200 MB and 500 MB, depending on how many packages you plan to install. If at all possible, try to be generous with the /usr partition. Any RPM-based packages you install later will (in general) use more space from /usr than from any other partition.

A /home partition -- This is where users' home directories go; the size of /home depends on how many users you plan to have on your Red Hat Linux system and what they might store in their home directories.

[Alpha Systems: The following partition is specific to Red Hat Linux/Alpha installations.]

A MILO partition -- Alpha owners that will be using MILO to boot their systems should create a 1.5 MB DOS partition where MILO can be copied after the installation is complete.

Additionally, you may wish to create any of the following:

A /usr/local partition -- Traditionally, /usr/local has been used to hold things you wish to keep separate from the rest of your Red Hat Linux system, such as software that is not available as an RPM package. The size depends on the amount of software you anticipate putting on your system.

A /usr/src partition -- There are two things that are stored in /usr/src on a Red Hat Linux system:

Linux Kernel Sources -- The complete sources for the Linux kernel are stored here, and new kernels are built here.

Sources For RPM-Based Packages -- If a source package file (aka SRPM) is installed, the files are stored here. Note that, unless specified otherwise, any packages built also use a build directory located here.

Again, the size of this partition would depend on the amount of software you anticipate building.

A /tmp partition -- As the name implies, the /tmp partition is for temporary files. Creating a partition dedicated to /tmp is a good idea for larger, multiuser systems or network server machines. The reason is that many active users can fill the root partition (/), which is where /tmp is located. It's not necessary to dedicate a partition to /tmp on single-user workstations.


Next Up Previous Contents Index