- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
Partitioning
Linux looks at hard drives differently than DOS/Windows. Instead of calling the first partition C:, the second one D:, and so on, it will usually be a combination of characters that signify the BUS and hard drive number. It works like this:
- hda—First IDE controller, Master
- hdb—First IDE controller, Slave
- hdc—Second IDE controller, Master
- hdd—Second IDE controller, Slave
- sda—First SCSI drive on the SCSI BUS
This is only the name of the devices as Linux sees them. The actual way Linux views your partitions is
- hda1—Primary partition on first hard drive.
- hda5—Extended partition on first hard drive. The extended partition will always have the number 5 as its partition number.
- hda6+—First logical partition inside the extended partition on the first hard drive.
This is the same for partitions on SCSI devices. Generally, your CD-ROM will be hdc because there are no partitions on a CD.
Two tools that come with Red Hat Linux can be used to set up Linux partitions: the old standby, fdisk, and a graphical partitioning tool, Disk Druid. Both are acceptable methods for configuring your partitions, but Disk Druid is easier. That is what is used here. There is another tool that can be used to resize and move around partitions. It is called fips.exe. It is in the dosutils directory on the CD. This is a DOS-based program, generally used to make room for Linux when crafting a dual-boot system. Extreme caution must be exercised when using this.
Partitioning Using fdisk
For you old-timers out there, here are some pointers for fdisk. Again, Disk Druid is the recommended (and safer) way of partitioning the disks. If you want to use the fdisk partitioning program during installation, start the install program in Expert mode.
Table 2.1 lists some commands and a walkthrough of fdisk.
Table 2.1. fdisk Key Commands
| Key | What It Does |
| m | Provides a listing of the available commands |
| p | Provides a listing of the current partition information |
| n | Adds a new partition |
| t | Sets or changes the partition type |
| l | Provides a listing of the different partition types and their ID numbers |
| w | Saves your information and quits fdisk |
| q | Exits without saving any changes (handy when you make a mistake) |
Use p to check the current partition information, but add your root partition beforehand. Use n to create a new partition and then select either e or p for extended or primary partition. Most likely you want to create a primary partition. You are asked what partition number should be assigned to it, at which cylinder the partition should start (you will be given a range—choose the lowest number), and the size of the partition. For example, for a 500MB partition, enter +500M for the size.
Using Disk Druid for Partitioning
Disk Druid is a tool that first shipped with Red Hat version 5. It is a graphical interface that enables you to configure your hard disk partitions.
There are three sections associated with Disk Druid. Each is explained in detail here.
The Partitions Section
Each line in the Partitions section represents a disk partition. Note the scrollbar in Figure 2.1.
Figure 2.1 Disk Druid partitioning during graphical installation of Red Hat Linux.
The scrollbar indicates additional items that cannot all be displayed at one time. Use the up and down arrow keys to look for any additional partitions. Each line (partition) has five fields, which are shown in Table 2.2.
Table 2.2. Current Partition Information
| Field | Description |
| Mount Point | Indicates where the partitions will be mounted after the Red Hat Linux system is up and running. (At least one partition must have a mount point of / before you can move past the Disk Druid screen in the installation process.) Swap space does not get a mount point. |
| Device | Indicates the device name of the partition. |
| Requested | Indicates the minimum size requested when the partition was defined. |
| Actual | Indicates the actual amount of space allocated to that partition. |
| Type | Shows the partition's type. |
Drive Summary
This section shows the volumes, or hard disk(s) on the system. Just like the Partitions section, this section will scroll in case more than a couple of drives are attached to this computer. Each line contains six fields, which are shown in Table 2.3.
Table 2.3. Drive Summary
| Field | Description |
| Drive | Shows the device name of the volume. |
| Geom [C/H/S] | Shows drive's geometry. The three numbers represent the number of cylinders, heads, and sectors (reported by querying hard drive). |
| Total (M) | Shows how much space is on the entire hard drive. |
| Free (M) | Shows how much space is currently available on the hard drive. Indicates how much is unallocated. |
| Used (M) | Shows how much space is currently defined to a partition. |
| Used (%) | A graphical percentage indicator of how much space is used for partitioning the drive. |
Disk Druid's Buttons
The third section of Disk Druid in a graphical install contains five buttons across the bottom of the screen. If you perform a text-based install you can also use corresponding F keys. The buttons and (text-based install F keys) are detailed in Table 2.4.
Table 2.4. Disk Druid Buttons
| Button | Function |
| Add | Adds a new partition to the partition table. When pressed, a dialog box appears that contains fields that must be filled in. (F1) |
| Edit | Changes the attributes (such as size or type) of the highlighted partition in the Partitions section. If the Edit button is pressed, a dialog box appears with fields that can be edited. (F3) |
| Delete | Use this button to delete the selected partition in the Partitions section. Selecting Delete brings up a confirmation box. (F4) |
| OK | Active during a text-based install, and when selected, any changes made are written to disk. At this time, you can confirm that you want the changes written to disk. This information is also passed to the installation program for later filesystem creation. (F12) |
| Make RAID | This button is only active if you have created RAID partitions (of type fd if Device using fdisk); use the Add button to create a new partition, then select type RAID and the allowable drives (used for your RAID array). |
| Back | This is the abort button. If you select the Back button, Disk Druid exits without making changes and you are returned to the previous window, where you can select fdisk or Disk Druid to start over. |
| Function keys | As mentioned earlier, Disk Druid also has six handy function keys. Four of them map directly to the buttons just described (Add, Edit, Delete, and OK). Two are different and are explained next. |
| F2-Add NFS | The F2 function key opens a dialog box in which you can define a read-only NFS-served filesystem. |
| F5-Reset | This function does just what you think it does. (It does not reset your computer—that is Ctrl+Alt+Delete.) F5 resets the partitions to the way they were before you started editing them in this section. |
Adding a Partition
To add a new partition, use the Add button (or select it, and press Enter during a text-based install). A dialog box opens and contains the fields shown in Table 2.5.
Table 2.5. Mounting Information
| Field | Description |
| Mount Point | Highlight this field and enter the partition's mount point. |
| Size | Type a number (in megabytes) for the partition. The default of 1 can be removed with the Backspace key so you can enter a new number. |
| Growable? | Indicates whether the size you entered in the previous field is to be considered the partition's exact size or its minimum size. Press the spacebar to check and uncheck this box. When it's checked, the partition will grow to fill all available space on the hard disk. |
| Type | Contains a list of partition types. Select the appropriate type by using the up and down arrow keys. |
| Allowable Drives | Contains a list of the hard disks installed on your system, with a check box for each disk. If a box is checked, this partition can be created on that hard disk. If a box is not checked, the partition will never be created on that hard disk. |
| OK | Select this button and press the spacebar when you finish the settings for this particular partition and you're ready to create it. |
| Cancel | When you select this button, the partition you just defined will not be created. |
Understanding Swap Space
A swap space is a space on a hard disk used as the virtual memory extension of a computer's real memory (RAM). Having a swap space allows your computer's operating system to pretend that you have more RAM than you actually do. The least recently used files in RAM can be "swapped out" to your hard disk until they are needed later so that new files can be "swapped in" to RAM.
When you create your swap partition, give some extra thought to the size of this partition (versus blindly picking a number or taking another person's recommendation). You should have at least 16MB total between your RAM and swap space. If you are running X, you should have at least 32MB between them. X is a hog on RAM and will generally use up to 50% of your RAM, so it makes sense to have a decent sized swap file.
The problem with using the generic formula to determine the swap space size is that it doesn't take into consideration what the user might be doing, even though a formula for determining the amount of swapping you need is given here. Note that if you run out of swap space, your system will thrash about, trying to move memory pages into and out of the swap space. This will bring your system to its knees.
A better way to estimate how much RAM you need is to figure out the size of all the programs you would run at one time. To this number, add 24MB to cover the OS. If the total is less than 64MB, use a 64MB swap space; otherwise, use the actual value. These days, with most machines coming with 64MB–128MB of RAM a swap space of 80MB–100MB is about right.
You should always configure some swap space, regardless of how much RAM you have. Even a small amount of swap space will have good results on a system with a lot of RAM. For example, I have 256MB of RAM on my system, which is more than enough for all of the programs I run. I have 127MB of swap space for programs I have running but am not actively using.
To create your swap partition using fdisk, you need to use n for a new partition. Choose either primary or extended; you most likely need primary. Give the partition a number and tell it where the first cylinder should be. Last, tell fdisk how big you want your swap partition. Now you need to change the partition type to Linux swap. Enter t to change the type and enter the partition number of your swap partition. Enter 82 for the hex code for the Linux swap partition.
You have created your Linux and Linux swap partitions, and it is time to add any partitions you might need (for example, Windows 95). Use n again to create a new partition and enter all the information just as before. However, after you enter the size of the partition, you need to change the partition type. Enter l to get a listing of the hex codes for the different partition types. Find the type of partition you need and use t to change the partition type. Repeat this procedure until all your partitions are created. You can create up to four primary partitions; then you must start putting extended partitions into each primary partition.
After your partitions are created, the installation program looks for Linux swap partitions and asks to initialize them. Choose the swap partitions you want to initialize, select the Check for Bad Blocks During Format box, and click OK. This formats the partition and makes it active so Linux can use it.
Formatting Partitions
After the swap space has been formatted, you are asked which partitions you would like formatted. I strongly suggest that you format all system partitions (/, /usr, and /var if they exist). You do not need to format /home or /usr/local if they have been configured during a previous install. Again, checking for bad blocks is a good thing.
The question that generally arises at this point is how big the partitions need to be. Table 2.6 gives a breakdown of the sizes of a typical installation. Of course, you can just have one great big partition called / if you decide not to have individual partitions for each major section.
Table 2.6. Suggested Partition Sizes
| Partition Type | Minimal Size | Suggested Size |
| / | 80MB | 100MB–200MB |
| /usr | 850MB | 850+ applications and other documentation |
| /var | 22MB | 50MB |
| Paging space | 0MB | Up to 2,047MB |
Although minimal and suggested sizes are given, your system's particular needs may require that you go below or above these numbers. For example, /usr at 850MB assumes that you have both text and Web-based documentation loaded for at least one language. In addition, you see nothing here about a /home directory. Depending on the needs of your system and your users, you can elect to leave them in the / partition or put them in a separate partition. The recommendation is that they be put into a separate partition. This is so you will not lose your home data during a system upgrade.
Creating Boot Disks | Next Section

Account Sign In
View your cart