Installation Overview - Installing Fedora and Red Hat Enterprise Linux - A practical guide to Fedora and Red Hat Enterprise Linux, 7th Edition (2014)

A practical guide to Fedora and Red Hat Enterprise Linux, 7th Edition (2014)

Part I: Installing Fedora and Red Hat Enterprise Linux

Chapter 2 Installation Overview

Chapter 3 Step-by-Step Installation

Chapter 2. Welcome to Linux

In This Chapter

Conventions Used in This Book

LPI and CompTIA Certification Icons

More Information

Planning the Installation

Fedora Standard Editions: The Live, Install, and Network Images

Setting Up the Hard Disk

LVM: Logical Volume Manager

The Installation Process

Downloading an Installation Image File and Writing to/Burning the Installation Medium

The Easy Way to Download an Installation Image File

Using BitTorrent

Gathering Information About the System


Objectives

After reading this chapter you should be able to:

Image Choose the best distribution and version to meet your needs

Image Download the Live or Install Image (ISO) file

Image Burn/write the Live or Install Image to the installation medium (a DVD or USB flash drive)

Image Use a live session to test hardware and check system requirements

Image List considerations of disk partitioning

Image Describe the advantages and disadvantages of software RAID and LVM partitioning schemes

Installing Linux is the process of copying operating system files from an installation medium (e.g., DVD, USB flash drive) or the network to hard disk(s) on a system and setting up configuration files so Linux runs properly on the hardware.

This chapter discusses the installation process in general: planning, partitioning the hard disk, obtaining the files for the installation, burning or writing an installation medium, and collecting information about the hardware that might be helpful for installation and administration. Chapter 3covers the process of installing Linux.

Anaconda

Anaconda is a user-friendly tool that installs Fedora/RHEL. For standard hardware (any hardware you can install Windows on), you can typically insert an installation medium holding a Live or Install Image and boot the system. After you go through a few screens, you are done. Of course, sometimes you might want to customize the system or you might be installing on nonstandard hardware: Anaconda presents you with choices that allow you to control the installation. Refer to “Installing Fedora/RHEL” (page 59) and “Installation Tasks” (page 69) for information about installing and customizing Fedora/RHEL.


Tip: Upgrading a Fedora System

The new Anaconda installer will not upgrade a Fedora system from one release to the next. You must use FedUp (FEDora UPgrader), which works on Fedora 17 and later. Visit the Fedora Web page at fedoraproject.org/wiki/FedUp for more information.


Conventions Used in This Book

This book uses conventions to make its explanations shorter and clearer. The following paragraphs describe these conventions.

Text and examples

The text is set in this type, whereas examples are shown in a monospaced font (also called a fixed-width font):

$ cat practice
This is a small file I created
using a text editor.

Items you enter

Everything you enter at the keyboard is shown in a bold typeface. Within the text, this bold typeface is used; within examples and screens, this one is used. In the previous example, the dollar sign ($) on the first line is a prompt that Linux displays, so it is not bold; the remainder of the first line is entered by a user, so it is bold.

Utility names

Names of utilities are printed in this sans serif typeface. This book references the nano text editor and the ls utility or ls command (or just ls) but instructs you to enter ls –a on the command line. In this way the text distinguishes between utilities, which are programs, and the instructions you enter on the command line to invoke the utilities.

Filenames

Filenames appear in a bold typeface. Examples are memo5, letter.1283, and reports. Filenames might include uppercase and lowercase letters; however, Linux is case sensitive (page 1241), so memo5, MEMO5, and Memo5 name three different files.

Character strings

Within the text, characters and character strings are marked by putting them in a bold typeface. This convention avoids the need for quotation marks or other delimiters before and after a string. An example is the following string, which is displayed by the passwd utility: Sorry, passwords do not match.

Keys and characters

This book uses SMALL CAPS for three kinds of items:

• Keyboard keys, such as the SPACE bar and the RETURN,1 ESCAPE, and TAB keys.

1. Different keyboards use different keys to move the cursor (page 1245) to the beginning of the next line. This book always refers to the key that ends a line as the RETURN key. The keyboard you are using might have a RET, NEWLINE, ENTER, RETURN, or some other key. Use the corresponding key on your keyboard each time this book asks you to press RETURN.

• The characters that keys generate, such as the SPACEs generated by the SPACE bar.

• Keyboard keys that you press simultaneously with the CONTROL key, such as CONTROL-D. (Even though D is shown as an uppercase letter, you do not have to press the SHIFT key; enter CONTROL-D by holding the CONTROL key down and pressing d.)

Prompts and RETURNs

