Date post: | 07-Apr-2018 |
Category: |
Documents |
Upload: | strykeofunity |
View: | 240 times |
Download: | 2 times |
of 14
8/6/2019 RH130 Workbook1 Chapter1 Reading
1/14
Key Concepts
y The Red Hat Enterprise Linux Distribution is most easily obtained through Red HatNetwork.
y The cdrecord utility can be used to burn ISO images onto Compact Disks using a CD-Rdrive.
y The Red Hat Enterprise Linux installer, called Anaconda, is designed in two stages.y The first stage of the installer may be booted from the first installation CD, or from a
specially constructed boot CD.y The second stage of the installer may be accessed from Compact Disks, or from a HTTP,
FTP, or NFS server, or from a preexisting partition on the harddrive.y The installer can be modified by passing boot parameters using the installer's bootloader
prompt.
Discussion
The Red Hat Distribution: Red Hat Enterprise Linux
Red Hat, Inc., is a distributor of Linux, an open source operating system. At the outset, we willbriefly mention several Linux distributions that are associated with Red Hat, before settling onthe official Red Hat distribution, Red Hat Enterprise Linux.
Red Hat Linux (obsolete)
Originally, during the 1990's and early 2000's, the Red Hat distribution was known as
Red Hat Linux. Red Hat Linux was available for public download and installation, with
Red Hat selling support for the software. In order to benefit from the rapid developmentof open source software, Red Hat Linux had an aggressive release cycle, with a newrelease every six months.
Summarizing for Red Hat Linux:
y Publically availabley Red Hat, Inc. sold support for the softwarey New releases every 6 monthsy No longer available or supported
Red Hat Enterprise Linux
While popular, the Red Hat Linux model also had some problems. For any independentsoftware provider who was trying to develop software for Red Hat Linux, the six month
release cycle was too aggressive. In fact, the release cycle was too aggressive for RedHat. Whenever a bug fix needed to be issued, the bug fix would need to be backported to
many different versions of Red Hat which we had released over the years. For these
8/6/2019 RH130 Workbook1 Chapter1 Reading
2/14
reasons, several years ago, Red Hat shifted gears, and adopted Red Hat Enterprise Linuxas our product.
Red Hat Enterprise Linux has a more sustainable release cycle, with a new release
approximately every two years. With the extended release cycle, the support window for
Red Hat Enterprise Linux has been extended, to at least 5 years for a given release.Providing customers extended support imposes costs on Red Hat, however, and Red Hatseeks to make an honest living from the service. Red Hat Enterprise Linux is available
only by paid subscription.
Summarizing for Red Hat Enterprise Linux:
y Extended support windows (5 years or more)y New releases approximately every 2 yearsy Available via subscription
Fedora
Red Hat is a member of the open source community, and draws heavily from that
community. The majority of the software that ships with Red Hat, Red Hat didn't create.Red Hat also believes strongly in giving back to the community. Software that Red Hat
creates is routinely open sourced, and contributed to open source projects. When Red Hattransitioned from Red Hat Linux to Red Hat Enterprise Linux, it also began to contribute
heavily to an already exisiting community based Fedora distribution.
In many ways, Fedora is what Red Hat Linux used to be, but with more. Fedora is
publically available. Fedora has an aggressive release cycle, with a new release every six
months. The distribution evolves quickly, with a vast selection of current open sourcesoftware. Red Hat contributes heavily to the community support for the product, whichfocuses on the current and previous release only. Not much effort is spent backporting
bug fixes to previous releases of Fedora. Red Hat does not provide formalized support forFedora. The distribution is actively supported, however. If an exploit is discovered in a
popular Internet facing service, an update for the service will be promptly issued.
More information about the Fedora distribution can be found at http://fedoraproject.org/.
Summarizing for Fedora:
yPublically available at http://fedoraproject.org/
y New releases every 6 monthsy Community supported for current and previous release only.
If you are interested in using Linux for a home system, and are willing to upgrade your
installation every six months to a year, Fedora is a very reasonable solution. If, however, you aredeploying a large number of machines, or essential Internet facing services, you are probably
8/6/2019 RH130 Workbook1 Chapter1 Reading
3/14
looking for more stabillity. In these cases, the value provided by Red Hat Enterprise Linux ismore evident.
This course focuses on administering Red Hat Enterprise Linux. Much of what is learned in this
course, however, applies to the Fedora distribution as well.
The Red Hat Enterprise Linux Distribution consists of serveral offerings, including the Serverrelease,Desktop release, andAdvanced Platform release. This course focuses on the most
popular Server release.
Anaconda, the Red Hat Installer
The Red Hat installer, called Anaconda, is used to install the Red Hat Enterprise Linux operating
system, or upgrade existing installations to a newer release. For simple installs, Anaconda is easyto use and mostly self evident. Anaconda also contains many advanced features, however, which
merit more attention.
This workbook discusses how to use Anaconda from the ground up, starting with obtaining the
installation media through a Red Hat Network account, and ending with using Kickstart scriptsand network based installs to perform automated installations of large numbers of machines.
The Anaconda Installer's 2 Stage Design
Anaconda Stage 1
The first stage of the Anaconda installer is designed to fit on a bootable medium, and serves to
start the installer by loading a kernel and starting the installer's first stage executable. The
purpose of the first stage installer is collect enough information to find, load, and execute thesecond stage installer.
Stage 1 of the Anaconda installer can be booted from one of the following formats, each of
which is documented in the Red Hat Enterprise Linux Installation Guide.
y Installation disk 1 from a Red Hat Enterprise Linux distribution set of CD's. This disccontains both the first stage installer, and part of the second stage installer as well. The
remainder of the second stage installer is found on the remaining CD's.y A boot.iso CD. boot.iso is a small (about 7 megabytes) bootable image that can be burned
onto a CD relatively quickly. The boot.iso contains only the Stage 1 component of
Anaconda and is usually used along with a network installation server (explained later)that contains the Stage 2 image and the installation packages. The boot.iso image can be
found in the images/ directory on installation disk 1.
y A USB (or other) disk initialized with the diskboot.img image. This technique requiresa BIOS that is capable of booting from USB devices. The diskboot.img image is also
found in the images/ directory on installation disk 1.y Anaconda also supports the Pre eXecution Environment (PXE, pronounced "pixie").
Systems with PXE-compatible ethernet cards and BIOSes can boot "from the network".
8/6/2019 RH130 Workbook1 Chapter1 Reading
4/14
When booting a PXE enabled system, BIOS provides an option to download a kernel andan installer image without needing any other media. While the most efficient way to
manage large numbers of systems, configuring a PXE server is beyond the scope of thiscourse. You can learn more about PXE in Chapter 31 of the Red Hat Enterprise Linux
Installation Guide.
This course will focus on the first two methods, as they require the least specialized hardwareand are the most commonly used.
Anaconda Stage 2
Stage 2 of the installer contains the installer proper, including the collection of RPM packagefiles which compose a given Red Hat distribution. The Stage 2 installer is between 2 and 3
gigabytes in size, and will not fit on a single CD.
Once the first stage of the installer has been started, stage two can be accessed using one of the
following sources.
y The five Installation CDs found in the Red Hat Enterprise Linux distribution.y The contents of the five Installation CD's exported using a Web (HTTP) server.y The contents of the five Installation CD's exported using a FTP server.y The contents of the five Installation CD's exported using a NFS server.y The ISO images of the five Installation CD's may be found on an already formatted
partition of a locally connected hard drive.
This lesson discusses starting a Red Hat Enterprise Linux installation by loading the first stage
installer. The following lesson discusses continuing the installation from a 5 CD set. A
subsequent lesson discusses performing an installation accessing the installer's second stagethrough network services.
What is on the Installation CD's
The root directory of Installation CD 1 contains the following files and directories.
Table 1-1. Red Hat Enterprise Linux Installation Disk Structure
File Contents
images/
Image files which can be used to create the boot media for starting a
Red Hat Enterprise Linux installation, as well as the larger image ofthe stage 2 installer.
Server/
The base directory of the Red Hat Enterprise Linux Server
distribution, which includes the binary RPM package files. Thepakages in this large directory constitute the Red Hat Enterprise
Linux distribution.
Cluster/, Supplementary repositories for the Advanced Server release of Red
8/6/2019 RH130 Workbook1 Chapter1 Reading
5/14
File Contents
ClusterStorage/, andVT/
Hat Enterprise Linux.
README-en Notes about Red Hat Enterprise Linux installation media layout.
RELEASE-NOTES-enA summary of new features or changes associated with this specific
release of Red Hat Enterprise Linux.
RPM-GPG-KEY-redhat-release
A copy of the Gnu Privacy Guard public key which complements the
private key that Red Hat uses to sign distributed software.
EULA The Red Hat Linux End User Licensing Agreement.
GPLThe GNU Public License, which specifies the conditions under whichyou may modify and distribute software found in the Red Hat
Enterprise Linux distribution.
While installation CD's 2 through 5 duplicate many of the axillary files, their primary function is
to store more binary RPM package files in their own Server/ directories.
Obtaining the Red Hat Enterprise Linux Distribution
Using Red Hat Network
With a subscription to Red Hat Network, ISO images of the Red Hat Enterprise Linux
installation media are available for download. The ISO images can be used to "burn" local copiesof the distribution CDs using a CD-writable (CD-R) drive. Once installed, the system can easily
(if desired, automatically) be updated and its software managed through Red Hat Network's webapplication.
To obtain ISO images using a Red Hat Network Account, first log in at http://rhn.redhat.com,and then choose Channels from the top menu. Here, a "Software Downloads" panel loads a page
containing links to the various ISO images for the CD-ROMs which compose the Red HatEnterprise Linux distribution. The ISO images can be downloaded to a local harddrive by
selecting the provided links.
Figure 1-1. Downloading Red Hat Enterprise Linux ISOimages through Red Hat Network
8/6/2019 RH130 Workbook1 Chapter1 Reading
6/14
8/6/2019 RH130 Workbook1 Chapter1 Reading
7/14
Downloading ISO Images using curl
The ISO images are large files, often over 600 MB apiece. While most web browsers should be
able to download the files, the suggested technique is to use the curl command line web client.The curl command has the capability to resume stalled or aborted downloads, picking up where
it previously left off.
The following illustrates the suggested syntax. The -C - command line switch specifies that curl
should continue any previous download where it left off, and -O specifies that the resulting fileshould be named after the file in the specified URL. The URL should be wrapped in single
quotes (to protect it from any unintended shell expansions).
[elvis@station img]$ curl -C --O 'URL'
When specifying the URL which references the ISO images, Red Hat Network obfuscates the
URL by including a long string of random text. Fortunately, most browsers (including Firefox)
allow URLs to be copied, usually by just "Drag 'n Dropping" the link from the browser windowinto the terminal window.
The following command line demonstrates Installation Disk 1 being downloaded from Red Hat
Network.
[elvis@station elvis]$ curl -O'https://rhn.redhat.com/download/1189498922251/ee77444bb80dbd0142cb3360c181590102720b9e/2663190/21515/rhn/isos/RHEL5/rhel-i386-server-5/rhel-5-server-i386-disc1.iso'% Total % Received % Xferd Average Speed Time
Curr.Dload Upload Total Current Left
Speed0 139M 0 536k 0 0 160k 0 0:14:53 0:00:03 0:14:50
173k
Verifying the Integrity ofISO Images
The integrity of downloaded ISO images can be confirmed by calculating a MD5 hash (also
known asfingerprintorsum) of the files using the md5sum command. The resulting hash can becompared to published values of the same. Within Red Hat Network, the published hash can be
found on the same page from which images were downloaded. FTP servers should include a file
called MD5SUM which contains the same.
In the following, elvis calculates MD5 fingerprints of his downloaded ISO images, which can becompared to published values.
[elvis@station img]$ md5sum rhel-5-server-i386-disc*2616e3998f702453fe6fd90c872c46b3 rhel-5-server-i386-disc1.isob11a8dcacce6604938d9413b31347d21 rhel-5-server-i386-disc2.iso48a86777f092b3e066dd32835d6242ab rhel-5-server-i386-disc3.iso383c2ce624b2f177a2809a26281f019f rhel-5-server-i386-disc4.iso
8/6/2019 RH130 Workbook1 Chapter1 Reading
8/14
c5911d8c2157975abc1b7bec964d019a rhel-5-server-i386-disc5.iso
Comparing the calculated fingerprints to the published versions, elvis is assured that his ISO
images have not been corrupted during download.
Mount
ing IS
OIm
ages with the Loop
back
Device
The contents of an ISO image can be examined before transferring the image to a Compact Disk.ISO images are byte-for-byte copies of the filesystem, and the files that it contains, that would be
found on a Compact Disk. In Linux, files which contain filesystem images can be mounteddirectly, without first having to transfer the image to actual media. Because this type of mounting
uses the loopbackvirtual device driver, the technique is often referred to as performing aloopback mount.
As an example of a loopbackmount, elvis su's to root (generally, only root can perform mounts).
He then runs the mount command with the -o loop mount option. Where normally a device
would be specified, the image file is specified instead.
[elvis@station img]$ suPassword: (elvis enters root's password)[root@station img]# mkdir /mnt/iso[root@station img]# mount -o loop rhel-5-server-i386-disc1.iso /mnt/iso/[root@station img]# ls /mnt/iso/Cluster isolinux RPM-GPG-KEY-redhat-formerClusterStorage README-en RPM-GPG-KEY-redhat-releaseEULA RELEASE-NOTES-en Servereula.en_US RPM-GPG-KEY-fedora TRANS.TBLGPL RPM-GPG-KEY-fedora-test VThtml RPM-GPG-KEY-redhat-auxiliaryimages RPM-GPG-KEY-redhat-beta
(Several documentation files have been edited from the above output).
Satisfied that he's looking at what would be the root directory of a Red Hat installation CD-ROM, elvis (as root) unmounts the image file, and exits the root shell.
[root@station img]# umount /mnt/iso[root@station img]# exitexit
Writing the Image toMedia (Burning Compact Disks)
The final step is to transfer the ISO images onto writable Compact Disks, using a CD-writable(CD-R) drive. In Red Hat Enterprise Linux, the cdrecord command is used to burn ISO images
from the command line. Because timing is critical when writing to CD's, the cdrecord commandruns as a Linux real time process. As a result, the cdrecord command can only be run as root.
8/6/2019 RH130 Workbook1 Chapter1 Reading
9/14
The cdrecord command is highly configurable, and the associated man page can be intimidating.Fortunately, the default settings are fairly reasonable. After inserting a CD-R blank into the
drive, invoke cdrecord with the name of the ISO imagefile to be burned to the disc.
[root@station img]# cdrecord rhel-5-server-i386-disc1.iso
Note: The process of burning Compact Disks is sensitive to data transfer rates. Other I/O
intensive tasks should be avoided while writing a Compact Disk.
The boot.iso Image
Creating a full CD set takes more time and media than many administrators would like to devote
to installation. If you have tried installing 20 or 100 servers, you can probably appreciate howcumbersome CD-based installations can be. Fortunately, there is another way better suited to
large or automated installations. Lesson three discusses how to install from a set of Red HatEnterprise Linux packages on a network server instead of a CD set. Usually, you will still need a
bootable CD to start the process, but a network installation means never having to change CDspartway through.
Rather than using the 600MB CD 1 from the Red Hat Enterprise Linux installatin CD set,
network based installs can be started from a smaller (7MB) boot.iso image, which only
contains the first stage installer. The image is found in the images directory on CD 1.
In the following example, elvis "loopback mounts" CD #1, so that he can access and "burn" the
boot.iso image to a CD-ROM.
[elvis@station img]$ suPassword: (elvis enters root's password)
[root@station img]# mount -o loop rhel-5-server-i386-disc1.iso /mnt/iso/[root@station img]# ls -sh /mnt/iso/imagestotal 129M6.9M boot.iso 32M minstg2.img 8.0KREADME 8.0K TRANS.TBL13Mdiskboot.img 8.0K pxeboot 79M stage2.img 8.0K xen[root@station img]# cdrecord /mnt/iso/images/boot.iso
Starting the Anaconda Installer
Once boot media have been obtained, the Anaconda installer can be started by booting fromInstallation Disk 1 of the Red Hat Enterprise Linux distribution or from a boot.iso CD.
The Anaconda Boot Prompt
At startup, Anaconda displays a greeting screen and boot prompt, akin to the following:
(Splash Screen Image)
- To install or upgrade RedHat Linux in graphical mode,
8/6/2019 RH130 Workbook1 Chapter1 Reading
10/14
press the ENTER key.
- To install or upgrade RedHat Linux in text mode, type:linux text ENTER.
- Use the function keys listed below for more information.
[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]
boot:
The boot prompt provides the first opportunity to interact with the Anaconda installer. Usually,
one just hits RETURN, or waits for the prompt to timeout, and the installer will continue tolaunch using default, and often fully appropriate, settings. The following boot parameters,
however, if supplied at the installer's boot prompt, can be used to modify Anaconda's behavior.
Table 1-2. Common Anaconda Boottime Parameters
Parameter Effect
noipv6
Do not attempt to implement IPv6 configuration. (In RHEL 5, the installer will
try to acquire IPv6 configuration by default. If you do not have a IPv6configuration environment established, which is most likely the case, this can
cause a long delay during network configuration.)
resolution=MxN Force the Graphical X server to use a screen resolution ofMxN.
lowres Same as resolution=640x480
askmethodAsk method for accessing the second stage installer (if using a method other than
CD-ROM).
expert Enable special features, such as the partitioning of removable media andpropting for a driver disk.
ks=paramsUse kickstart to perform a scripted installation. Kickstart installations arediscussed in detail in a later lesson.
mediacheckPerform an integrity check on the CD-ROMs before performing the install
(useful for "home burned" media).
noprobe Do not automatically probe for hardware.
rescueDo not perform an installation, but use Anaconda to run a rescue shell for system
repair. The rescue shell is discussed in detail in a later workbook.
This table is just a small sampling of the many available options, some of which will beencountered later in this workbook. A full list of support options can be found on an installed
system in /usr/share/doc/anaconda-11*/command-line.txt, assuming the anaconda RPM
package has been installed.
When supplying boot parameters to the installer, the first token on the bootloader's command
line mustbe the word linux. Subsequent tokens may be taken from the list above, or ifunrecognized by the installer, will be passed to the Linux kernel as kernel boot parameters.
8/6/2019 RH130 Workbook1 Chapter1 Reading
11/14
8/6/2019 RH130 Workbook1 Chapter1 Reading
12/14
The following welcome screen will appear if the second stage installer has started correctly ingraphics mode.
Figure 1-2. Anaconda GraphicalWelcome Screen
In text mode, the second stage installer will greet the user with the following screen.
Figure 1-3. Anaconda TextWelcome Screen
8/6/2019 RH130 Workbook1 Chapter1 Reading
13/14
In VNC mode, the the first stage installer will merely leave off with a text message akin to thefollowing:
Figure 1-4. Anaconda VNCMessage
8/6/2019 RH130 Workbook1 Chapter1 Reading
14/14
From another machine, however, the second stage installer can be accesed by starting a VNC
client, such as vncviewer provided by the vnc RPM package, using the specifed address:
[elvis@station install]$ vncviewer 192.168.122.14:1
VNC Viewer Free Edition 4.1.2 for X - built Jun 11 2007 09:44:52Copyright (C) 2002-2005 RealVNC Ltd.See http://www.realvnc.com for information on VNC.
The resulting VNC window displays the remote second stage graphical installer.
The next lesson will discuss the second stage of the Anaconda installer.