Preparing Your Hard Disk

To prepare your hard disk for installing Linux, you must allocate the space in which Linux will reside. You’ll learn how to do so in this section. First, you’ll learn how hard disks are organized; then you’ll learn how to view the structure of a hard disk. Finally, you’ll learn how to alter, or partition, the structure of your hard disk in preparing to install Red Hat Linux.

How Hard Disks Are Organized

Let’s start by reviewing facts you’ve probably learned by working with Windows. Most operating systems, including Windows 95/98, manage hard drives by dividing their storage space into units known as partitions. So that you can access a partition, Windows associates a drive letter (such as C: or D:) with it. Before you can store data on a partition, you must format it. Formatting a partition organizes the associated space into what is called a filesystem, which provides space for storing the names and attributes of files as well as the data they contain. Windows supports several types of filesystem, such as FAT and FAT32; a newer filesystem type that provides more efficient storage, launches programs faster, and supports very large hard drives.

Partitions comprise the logical structure of a disk drive, the way humans and most computer programs understand the structure. However, disk drives have an underlying physical structure that more closely resembles the actual structure of the hardware. Figure 2-7 shows the logical and physical structure of a disk drive.

The structure of a hard disk

Figure 2-7. The structure of a hard disk

Mechanically, a hard disk is constructed of platters that resemble the phonograph records found in an old-fashioned jukebox. Each platter is associated with a read/write head that works much like the read/write head on a VCR, encoding data as a series of electromagnetic pulses. As the platter spins, the heads record data in concentric rings known as tracks, which are numbered beginning with zero. A hard disk may have hundreds or thousands of tracks.

All the tracks with the same radius are known as a cylinder. Like tracks, cylinders are numbered beginning with zero. The number of platters and cylinders of a drive determines the drive’s geometry. Some PCs require you to specify the drive geometry in the BIOS setup. Most modern PCs autodetect the drive geometry but let you specify a custom value if you prefer.

Most operating systems prefer to read or write only part of a track, rather than an entire track. Consequently, tracks are divided into a series of sectors, each of which holds a fixed number of bytes, usually 512.

To correctly access a sector, a program needs to know the geometry of the drive. Because it’s sometimes inconvenient to specify the geometry of a drive, some PC BIOS programs let you specify logical block addressing (LBA). LBA sequentially numbers sectors, letting programs read or write to a specified sector without the burden of specifying a cylinder or head number.

Viewing Disk Partitions

The first step in preparing your hard disk is viewing its partition information. Once you know how your hard disk is organized, you’ll be able to determine how to reorganize it to accommodate Linux. To view the partitions that exist on your hard disk drives, you can use the fdisk utility:

  1. Click on the Windows Start menu. The Start pop-up menu appears.

  2. Select Programs. The Programs submenu appears.

  3. From the Programs submenu, click on MS-DOS Prompt. An MS-DOS Prompt window appears.

  4. Type fdisk and press Enter. The fdisk menu appears, as shown in Figure 2-8.

    The fdisk Options screen

    Figure 2-8. The fdisk Options screen

    Tip

    The fdisk menu may not appear immediately. Instead, Windows may ask if you want to enable large disk support; if this occurs, type N and press Enter. You don’t need to enable large disk support to view partition information.

  5. If your system has only one hard drive, you won’t see option 5, titled “Change current fixed disk drive.” If option 5 is available, type 5 and press Enter. This takes you to a screen, resembling the one shown in Figure 2-9, that lets you specify the current fixed disk drive.

    If option 5 is not available, type the number associated with the Display Partition Information option and press Enter. The screen will resemble the one shown in Figure 2-9, though its arrangement will be somewhat different.

    The fdisk “Change current fixed disk drive” screen

    Figure 2-9. The fdisk “Change current fixed disk drive” screen

    The screen shows each hard drive and its size, numbering the drives beginning with 1. If a drive contains free space not allocated to a partition, the screen shows the amount of space available. The screen also shows how much of the drive’s space has been allocated to partitions, as a percentage of the total drive space.

    Under the information describing a drive, the screen shows the size of each partition that resides on the drive. The screen also shows the associated drive letter, if any.

  6. When you’re done viewing partition information, press Esc twice to exit fdisk and return to the MS-DOS prompt. You can then close the MS-DOS Prompt window by clicking on the Close icon in the upper-right corner of the window or by typing exit and pressing Enter.

Obtaining Sufficient Disk Space

Red Hat Linux, as of the 7.2 release, no longer supports a partitionless installation,[2] which was an option in previous versions that allowed you to install Linux without dedicating a partition for it. This is a good thing, because Linux doesn’t run particularly fast or reliably in a partitionless mode.