Most examples include the shell prompt—the signal that Linux is waiting for a command—as a dollar sign ($), a hashmark (#), or sometimes a percent sign (%). The prompt does not appear in a bold typeface in this book because you do not enter it. Do not type the prompt on the keyboard when you are experimenting with examples from this book. If you do, the examples will not work.

Examples omit the RETURN keystroke that you must use to execute them. An example of a command line is

$ nano memo.1204

To use this example as a model for running the nano text editor, enter the command nano memo.1204 and press the RETURN key. (See page 270 for a nano tutorial.) This method of displaying commands makes the examples in the book correspond to what appears on the screen.

Definitions

All glossary entries marked with FOLDOC are courtesy of Denis Howe, editor of the Free Online Dictionary of Computing (foldoc.org), and are used with permission. This site is an ongoing work containing definitions, anecdotes, and trivia.


Optional

Passages marked as optional appear in a gray box. This material is not central to the ideas presented in the chapter and often involves more challenging concepts. A good strategy when reading a chapter is to skip the optional sections and then return to them when you are comfortable with the main ideas presented in the chapter. This is an optional paragraph.


URLs (Web addresses)

Web addresses, or URLs, have an implicit http:// prefix, unless ftp:// or https:// is shown. You do not normally need to specify a prefix when the prefix is http://, but you must use a prefix in a browser when you specify an FTP or secure HTTP site. Thus you can specify a URL in a browser exactly as it is shown in this book.

ls output

This book uses the output of ls –l commands as produced by including the option ––time-style=iso. This option produces shorter lines, making the examples more readable.

Tip, caution, and security boxes

The following boxes highlight information that might be helpful while you are using or administrating a Linux system.


Tip: This is a tip box

A tip box might help you avoid repeating a common mistake or might point toward additional information.



Caution: This box warns you about something

A caution box warns you about a potential pitfall.



Security: This box marks a security note

A security box highlights a potential security issue. These notes are usually intended for system administrators, but some apply to all users.


LPI and CompTIA Certification Icons

This book is used as the adopted text in many college classes. Because students who take these classes often seek LPI or CompTIA certification, instructors have asked for a mapping of certification objectives to the material covered in this book. This book fully covers LPI’s Linux Essentials certification learning goals and provides extensive coverage of CompTIA’s Linux+ exam objectives. Appendix E maps these learning goals and exam objectives to pages in this book. The following icons are used throughout the book to mark the places where learning goals and exam objectives are discussed.

Image

This icon indicates coverage of a topic in the CompTIA’s Linux+ exam objectives.

Image

This icon indicates coverage of a topic in the LPI’s Linux Essentials certification learning goals.

Image

This icon indicates coverage of a topic in the CompTIA’s Linux+ exam objectives and a topic in the LPI’s Linux Essentials certification learning goals.

More Information

In addition to the following references, see “Getting Help from the Command Line” on page 128 and refer to Appendix B for additional resources.

Web

memtest86+: www.memtest.org

Partition HOWTO: tldp.org/HOWTO/Partition (dated)

Partition: www.linfo.org/partition.html

LVM Resource Page (includes many links): sourceware.org/lvm2

LVM HOWTO: www.tldp.org/HOWTO/LVM-HOWTO (dated)

Transmission BitTorrent client: www.transmissionbt.com

X.org release information: x.org/wiki

Distributions: distrowatch.com

Writing ISO image file to a USB flash drive (Windows and Linux): fedorahosted.org/ liveusb-creator (liveusb-creator package) and unetbootin.sourceforge.net (unetbootin package)

Hardware compatibility: hardware.redhat.com

RHEL versions: www.redhat.com/products/enterprise-linux/server/compare.html

Upgrading: fedoraproject.org/wiki/FedUp

Verifying downloaded ISO image files (Linux and Windows): fedoraproject.org/en/verify

Release notes: docs.fedoraproject.org/en-US/Fedora/19/html/Release_Notes

Swap space: docs.fedoraproject.org/en-US/Fedora/13/html/Installation_Guide/s2-diskpartrecommend-x86.html

Burning a DVD or writing to a USB flash drive: docs.fedoraproject.org/en-US/Fedora/19/html/Installation_Guide/sn-making-media.html

Installing from a USB flash drive: docs.fedoraproject.org/en-US/Fedora/19/html/Installation_Guide/Making_USB_Media.html

RAID: raid.wiki.kernel.org/index.php/Linux_Raid

PXE: www.kegel.com/linux/pxe.html

Download Fedora/RHEL

Easiest download: fedoraproject.org/get-fedora

Downloads: fedoraproject.org/en/get-fedora-all

Torrents: torrent.fedoraproject.org

Fedora and EPEL Mirrors: mirrors.fedoraproject.org/publiclist

Everything: dl.fedoraproject.org/pub

RHEL extra packages: fedoraproject.org/wiki/EPEL

Spins: spins.fedoraproject.org

Image Planning the Installation

The major decision when planning an installation is determining how to divide the hard disk into partitions or, in the case of a dual-boot system, where to put the Linux partitions. Once you have installed the system, you can decide which software packages you want to add to the base system (or whether you want to remove some). In addition to these topics, this section discusses hardware requirements.

Considerations

SELinux

SELinux (Security-Enhanced Linux) improves system security by implementing mandatory access control policies in the kernel (page 472). By default, Fedora installs SELinux in Enforcing mode, which implements best practice security policies. Although you can put SELinux in Permissive or Disabled mode before or after you install the system, it is not a good idea to do so because SELinux protects the system. See page 472 for more information on SELinux. See the noselinx boot parameter (page 72) if you want to turn off SELinux when you install the system.

GUI

Server systems can save resources by not including a GUI. On other systems a GUI gives you the benefit of a desktop with multiple workspaces that can include many windows. Fedora/RHEL installs GNOME by default.

Software and services

As you install more software packages on a system, the number of updates and the interactions between the packages increase. More software packages make the system more vulnerable by increasing the number of ways the system can be attacked. Including additional services can also slow the system down. It is important to monitor installed software for security updates.

For a more secure production system, it is best to install and maintain the minimum number of packages required and to enable only needed services. See page 438 for information on the systemd Fedora init daemon, which starts and stops system services.

Disk encryption

Another security precaution is disk encryption. Encrypting the hard disk when you install Linux is easy and can prevent theft of sensitive data, especially on laptops, which are prone to theft. Typically the cost of encryption is a fraction of the cost of the damage that can be done when sensitive data is disclosed. However, it is important to remember the password you use to encrypt the disk as there is no (economical) way to recover the information on an encrypted disk without it. You can encrypt a partition during installation (see “Installation Options” on page 73). Also, Truecrypt (www.truecrypt.org) provides excellent encryption software.

Image Requirements

Hardware

This chapter and Chapter 3 cover installing the operating system on 64-bit processor architectures such as AMD64 processors and Intel processors with Intel EM64T technology as well as older 32-bit Intel and compatible processor architectures (including AMD processors). Within these processor architectures, Fedora/RHEL runs on much of the available hardware. You can view a list of compatible and supported hardware at hardware.redhat.com. Although these lists pertain to RHEL, they serve as a good guide to what Fedora will run on. The Fedora release notes also provide hardware information.

Many Internet sites discuss Linux hardware; use Google to search for linux hardware, fedora hardware, or linux and the specific hardware you want more information on (for example, linux sata or linux a8n). In addition, many HOWTOs cover specific hardware. The Linux Hardware Compatibility HOWTO is also available, although it might not be up-to-date at the time you read it. Fedora/RHEL usually runs on the same systems Windows runs on, unless the system includes a very new or unusual component.

If you are installing Fedora on old or minimal hardware and want to run a GUI, consider installing LXDE (page 118), as it provides a lightweight desktop that uses system resources more efficiently than GNOME does.

CPU (processor)

At a minimum, Fedora requires an Intel Pentium Pro processor; it is optimized for i686 and newer processors. Minimum recommended processor speed for a textual system is 500-700 megahertz and for a graphical system is 1 gigahertz. Visit www.redhat.com/products/enterprise-linux/server/compare.html for information on RHEL systems.

RAM (memory)

Memory requirements are the same for 32-bit and 64-bit Fedora systems. At a minimum, a textual (command-line) system requires 512 megabytes of RAM and a graphical (desktop) system requires 1 gigabyte of RAM. In some cases you can get by with less RAM for a very minimal textual installation. Running a live session (from a Live Image) requires a minimum of 1 gigabyte of RAM. Visit www.redhat.com/rhel/compare for information on RHEL systems.

Linux makes good use of extra memory: The more memory a system has, the faster it runs. Adding memory is one of the most cost-effective ways you can speed up a Linux system that is not being slowed down by the CPU.

Hard disk space

The amount of hard disk space a system requires depends on which edition of Fedora/RHEL you install, which packages you install, how many languages you install, and how much space you need for user data (your files). The Fedora operating system typically requires 10 gigabytes, although a minimal system can make do with much less space. User data requires additional space. Leave at least 5 percent of the disk empty for proper filesystem operation. See www.redhat.com/rhel/compare for information on RHEL systems.

Image BIOS setup

Modern computers can be set up to boot from a DVD, hard disk, or USB flash drive. The BIOS determines the order in which the system tries to boot from each device. You might need to change this order: Make sure the BIOS is set up to try booting from the DVD or USB drive before it tries to boot from the hard disk. Also, if you want to run virtual machines (Chapter 17) on the system, you may need to enable virtualization in the BIOS. See page 590 for more information on the BIOS.

Image CMOS

CMOS is the persistent memory that stores hardware configuration information. To change the BIOS setup, you need to edit the information stored in CMOS. When the system boots, it displays a brief message about how to enter System Setup or CMOS Setup mode. Press the key that is called for and then move the cursor to the screen and line that deal with booting the system. Generally there is a list of three or four devices that the system tries to boot from; if the first attempt fails, the system tries the second device, and so on. Manipulate the list so the DVD or USB flash drive is the first choice, save the list, and reboot. Refer to the hardware/BIOS manual for more information.

Image Processor Architecture

Installation media hold programs compiled to run on a specific processor architecture (class of processors, or CPUs). The following list describes each of the architectures Fedora/RHEL is compiled for. Visit docs.fedoraproject.org/ en-US/Fedora/19/html/Installation_Guide/ch-new-users.html#sn-which-arch for a detailed list of processors in each architecture. Because Linux source code is available to everyone, a knowledgeable user can compile Fedora/RHEL to run on other processor architectures (Chapter 14).

i386/i686 (Intel x86)

Software on Fedora/RHEL 32-bit PC installation media is compiled to run on Intel x86-compatible processors, including most machines with Intel and AMD processors, almost all machines that run Microsoft Windows, and newer Apple Macintosh machines that use Intel processors. The N200 and Z Series Atom processors are also based on this architecture. If you are not sure which type of processor a machine has, assume it has this type of processor.

x86_64 (AMD64 and Intel EM64T)

Software on Fedora/RHEL 64-bit PC installation media is compiled to run on AMD64 processors, including the Athlon64, Opteron, and Intel 64-bit processors that incorporate EM64T technology, such as the EMT64 Xeon. The N Series Atom processors (other than the N200) are also based on this architecture.

Mac PowerPC (ppc)

The Fedora/RHEL PPC release runs on the Apple Macintosh G3, G4, G5, PowerBook, and PPC-based Macintoshes.


Tip: Should I install 32-bit or 64-bit Linux on a 64-bit–capable processor?

The following information might help you decide whether to install 32-bit or 64-bit Linux on a 64-bit–capable processor.

• EM64T/AMD64 processors can run either version of Linux equally well.

• A 64-bit distribution allows each process to address more than 4 gigabytes of RAM. Larger address space is the biggest advantage of a 64-bit distribution. It is typically useful only for certain engineering/scientific computational work and when you are running multiple virtual machines.

• A 64-bit processor is not faster than a 32-bit processor in general; most benchmarks show more or less similar performance. In some cases the performance is better and in some cases it is worse: There is no clear performance advantage for either type of processor.

• The memory model for 64-bit Linux makes pointers twice as big as those in 32-bit Linux. This size difference translates to a more than 5 percent RAM usage increase, depending on the application. If a system is low on RAM, this overhead might make performance worse on a 64-bit system.

• ASLR (address space layout randomization) works better with the larger address space provided by a 64-bit system. ASLR can help improve system security. See en.wikipedia.org/wiki/Address_space_layout_randomization.

• Some multimedia encoders run 10–30 percent faster under 64-bit Linux.

• Some features of proprietary third-party applications are not available for 64-bit architecture.

• A 64-bit Linux system can run 32-bit applications but a 32-bit Linux system cannot run 64-bit applications.

• There is no simple way to go back and forth between 32-bit and 64-bit versions without reinstalling Linux.

• If you are not sure which version to use, install the 64-bit version.


Image Interfaces: Installer and Installed System

When you install Fedora/RHEL, you have a choice of interfaces to use while you install it (to work with the Anaconda installer). You also have a choice of interfaces to use to work with the installed system. This section describes the two basic interfaces: textual and graphical.

Textual (TUI/CLI)

A TUI (textual user interface), also called a CLI (command-line interface) or character-based interface, displays characters and some simple graphical symbols. It is line oriented; you give it instructions using a keyboard only.

Graphical (GUI)

A GUI (graphical user interface) typically displays a desktop (such as GNOME) and windows; you give it instructions using a mouse and keyboard. You can run a textual interface within a GUI by opening a terminal emulator window (page 120). A GUI uses more computer resources (CPU time and memory) than a textual interface does.

Pseudographical

A pseudographical interface is a textual interface that takes advantage of graphical elements on a text-based display device such as a terminal. It might also use color. This interface uses text elements, including simple graphical symbols, to draw rudimentary boxes that emulate GUI windows and buttons. Frequently, pressing the TAB key moves the cursor (highlight) from one element to the next, and pressing the RETURN key selects the element the cursor is on.

Advantages

A GUI is user friendly, whereas the textual interface is compact, uses fewer system resources, and can work on a text-only terminal or over a text-only connection. Because it is more efficient, a textual interface is useful for older, slower systems and systems with minimal amounts of RAM. Server systems frequently use a textual interface because it allows the system to dedicate more resources to carrying out the job it is set up to do and fewer resources to pleasing the system administrator. Not running a GUI can also improve system security.

Fedora, RHEL, and CentOS

This book describes two products: Fedora and RHEL (Red Hat Enterprise Linux). This section briefly describes these products.

Fedora

The Fedora Project is sponsored by Red Hat and supported by the open-source community. With releases, called Fedora, coming out about every six months, this Linux distribution incorporates cutting-edge code. It is not a supported Red Hat product and is not recommended for production environments where the set of software packages and features must remain constant over a longer period of time. Fedora aims to reflect the upstream projects it incorporates, including the kernel. It is widely regarded as the most stable “free” Linux distribution. In contrast, RHEL includes many changes introduced by Fedora.

The Fedora Project distributes a new release of Fedora about every six months. Each release has both a number and a name. For example, Fedora 18 is named Spherical Cow and Fedora 19 is named Schrödinger’s Cat. Previous versions were named Lovelock (15), Verne (16), and Beefy Miracle (17). See fedoraproject.org/wiki/History_of_Fedora_release_names for a description of how names are chosen.

RHEL

RHEL is typically sold through an annual subscription that includes technical support. It is more stable but less cutting edge than Fedora. RHEL provides 10 years of updates; Fedora provides 13 months.

Red Hat Enterprise Linux comes in several configurations; for more information see www.redhat.com/wapps/store/catalog.html. For more information on the various versions of RHEL, see www.redhat.com/rhel/compare.

Red Hat distributes a new major release of RHEL every few years. For information on the RHEL life cycle, see access.redhat.com/support/policy/updates/errata.

Image CentOS

CentOS (www.centos.org) is a free, RHEL-compatible Linux distribution. It has more long-term stability than Fedora but, unlike RHEL, CentOS is unsupported. Because CentOS is RHEL compatible, this book also describes CentOS. CentOS releases generally follow RHEL releases.

Fedora Standard Editions: The Live, Install, and Network Images

Standard editions of Fedora are compiled for i386 (32-bit) and x86_64 (64-bit) architectures and are available via BitTorrent, direct download, and mirrors. To download a standard edition visit fedoraproject.org/en/get-fedora-all.


Tip: Terminology: CD, DVD, installation medium, and installation image

Fedora is available in three editions: Fedora Desktop Live Media, Fedora DVD, and Fedora Network Install CD. The DVD and CD in the names of the editions are conventional and have nothing to do with the media the edition is available on. Each of these editions is available as an installation (ISO) image file that can be written to a CD, DVD, USB flash drive, or other media of appropriate size (the installation medium). This book uses the term installation image to refer to the installation (ISO) image file as it exists on any medium. It does not refer specifically to CDs, DVDs, or USB flash drives unless it is necessary in context.


Live Image live session

This book refers to the Fedora Desktop Live Media as a Live Image. A Live Image runs a live session: It runs Fedora without installing it on the hard disk, although you can install a basic Fedora system from a live session. Once installed, you can use an Internet connection to add more software packages to the system.

To boot from a Live Image, make sure the computer is set up to boot from a DVD or USB drive; see “BIOS setup” and “CMOS,” both on page 31, for more information. Booting from a Live Image displays a GNOME desktop (or a KDE desktop if you boot from a KDE Live Image): You are running a live session. When you exit from the live session, the system returns to the state it was in before you booted from the Live Image. If the system has a Linux swap partition (most Linux systems have one; see page 40), the live session uses it to improve its performance but does not otherwise write to the hard disk. RHEL does not provide a Live Image.

Running a live session is a good way to test hardware and fix a system that will not boot from the hard disk. A live session is ideal for people who are new to Fedora or Linux and want to experiment with Fedora or different desktops but are not ready to install it on their system.


Tip: Saving files during a live session

You cannot save a file to a DVD holding a Live Image as this is a readonly medium. During a live session, even though you might appear to save a file, it will not be there after you exit from the live session. To save data from a live session, save it to a network share or a USB flash drive, or mail it to yourself. Alternately, you can boot from a Live USB flash drive with persistent storage. You can create such a USB drive using liveusb-creator (page 50). For more information see fedoraproject.org/wiki/How_to_create_and_use_Live_USB.



Tip: An Install Image uses less memory than a Live Image

Installing a Fedora system using the Install Image uses less memory (RAM) than installing a system using the Live Image. If you are having problems installing from a Live Image on an older system, try installing from an Install Image.


Install Image

This book refers to the Fedora DVD (not necessarily burned on a DVD), also called the Install Media, as an Install Image. Hardcopy versions of this book include an Install Image recorded on a DVD. An Install Image does not display a desktop before starting the Anaconda installer.

When you boot from an Install Image, it displays a menu that allows you to install Fedora/RHEL. You can install a graphical or textual system using a graphical or textual installer from an Install Image. An Install Image gives you more choices when you install Fedora than does a Live Image. Also, an Install Image allows you to boot a minimal textual system that you can use to rescue a previously installed system (select Rescue a Fedora system from the Troubleshooting menu; page 62). You can also rescue an installed system using the Network Image.

Network Image

The Network Image contains only the Anaconda installer environment. It displays the same menu as an Install Image. By default it downloads software packages from public repositories. This image is useful for creating systems that are up-to-date on the first boot and when the repository is mirrored locally and only the installation environment is required.

Fedora Spins

In addition to the standard editions, Fedora releases many alternative editions called spins (spins.fedoraproject.org). Following is a list of some of the most popular spins. You can install a system based on a spin or you can install the spin as an afterthought. See “Installing Different Desktop Environments” on page 118 for installation instructions.

• KDE—(K Desktop Environment; kde.org) A complete, modern desktop built using the KDE Plasma Desktop; also available as a Live Image; a popular alternative to GNOME

• LXDE—(Lightweight X11 Desktop Environment; lxde.org) A speedy, energy-saving desktop environment that works well with systems with slower hardware and fewer resources such as older computers, netbooks, and mobile devices

• XFCE—(www.xfce.org) A speedy, lightweight, user-friendly desktop environment that loads and executes applications quickly, and treads lightly on system resources; also available for RHEL via the EPEL repository

• MATE—(mate-desktop.org) A fork of GNOME 2 providing an intuitive and attractive desktop using traditional metaphors

• FSL—(Fedora Security Lab) An environment in which you can work on security auditing, forensics, system rescue, and teaching security testing methodologies

Image Setting Up the Hard Disk

Free space

A hard disk must be prepared in several ways so Linux can write to and read from it. Low-level formatting is the first step in preparing a disk for use. You do not need to perform this task, as it is done at the factory where the hard disk is manufactured. The next steps in preparing a hard disk for use are to write a partition table to it and to create partitions on the disk. Finally, you need to create a filesystem on each partition. The area of a partitioned disk that is not occupied by partitions is called free space. A new disk has no partition table, no partitions, and no free space. Under Windows, the term formatting means creating a filesystem on a partition; see “Filesystems” below.


Caution: Free space versus free space

The preceding paragraph defines the term free space to be the area of a partitioned disk that is not occupied by partitions. During installation, the Anaconda installer uses free space to refer to unpartitioned space only. Thus, Anaconda includes an empty disk when it figures out how much “free space” is available for the installation.


Image Partitions

A partition, or slice, is a logical section of a hard disk that has a device name, such as /dev/sda1, so you can refer to it separately from other sections. For normal use, you must create at least one partition on a hard disk. From a live session before you install Fedora/RHEL, you can usegnome-disks, the GNOME Disk Utility (page 78), to view, resize, and create partitions on an existing system. During installation, you can use the Anaconda graphical partition editor (page 72) to create partitions. After installation, you can use gnome-disks (page 78), parted (page 614), orfdisk to manipulate partitions. See /dev on page 503 for more information on device names. Visit www.linfo.org/partition.html for an excellent discussion of partitions.

Image Partition table

A partition table holds information about the partitions on a hard disk. Before the first partition can be created on a disk, the program creating the partition must set up an empty partition table on the disk. As partitions are added, removed, and modified, information about these changes is recorded in the partition table. If you remove the partition table, you can no longer access information on the disk except by extraordinary means.

LVM

By default, the Anaconda installer sets up LVs (logical volumes) that function like partitions. With LVs, you can use LVM (the Logical Volume Manager; page 44) to change the sizes of volumes easily after the system is installed. Using LVM to manipulate LVs is more convenient than working with one of the tools that manipulates partitions.

Filesystems

Before most programs can write to a partition, a data structure (page 1245), called a filesystem, needs to be written to the partition. This data structure holds inodes (page 515) that map locations on the disk that store files to the names of the files. At the top of the data structure is a single unnamed directory. As will be explained shortly, this directory joins the system directory structure when the filesystem is mounted.

When the Anaconda installer creates a partition, it automatically writes a filesystem to the partition. You can use the mkfs (make filesystem; page 467) utility, which is similar to the Windows format utility, to manually create a filesystem on a partition. Table 11-1 on page 519 lists some common types of filesystems. Fedora/RHEL typically creates ext4 filesystems for data; unless you have reason to use another filesystem type, use ext4. Windows uses FAT16, FAT32, and NTFS filesystems. OS X uses either HFS+ (Hierarchical Filesystem+) or UFS. Different types of filesystems can coexist in different partitions on a single hard disk, including Windows, OS X, and Linux filesystems.

Image Primary, Extended, and Logical Partitions

You can divide an IDE/ATA/SATA disk into a maximum of 63 partitions and a SCSI disk into a maximum of 15 partitions. You can use each partition independently for swap devices, filesystems, databases, other resources, and even other operating systems.

Primary and extended partitions

Unfortunately, disk partitions follow the template established for DOS machines a long time ago. At most, a disk can hold four primary partitions. You can divide one (and only one) of these primary partitions into multiple logical partitions; this divided primary partition is called an extended partition. If you want more than four partitions on a drive—and you frequently do—you must set up an extended partition. LVM largely solves this problem by allowing you to make as many filesystems as you want within one “partition” in a much more elegant way than with extended partitions.

A typical disk is divided into three primary partitions (frequently numbered 1, 2, and 3) and one extended partition (frequently numbered 4). The three primary partitions are the sizes you want the final partitions to be. The extended partition occupies the rest of the disk. Once you establish the extended partition, you can subdivide it into additional logical partitions (numbered 5 or greater), each of which is the size you want. You cannot use the extended partition (number 4)—only the logical partitions it holds. Figure 15-3 on page 615 illustrates the disk described in this paragraph. See the Linux Partition HOWTO (tldp.org/HOWTO/Partition) for more information.

The Linux Directory Hierarchy


Tip: Skip this section for a basic installation

This section describes the Linux directory hierarchy so you might better understand some of the decisions you need to make when you divide the hard disk into partitions while installing Linux. You do not have to read this section to install Linux. You can use the default installation destination (page 67) to set up the disk and return to this section when and if you want to. See the beginning of Chapter 6 for a more thorough explanation of the Linux directory hierarchy.


Namespace

A namespace is a set of names (identifiers) in which each name is unique.

Windows versus Linux

As differentiated from a Windows machine, a Linux system presents a single namespace that holds all files, including directories, on the local system. The Linux system namespace is called the directory hierarchy or directory tree. Under Windows, C:\ is a separate namespace from D:\. The directory hierarchy rooted at C:\ is separate from the directory hierarchy rooted at D:\ and there is no path or connection between them. Under Linux, the single system namespace is rooted at /, which is the root directory. Under the root directory are top-level subdirectories such as bin, boot,etc, home, and usr.

Absolute pathnames

All files on a Linux system, including directories, have a unique identifier called an absolute pathname. An absolute pathname traces a path through the directory hierarchy starting at the root directory and ending at the file or directory identified by the pathname. Thus the absolute pathname of the top-level directory named home is /home. For more information refer to “Absolute Pathnames” on page 181. Relative pathnames are discussed on page 182.

Slashes (/) in pathnames

Within a pathname, a slash (/) follows (appears to the right of) the name of a directory. Thus /home/sam specifies that the ordinary or directory file named sam is located in the directory named home, which is a subdirectory of the root directory (/). The pathname /home/sam/ (with a trailing slash) explicitly specifies sam is a directory file. In most instances this distinction is not important. The root directory is implied when a slash appears at the left end of a pathname or when it stands alone.

Linux filesystem namespace

The Linux filesystem namespace comprises the set of absolute pathnames of all files, including directories, in the directory hierarchy of a system.

Image Mount Points

A filesystem on a partition holds no information about where it will be mounted in the directory hierarchy (the top-level directory of a filesystem does not have a name). When you use Anaconda to create most partitions, you specify the type of filesystem to be written to the partition and the name of a directory that Fedora/RHEL associates with the partition.

Mounting a filesystem associates the filesystem with a directory in the directory hierarchy. You can mount a filesystem on any directory in the directory hierarchy. The directory that you mount a filesystem on is called a mount point. The directory you specify when you use Anaconda to create a partition is the mount point for the partition. Most mount points are top-level subdirectories, with a few exceptions (such as /usr/local, which is frequently used as a mount point).

For example, suppose the second partition on the first hard disk has the device name /dev/sda2. To create an ext4 filesystem that you want to appear as /home in the directory hierarchy, you must instruct Linux to mount the /dev/sda2 partition on /home when the system boots. With this filesystem mounted on its normal mount point, you can access it as the /home directory.


Caution: Do not create files on mount points before mounting a filesystem

Do not put files in a directory that is a mount point while a filesystem is not mounted on that mount point. Any files in a directory that is used as a mount point are hidden while the filesystem is mounted on that directory; you will not be able to access them. They reappear when the filesystem is unmounted.


Filesystem independence

The state of one filesystem does not affect other filesystems: One filesystem on a drive might be corrupt and unreadable, while other filesystems function normally. One filesystem might be full so you cannot write to it, whereas others have plenty of room for more data.

/etc/fstab

The file that holds the information relating partitions to mount points is /etc/fstab (filesystem table; page 524). The associations stored in the fstab file are the normal ones for the system, but you can easily override them. When you work in recovery mode, you might mount a filesystem on the /target directory so you can repair the filesystem. For example, if you mount on /target the partition holding the filesystem normally mounted on /home, the directory you would normally find at /home/sam will be located at /target/sam.

Naming partitions and filesystems

A partition and any filesystem it holds have no name or identification other than a device name (and a related UUID value—see page 524). Instead, the partition and the filesystem are frequently referred to by the name of the partition’s normal mount point. Thus “the /home partition” and “the/home filesystem” refer to the partition that holds the filesystem normally mounted on the /home directory. See page 520 for more information on mounting filesystems.

Partitioning a Disk

During installation, Anaconda sets up disk partitions. This section discusses how to plan partition sizes. Although this section uses the term partition, planning and sizing LVs (logical volumes; page 44) works the same way. For more information refer to page 72 and to the Linux Partition HOWTO at www.tldp.org/HOWTO/Partition.

Image Default Partitioning

It can be difficult to plan partition sizes appropriately if you are not familiar with Linux. During installation, Fedora/RHEL provides default partitioning. Without asking any questions, default partitioning divides the portion of the disk allotted to Fedora/RHEL into three or four partitions. One partition is a small /boot partition, and one is the swap partition that can be any size from 512 megabytes to 2 or more gigabytes. Another partition is designated as / (root) and occupies up to about 50 gigabytes. If enough disk space is available, default partitioning creates a partition designated as /home. This partition takes up the remainder of the disk space. The next section discusses the advantages of manual partitioning.


Tip: GiB versus GB

Historically a gigabyte (GB) meant either 230 (1,073,741,824) or 109 (1,000,000,000) bytes. Recently the term gibibyte (giga binary byte; abbreviated as GiB) has been used to mean 230 bytes; in turn, gigabyte is used more frequently to mean 109 bytes. Similarly, a mebibyte(MiB) is 220 (1,048,576) bytes. The Fedora/RHEL partitioner still uses megabytes and gigabytes for specifying the size of partitions.


Image Manual Partitioning: Planning Partitions

This section discusses additional partitions you might want to create. Consider setting up LVM (page 44) before you create partitions; LVM allows you to change partition sizes easily after the system is installed. By default the Anaconda installer sets up LVM. If you decide to manually partition the hard disk and set up partitions other than a root partition (/), a swap partition, and possibly a /home partition, first consider which kinds of activities will occur under each top-level subdirectory. Then decide whether it is appropriate to isolate that subdirectory by creating a filesystem in a partition and mounting it on its own mount point. Advantages of creating additional filesystems include:

• Separating data that changes frequently (e.g., /var and /home) from data that rarely changes (e.g., /usr and /boot) can reduce fragmentation on the less frequently changing filesystems, helping to maintain optimal system performance.

• Isolating filesystems (e.g., /home) can preserve data when you reinstall Linux.

• Additional filesystems can simplify backing up data on a system.

• If all directories are part of a single filesystem, and if a program then runs amok or the system is the target of a DoS attack (page 1248), the entire disk can fill up. System accounting and logging information, which might contain data that can tell you what went wrong, might be lost. On a system with multiple filesystems, such problems typically fill a single filesystem and do not affect other filesystems. Data that might help determine what went wrong will likely be preserved and the system is less likely to crash.

Image / (root)

The following paragraphs discuss the advantages of making each of the major top-level subdirectories a separate, mountable filesystem. Any directories you do not create filesystems for automatically become part of the root (/) filesystem. For example, if you do not create a /home filesystem,/home is part of the root (/) filesystem.

Image (swap)

Linux temporarily stores programs and data on a swap partition when it does not have enough RAM to hold all the information it is processing. The swap partition is also used when a system hibernates (is suspended to disk). The size of the swap partition should be at least 2 gigabytes for systems with up to 4 gigabytes of RAM, 4 gigabytes for 4–16 gigabytes of RAM, and 8 gigabytes for 16–64 gigabytes of RAM. Take into account the fact that the worst-case hibernation scenario, used mostly on laptops, requires a swap size that is one and a half times the size of RAM. For example, a system with 4 gigabytes of RAM should have a 6-gigabyte swap partition if it will hibernate. Although a swap partition is not required, most systems perform better when one is present. On a system with more than one drive, having swap partitions on each drive can improve performance even further. A swap partition is not mounted, so it is not associated with a mount point. See swap on page 513 for more information.

/boot

The /boot partition holds the kernel and other data the system needs when it boots. This partition is typically approximately 500 megabytes, although the amount of space required depends on how many kernel images you want to keep on hand. It can be as small as 100 megabytes, although at that size it will not hold many images, and it is a good idea to keep a few older images around as the kernel gets updated.

Although you can omit the /boot partition, it is useful in many cases. Many administrators put an ext2 filesystem on this partition because the data on it does not change frequently enough to justify the overhead of the ext4 journal. Systems that use software RAID (page 42) or LVM (page 44) require a separate /boot partition. Some BIOSs, even on newer machines, require the /boot partition (or the / [root] partition if there is no /boot partition) to appear near the beginning of the disk (page 590).


Caution: Image Where to put the /boot partition

On some systems, the /boot partition must reside completely below cylinder 1023 of the hard disk. An easy way to ensure compliance with this restriction is to make the /boot partition one of the first partitions on the disk. When a system has more than one hard disk, the/boot partition must also reside on a drive in the following locations:

• Multiple IDE or EIDE drives: the primary controller

• Multiple SCSI drives: ID 0 or ID 1

• Multiple IDE and SCSI drives: the primary IDE controller or SCSI ID 0


Image /var

The name var is short for variable: The data in this partition changes frequently. Because it holds the bulk of system logs, package information, and accounting data, making /var a separate partition is a good idea. Then, if a user runs a job that consumes all of the users’ disk space, system log files in /var/log will not be affected. The /var partition can occupy from 500 megabytes to as much as several gigabytes for extremely active systems with many verbose daemons and a lot of printer and mail activity (the print queues reside in /var/spool/cups and incoming mail is stored in/var/mail). By default, Apache content (the Web pages it serves) is stored on /var; you might want to change the location Apache uses.

Although such a scenario is unlikely, many files or a few large files might be created under the /var directory. Creating a separate filesystem to hold the files in /var will prevent these files from overrunning the entire directory structure, bringing the system to a halt, and possibly creating a recovery problem.

/var/log

Some administrators choose to put the log directory in a separate partition to isolate system logs from other files in the /var directory.

Image /home

It is a common strategy to put user home directories on their own filesystem. Such a filesystem is usually mounted on /home. Having /home as a separate filesystem allows you to perform a clean installation without damaging or losing user files. Also, having a separate /home filesystem prevents a user from filling the directory structure with her data; at most she can fill the /home filesystem, which will affect other users but not bring the system down.


Tip: Set up partitions to aid in making backups

Plan partitions based on which data you want to back up and how often you want to back it up. One very large partition can be more difficult to back up than several smaller ones.


/usr/local and /opt

Both /usr/local and /opt are candidates for separation. If you plan to install a lot of packages, such as on an enterprise system, you might want to keep them on a separate partition. If you install the additional software in the same partition as the users’ home directories, for example, it might encroach on the users’ disk space. Many sites keep all /usr/local or /opt software on one server; from there, they export the software to other systems. If you choose to create a /usr/local or /opt partition, its size should be appropriate to the software you plan to install.

Table 2-1 gives guidelines for minimum sizes for partitions. Set the sizes of other partitions, such as those for /home, /opt, and /usr/local, according to need and the size of the hard disk. If you are not sure how you will use additional disk space, you can create extra partitions using whatever names you like (for example, /b01, /b02, and so on). Of course, you do not have to partition the entire drive when you install Linux; you can wait until later to divide the additional space into partitions.

Image

Table 2-1 Image Example minimum partition sizesa

a. The sizes in this table assume you create all partitions separately. For example, if you create a 2-gigabyte / (root) partition and do not create a /home partition, you might not have enough room to store all the user files.

RAID

RAID (redundant array of inexpensive/independent disks) employs two or more hard disk drives or partitions in combination to improve fault tolerance and/or performance. Applications and utilities see these multiple drives/partitions as a single logical device. RAID, which can be implemented in hardware or software (Fedora/RHEL gives you this option), spreads data across multiple disks. Depending on which level you choose, RAID can provide data redundancy to protect data in the case of hardware failure. Although it can improve disk performance by increasing read/write speed, software RAID uses quite a bit of CPU time, which might be a consideration. True hardware RAID requires hardware designed to implement RAID and is not covered in this book (but see “Fake RAID” on the next page).

RAID can be an effective addition to a backup. Fedora/RHEL offers RAID software that you can install either when you install a Fedora/RHEL system or as an afterthought. The Linux kernel automatically detects RAID arrays (sets of partitions) at boot time if the partition ID is set to 0xfd(raid autodetect).


Caution: RAID does not replace backups or a good continuity plan

The purposes of RAID are to improve performance and/or to minimize downtime in the case of a disk failure. RAID does not replace backups.

Do not use RAID as a replacement for regular backups. If the system experiences a catastrophic failure, RAID is useless. Earthquake, fire, theft, and other disasters might leave the entire system inaccessible (if the hard disks are destroyed or missing). RAID also does not take care of the simple case of replacing a file when a user deletes it by accident. In these situations, a backup on a removable medium (which has been removed) is the only way to restore a filesystem.

Do not depend on RAID as a complete business continuity plan. Whether to set up RAID, remote server colocation, regular backups, and off-site backups are all decisions to be made when considering the costs of continued business due to a catastrophic failure.


Software RAID, as implemented in the kernel, is much cheaper than hardware RAID. Not only does this approach avoid the need for specialized RAID disk controllers, but it also works with the less expensive ATA disks as well as SCSI disks.

RAID hardware disk controllers can boost performance and the drives can generally be hot-swapped (i.e., drives can be replaced while the system is up).

Fake RAID

Fedora/RHEL does not officially support motherboard-based RAID (known as fake RAID) but accepts it through the dmraid driver set. Linux software RAID is almost always better than fake RAID. Visit help.ubuntu.com/community/FakeRaidHowto for background information on fake RAID.

If the system has two or more hard disks, the Anaconda partition editor gives you the choice of implementing RAID level 0, 4, or 5, 6, or 10. Anaconda makes sure the member partitions are on different drives. That way, with all levels except 0, if one drive fails, the data will be preserved.

RAID level 0 (striping)—Improves performance but offers no redundancy. The storage capacity of the RAID device is equal to that of the member partitions or disks.

RAID level 1 (mirroring)—Provides simple redundancy, improving data reliability, and can improve the performance of read-intensive applications. The storage capacity of the RAID device is equal to one of the member partitions or disks.

RAID level 4 (disk striping with dedicated parity disk)—Provides redundancy and improves performance (most notably, read performance). The storage capacity of the RAID device is equal to that of the member partitions or disks, minus one of the partitions or disks (assuming they are all the same size).

RAID level 5 (disk striping with parity)—Provides redundancy and improves performance (most notably, read performance). The storage capacity of the RAID device is equal to that of the member partitions or disks, minus one of the partitions or disks (assuming they are all the same size).

RAID level 6 (disk striping with double parity)—Improves upon level 5 RAID by protecting data when two disks fail at once. Level 6 RAID is inefficient with a small number of drives.

RAID level 10 (mirroring and striping)—A combination of RAID 1 and RAID 0 (also called RAID 1+0), RAID 10 uses mirroring to improve fault tolerance and striping to improve performance. Multiple RAID 1 arrays (mirroring) are overlaid with a RAID 0 array (striping). The storage capacity of the RAID device is equal to one-half that of the member partitions or disks. You must use at least four partitions or disks.

For more information see raid.wiki.kernel.org/index.php/Linux_Raid.

LVM: Logical Volume Manager

The Logical Volume Manager (LVM2, which this book refers to as LVM) allows you to change the size of logical volumes (LVs, the LVM equivalent of partitions) on the fly. With LVM, if you make a mistake in setting up LVs or if your needs change, you can make LVs either smaller or larger without affecting user data. You must choose to use LVM at the time you install the system or add a hard disk; you cannot retroactively apply it to a disk full of data. LVM supports IDE and SCSI drives as well as multiple devices such as those found in RAID arrays.

LVM groups disk components (partitions, hard disks, or storage device arrays), called physical volumes (PVs), into a storage pool, or virtual disk, called a volume group (VG). See Figure 2-1. You allocate a portion of a VG to create a logical volume (LV).

Image

Figure 2-1 LVM: Logical Volume Manager

An LV is similar in function to a traditional disk partition in that you can create a filesystem on an LV. It is much easier, however, to change and move LVs than partitions: When you run out of space on a filesystem on an LV, you can grow (expand) the LV and its filesystem into empty or new disk space, or you can move the filesystem to a larger LV. For example, you can add a hard disk to a system and incorporate it into an LV to expand the capacity of that LV. LVM’s disk space manipulation is transparent to users; service is not interrupted.

LVM also eases the burden of storage migration. When you outgrow the PVs or need to upgrade them, LVM can move data to new PVs. To read more about LVM, refer to the resources listed on page 28.

The Installation Process

The following steps outline the process of installing Fedora/RHEL from an Install Image. Installation from other installation images follows similar steps. See Chapter 3 for specifics.

1. Make sure the BIOS is set to boot from a DVD or USB flash drive (page 31). Insert the installation medium holding an Install Image in the system, and reset the computer. The computer boots and displays the Install Image Boot menu (Figure 3-4, page 61).

2. You can make a selection from the Install Image Boot menu, press the TAB key to display the boot command line (which you can modify), and begin installing Fedora/RHEL when you are ready. One of the menu items checks the installation medium. If you do nothing, Anaconda starts installing the system after 60 seconds.

3. As part of the process of bringing up a live session or installing Fedora/RHEL, Anaconda creates RAM disks (page 1269) that it uses in place of the hard disk used for a normal boot operation. Anaconda copies tools required for the installation or to bring up a system from a Live or Install Image to the RAM disks. The use of RAM disks allows the installation process to run through the specification and design phases without writing to the hard disk and enables you to opt out of the installation at any point before the last step of the installation. If you opt out before this point, the system is left in its original state. The RAM disks also allow a live session to leave the hard disk untouched.

4. You give Anaconda information about how you want to configure the system.

5. When Anaconda is finished collecting information, it writes the operating system files to the hard disk.

6. When you reboot the system, gnome-initial-setup asks questions that are required to set up the first user (page 68).

7. The system is ready for you to log in and use.

Downloading an Installation Image File and Writing to/Burning the Installation Medium

There are several ways to obtain or create installation media (a CD, DVD, or USB flash drive). Fedora/RHEL makes available releases of Linux as CD/DVD ISO image files (named after the ISO 9660 standard that defines the CD/DVD filesystem). Even though they are referred to as CD/DVD ISO images, you can write these files to a USB flash drive and then boot from that drive.

This section describes how to download one of these installation images and burn a DVD or write to a USB drive. You can also purchase an installation DVD from a Web site. If you cannot obtain Fedora/RHEL by any other means, you can point a browser atfedoraproject.org/wiki/FreeMedia to display a Web page with links that enable you to request a free Fedora DVD.

The Easy Way to Download an Installation Image File

This section explains the easiest way to download an installation (ISO) image file. This technique works in most situations; it is straightforward but limited. For example, it does not allow you to use BitTorrent to download the file.

To begin, point a browser at fedoraproject.org and click Download Now!. The download should start shortly. If the browser gives you a choice of what to do with the file, save it to the hard disk. The browser saves the installation (ISO) image file to the hard disk. Continue reading at “Verifying an Installation (ISO) Image File” on page 49.


Tip: You can find installation (ISO) image files for all supported architectures here

If you cannot find an installation image file that supports the type of hardware you want to install Fedora on, visit mirrors.fedoraproject.org/publiclist. For RHEL visit access.redhat.com and select Downloads.


Other Ways to Download an ISO Image File

This section explains how to download an installation (DVD/ISO) image file or a release that is not downloaded automatically, and how to download a torrent that enables you to use BitTorrent to download an installation (ISO) image file. See “Download Fedora/RHEL” on page 29 for other locations you can download Fedora/RHEL from.

Browser

When you use a Web browser to download a file, the browser contacts a Web (HTTP) or FTP server and downloads the file from that server. If too many people download files from a server at the same time, the downloads become slower.

BitTorrent

BitTorrent efficiently distributes large amounts of static data, such as installation (ISO) image files. Unlike using a browser to download a file from a single server, BitTorrent distributes the functions of a server over its clients. As each client downloads a file, it becomes a server for the parts of the file it has downloaded. To use BitTorrent, you must download a small file called a torrent (or have a Web browser do it for you). This file, which holds information that allows clients to communicate with one another, has a filename extension of .torrent. As more people use a torrent to download a file at the same time, the downloads become faster. Downloading an installation (ISO) image file using BitTorrent is covered later in this section.

Mirrors

Many sites mirror (hold copies of) the Fedora installation (ISO) image files and BitTorrent torrent files. Some mirrors use HTTP, while others use FTP; you can use a browser to download files from either type of site. FTP and HTTP sites appear slightly different.

Locate a mirror site by pointing a browser at mirrors.fedoraproject.org. Below the heading information, the page displays Public Active Mirrors. Narrow your choices by clicking a selection in the Mirror list filter at the upper-right corner of the page (Figure 2-2). For example, click 19 to list sites from which you can download Fedora 19 or click i386 in the row that starts with 19 to list sites from which you can download the i386 version of Fedora 19.

Image

Figure 2-2 The mirrors.fedoraproject.org Web page

The list on the newly displayed Web page is in country code order. For example, FR is France and US is the United States. To conserve network bandwidth, scroll to and download from a mirror site close to you. Look at the Content, Bandwidth, and Comments columns. Pick the row of an appropriate site and click the protocol you want to use in the Content column. From a browser there is little difference between the FTP and HTTP protocols, although accessing a site using FTP might be a bit faster.

When you click a protocol, the browser displays a page similar to the one shown in Figure 2-3. Follow these steps to download the installation (ISO) image file you want:

1. Click releases. The browser displays a list of Fedora releases. All sites have the current release. Most sites keep at least one or two older releases while others keep many older releases.

2. Click the number of the release of Fedora you want to download. The browser displays a list that includes Fedora and Live.

3. Click Live if you want to download a Live Image and Fedora if you want to download an Install Image. Make sure you have room for the file on the hard disk: An Install (DVD/ISO) Image file occupies more than 4 gigabytes.

4. Click the architecture (page 31) you want to install Fedora on: i386 or i686 for 32-bit systems and x86_64 for 64-bit systems.

5. If you are downloading an Install Image, click iso. If you are downloading a Live Image, go to the next step.

6. Download the CHECKSUM file.

7. Click the name of the installation image file you want to download and choose to download (not install) the image. Live gives you the choice of a Fedora-Live-Desktop-x86_64-19-1.iso, which runs (and optionally installs) a GNOME desktop and Fedora-Live-KDE-x86_64-19-1.iso, which runs (and optionally installs) a KDE desktop. (The 19-1 indicates the second release of Fedora 19.) Fedora gives you the choice of downloading an Install Image or a Network Image (ISO image file).

Image

Figure 2-3 A Fedora mirror site

Using BitTorrent

As mentioned earlier, you can use BitTorrent to obtain an installation (ISO) image file. BitTorrent is especially effective for downloading one of these files shortly after a new release is made available.

To download a torrent, point a browser at fedoraproject.org/en/get-fedora-all or torrent.fedoraproject.org and click the filename of the torrent. You can identify a torrent file by its filename extension of .torrent. A BitTorrent client should start automatically and ask where to put the downloaded file. You can also download the torrent manually. Once you have a BitTorrent client such as Transmission (www.transmissionbt.com; installed with most Fedora/RHEL editions), you can start downloading the file from the command line (page 544) or by clicking it in a file browser such as Nautilus (page 102).


Tip: You can download and burn/write to a DVD or USB flash drive under any operating system

You can download and burn the DVD or write to a USB flash drive on any computer that is connected to the Internet, has a browser, has enough space on the hard disk to hold the image file (about 1 gigabyte for a Live Image and over 4 gigabytes for an Install Image), and can burn a DVD or write to a USB drive. You can often use ftp (page 716) or, on a Linux system, Nautilus: Connect to Server in place of a browser to download the file.


Verifying an Installation (ISO) Image File

This section assumes you have an image file and a CHECKSUM file saved on the hard disk and explains how to verify the file is correct. The CHECKSUM file contains the SHA2 (page 1272) sums for each of the available installation (ISO) image files. When you process a file using thesha256sum utility, sha256sum generates a number based on the file. If that number matches the corresponding number in the CHECKSUM file, the downloaded file is correct. With the –c option and the name of the CHECKSUM file, sha256sum checks each of the files listed in the CHECKSUM file. The following example shows the Live Desktop installation (ISO) image file is OK and the Live KDE image file is not present. The message about improperly formatted lines refers to the PGP key in the CHECKSUM file; you can ignore this message.

$ sha256sum -c *-CHECKSUM
Fedora-Live-Desktop-x86_64-19-1.iso: OK
sha256sum: Fedora-Live-KDE-x86_64-19-1.iso: No such file or directory
Fedora-Live-KDE-x86_64-19-1.iso: FAILED open or read
sha256sum: WARNING: 20 lines are improperly formatted
sha256sum: WARNING: 1 listed file could not be read

Computing an SHA2 sum for a large file can take a while. If sha256sum does not report the file is OK, you must download the file again.


Tip: Writing to a USB flash drive might be easier

Writing an installation (ISO) image file to a USB drive can be easier and more economical than burning a DVD. Also, some laptops do not have a DVD drive and so cannot boot from a DVD.


Burning a DVD

An installation (ISO) image file is an exact image of what needs to be on the DVD. Putting that image on a DVD involves a different process than copying files to a DVD. For that reason, DVD-burning software has a special selection for burning an ISO image, which bears a label similar toRecord CD from CD Image or Burn CD Image. Refer to the instructions for the software you are using for information on how to burn an ISO image file to a DVD.


Tip: Make sure the software is set up to burn an ISO image

Burning an ISO image is not the same as copying files to a DVD. Make sure the DVD-burning software is set up to burn an ISO image. If you simply copy the ISO file to a DVD, it will not work when you try to install Linux.


Image Writing to a USB Flash Drive

This section explains how to use liveusb-creator (fedorahosted.org/liveusb-creator) to write an installation (ISO) image file to a USB flash drive. Even though the name of the program includes the word live, you can use it to write either an Install or Live Image (ISO image file) to a USB drive. You can then boot from the USB drive to install Linux or run a live system.


Tip: The USB flash drive must be large enough to hold the ISO file

The USB drive you write to must be big enough to hold the installation (ISO) image file. An Install Image is bigger than 4 gigabytes.


Windows

Download the Windows installer (liveusb-creator*setup.exe) from fedorahosted.org/ liveusb-creator and run it to install liveusb-creator.

Linux

From a Fedora/RHEL system give the following command from a terminal emulator to install the program. You will need to enter the root password.

$ su -c 'yum -y install liveusb-creator'

Under Ubuntu, use usb-creator (usb-creator package), which performs the same function. See page 1184 for instructions on downloading software using apt-get.

Writing to the USB drive

The liveusb-creator utility displays the Fedora LiveUSB Creator window (Figure 2-4). Under Windows, select liveusb-creator from the main menu to open this window. Under Linux, open this window by giving the command liveusb-creator (or usb-creator) from an Enter a Command window (ALT-F2) or a terminal emulator; liveusb-creator will ask you to authenticate as root (provide the root password).

Image

Figure 2-4 The Fedora LiveUSB Creator window

Click Browse to locate the installation (ISO) image file you downloaded. The program will fill in the text box labeled Target Device automatically; specify a USB drive here if you have more than one. The Persistent Storage slider sets up storage space on the USB drive for use from a live system. Click Create Live USB. When liveusb-creator displays Complete! you can close the window and remove the USB drive.

Gathering Information About the System

It is not difficult to install and bring up a Linux system. Nevertheless, the more you know about the process before you start, the easier it will be. The installation software collects information about the system and can help you make decisions during the installation process. However, the system will work better when you know how you want to partition the hard disk rather than letting the installation program create partitions without your input. There are many details, and the more details you take control of, the more pleased you are likely to be with the finished product. Finding the information this section asks for will help ensure you end up with a system you understand and know how to change when necessary. To an increasing extent, the installation software probes the hardware and figures out what it is. Newer equipment is more likely to report on itself than older equipment is.


Tip: Test the installation image file and test the installation medium

It is a good idea to test the installation (ISO) image file and the installation medium before you use it to install Linux. When you boot the system from the installation medium, Fedora/RHEL gives you the option of checking the image file for errors (see the tip on page 65). A bad file on an installation medium might not show up until you finish installing Fedora/RHEL and have it running. At that point, it might be difficult and time-consuming to figure out where the problem lies. Testing the file and installation medium takes a few minutes but can save you hours of trouble if something is not right. If you decide to perform one test only, test the installation medium.


It is critical to have certain pieces of information before you start. One thing Linux can never figure out is all the relevant names and IP addresses (unless you are using DHCP, in which case the addresses are set up for you).

Following is a list of items you might need information about. Gather as much information about each item as you can: manufacturer, model number, size (megabytes, gigabytes, and so forth), number of buttons, chipset (for cards), and so on. Some items, such as the network interface card and the sound card, might be built into the motherboard.

• Hard disks

• Memory; you do not need it for installation, but it is good to know

• SCSI interface card

• NIC (network interface card)

• Video interface card (including the amount of video RAM/memory)

• Sound card and compatibility with standards, such as SoundBlaster

• Mouse (PS/2, USB, AT, and number of buttons)

• Monitor (size and maximum resolution)

• IP addresses and names, unless you are using DHCP (page 491; most routers are set up as DHCP servers), in which case the IP addresses are automatically assigned to the system. Most of this information comes from the system administrator or ISP.

Image System hostname (anything you like)

Image System address

Image Network mask (netmask)

Image Gateway address (the connecting point to the network or Internet) or a phone number when you use a dial-up connection

Image Addresses for nameservers, also called DNS addresses

Image Domain name (not required)

Chapter Summary

A Live Image can run a live Fedora session without installing Fedora on the system. You can install Fedora from a live session. Running a live session is a good way to test hardware and fix a system that will not boot from the hard disk.

When you install Fedora/RHEL, you copy operating system files from an installation medium (e.g., DVD or USB flash drive) to hard disk(s) on a system and set up configuration files so that Linux runs properly on the hardware. Operating system files are stored on installation media as an installation (ISO) image file. You can use a Web browser, FTP, or BitTorrent to download an installation (ISO) image file. It is a good idea to test the image file when it is downloaded and the installation medium before you use it to install Fedora/RHEL.

When you install Fedora/RHEL, you can let the Anaconda installer decide how to partition the hard disk (default partitioning) or you can manually specify how you want to partition it.

The Fedora Project is sponsored by Red Hat and supported by the open-source community. Fedora is a Linux release that contains cutting-edge code; it is not recommended for production environments. RHEL is more stable than Fedora.

Exercises

1. Briefly, what does the process of installing an operating system such as Linux involve?

2. What is an installer? What is the name of the Fedora/RHEL installer?

3. Would you set up a GUI on a server system? Why or why not?

4. A system boots from the hard disk. To install Linux, you need it to boot from a DVD. How can you make the system boot from a DVD?

5. What is free space on a hard disk? What is a filesystem?

6. What is an ISO image? How do you burn an ISO image to a DVD?

Advanced Exercises

7. Give two reasons why RAID cannot replace backups.

8. What are RAM disks? How are they used during installation?

9. What is SHA2? How does it work to ensure that an ISO image file you download is correct?