This means that you will have to devote at least three partitions to Linux during the installation process. By viewing the partitions on your hard drive, you can determine which of the following two cases best describes your system:

  • You have available free (unpartitioned) disk space large enough to accommodate Linux (300 MB to 2.4 GB, depending on the type of installation you want and the number of packages you want to install).

    In this case, make a note of the drive that holds the free disk space. You can then begin the installation process described in Chapter 3. However, see the tip on PC BIOS limitations, later in this section.

  • You don’t have enough free (unpartitioned) disk space to accommodate Linux. If you don’t have sufficient disk space, you have several options:

    • If your system has room for an additional disk drive, you can install a new drive and use it to hold Linux. Section 2.4.3.1 offers some considerations and tips on installing a new drive. This is generally the best option, because it sidesteps problems arising due to PC BIOS limitations.

    • If you have one or more unused partitions, you can delete them and use the space you gain to hold Linux. Section 2.4.3.2 shows how to identify an unused partition.

    • If you have one or more partitions that are larger than needed, you can shrink them and use the space you gain to hold Linux. Section 2.4.3.3 shows you how to determine whether a partition is larger than needed and how to free the excess space.

Note

The BIOS of many PCs cannot access more than two hard drives and cannot access data on or beyond cylinder 1023 of a hard drive. In order to boot Linux, the installation program must create a 16 MB (or larger) boot partition (/boot) in an area accessible by the BIOS. If your available free space does not satisfy these criteria, you must obtain additional free space as described in the following sections.

Red Hat Linux supports LBA32, which can work around this problem, but many systems sold as supporting LBA32 do not actually do so. Moreover, enabling LBA32 support requires that you manually partition your system during installation. Therefore, you should partition your system as described to maximize the likelihood that it will work properly.

If you’re unsure whether your free space satisfies these criteria, simply begin the installation; the installation program will notify you if it is unable to proceed. In that case, you can return to this chapter to learn how to gain or add additional disk space.

Installing a new disk drive

Often, the easiest way to install Linux is to install a new disk drive. If your system has only a single hard drive, you can probably install a second drive and place Linux on the new drive. Before purchasing a drive, you should make sure that the system provides room to mount the new drive and that you have the proper data and power cables. Be sure to install both disk drives on the primary disk controller so they can be booted; if you have an IDE CD-ROM drive, you should move it to the secondary controller.

If your system already has two disk drives, you probably can’t simply add a third disk drive: the BIOS of most PCs let you boot the system from only the first or second hard drive on the primary controller. In such a case, you can probably replace one of your existing drives with a larger drive adequate to support your existing needs and Linux.

Identifying an unused partition

You can use the drive letter information provided by fdisk to examine the contents of a partition in Windows Explorer. If you can find a partition that holds no useful data but is large enough to accommodate the type of Linux installation you want, you can delete the partition and use the free space to hold Linux. At least 16 MB of the unused partition should reside within the first 1023 cylinders of the drive; otherwise, you will have to use a boot floppy to load Linux.

The easiest way to delete a partition is to use the Red Hat install utility. Make note of the partition you wish to delete in Table 2-1 and then begin the installation process described in Chapter 3.

Shrinking a partition

Even if all of your partitions contain useful data, one or more partitions may be larger than required. In that case, you can reduce the size of each such partition and reorganize the drive to include contiguous unused space to hold Linux. Again, at least 16 MB of the unused space should reside within the first 1023 cylinders of the disk drive; otherwise, you’ll have to use a boot floppy to load Linux.

You can use the Windows Explorer to determine the amount of free disk space in a partition. To do this, right-click on the drive icon and click on Properties in the pop-up menu. The Properties dialog box shows the amount of used and free disk space associated with the drive.

If you are able to find one or more partitions that have sufficient free space for a Linux installation, you can use a special utility to split the used and unused portions of a partition into separate partitions. Disc 1 of Red Hat Linux includes the fips utility, which can split FAT and FAT32 partitions. For information on using fips, see the documentation in the dosutils directory of the CD-ROM.

Warning

If you make a mistake while attempting to shrink a partition, or if the software malfunctions, you may lose all data in one or more partitions. You should not attempt to shrink a partition until you’ve completely backed up your system and made sure that your backup is usable.

Many Linux users find PowerQuest’s PartitionMagic utility helpful. Unlike fips, PartitionMagic is commercial software; however, it is relatively inexpensive (approximately $60 to $70) and supports partition types and operations not supported by fips. For example, PartitionMagic can split NTFS, HPFS, and Linux ext2 partitions. This is important, because you may not initially create Linux partitions of exactly the right size. Using fips, you’d be stuck, but using PartitionMagic, you can change your system’s partition structure as many times as you like until you get it just right. For information on PartitionMagic, see the PowerQuest web site at http://www.powerquest.com/partitionmagic.

Tip

Use of PartitionMagic is beyond the scope of this book. I mention it here because I feel that—although it isn’t free—PartitionMagic is a valuable, timesaving tool for partitioning your hard drive. Instructions on how to install and use PartitionMagic are included with PartitionMagic.



[2] However, according to the release notes for Red Hat Linux 7.2, only upgrades to previous partitionless installations are still supported.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.151.153