Installing RHEL 8 on a Clean Disk Drive

From Techotopia
Jump to: navigation, search


PreviousTable of ContentsNext
The History of Red Hat LinuxDual Booting RHEL 8 with Windows


You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book.

Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($24.99) or Print ($36.99) format

Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages

Buy Print Preview Book


There are now two ways in which a RHEL 8 system can be deployed. One method is to either purchase new hardware or re-purpose an exiting computer system on which to install and run the operating system. Another option is to create a cloud-based operating system instance using services such as Amazon AWS, Google Cloud and Microsoft Azure (to name but a few). Since cloud-based instances are typically created by selecting a pre-configured, ready to run operating system image that is already optimized for the cloud platform, and using that as the basis for the RHEL system, there is no need to perform a manual operating system installation in this situation.

If, on the other hand, you plan to install RHEL 8 on your own hardware, the first step on the path to learning about Red Hat Enterprise Linux 8 involves installing the operating system.

RHEL can be installed either in a clean disk environment (where an entire disk is cleared of any existing partitions and dedicated entirely to RHEL) or in a dual boot environment where RHEL co-exists with another operating system on the disk (typically a member of the Microsoft Windows family of operating systems).

In this chapter we will be covering the clean disk approach to installation from local or remote installation media. Dual boot installation with a Windows 10 system will be covered in Dual Booting RHEL 8 with Windows.


Contents


Obtaining the Red Hat Enterprise Linux Installation Media

Although RHEL is an open source operating system, and as such, the source code is freely accessible, the binary installation images are only available as part of a paid Red Hat Enterprise Linux subscription. In addition to access to the installation images for RHEL, subscription levels are available that provide technical support for the operating system. If you already have a paid subscription, log into your Red Hat account to download the operating system. If you would like to try out RHEL before purchasing, Red Hat provides a 30-day trial. To register for a trial, visit the Red Hat website at the following address:

https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux/try-it

Members of the Red Hat Developer program are also provided with access to RHEL 8. Details on joining this program can be found on the Red Hat Developers web site:

https://developers.redhat.com

The installation media can be downloaded either as a boot ISO image. The DVD ISO image is self-contained including all of the packages necessary to install a RHEL system and is named using the following convention:

rhel-<version>-<architecture>-dvd.iso

For example, the RHEL 8.0 DVD image for 64-bit Intel systems is named as follows:

rhel-8.0-x86_64-dvd.iso

The boot ISO image, on the other hand, only contains the files necessary to begin the installation and requires access to the full installation media located on a remote server. The boot image may also be used to perform rescue operations on an existing RHEL system. The boot ISO is named using the following convention:

rhel-<version>-<architecture>-boot.iso

Having downloaded an image, either burn it to disk or use the steps in the next section to write the media to a USB drive, configure your virtualization environment to treat it as a DVD drive or use the steps outlined later in this chapter to access the installation image over a network connection.

Writing the ISO Installation Image to a USB Drive

These days it is more likely that an operating system installation will be performed from a USB drive than from a DVD. Having downloaded the ISO installation image for RHEL 8, the steps to write that image to a USB drive will differ depending on whether the drive is attached to a Linux, macOS or Windows system. The steps outlined in the remainder of this section assume that the USB drive is new, or has been reformatted to remove any existing data or partitions:


Linux

The first step in writing an ISO image to a storage devices already detected on the system by listing the devices in /dev as follows:

# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2

Attach the USB drive to the Linux system and run the dmesg command to get a list of recent system messages, one of which will be a report that the USB drive was detected and will be similar to the following:

[445597.988045] sd 6:0:0:0: [sdb] Attached SCSI removable disk

This output tells us that we should expect the device name to include “sdb” which we can confirm by listing device names in /dev again:

# ls /dev/sd*
/dev/sda   /dev/sda1   /dev/sda2   /dev/sdb

From this output we can tell that the USB drive has been assigned to /dev/sdb. The next step before writing the ISO image to the device is to run the findmnt command to make sure it has not been auto-mounted:

# findmnt /dev/sdb
TARGET                                           SOURCE   FSTYPE OPTIONS
/run/media/neil/d6bf9574-7e31-4f54-88b1          /dev/sdb ext3   rw,nosuid,no

If the findmnt command indicates that the USB drive has been mounted, unmount it before continuing:

umount /run/media/neil/d6bf9574-7e31-4f54-88b1

Once the filesystem has been unmounted, use the dd command as follows to write the ISO image to the drive:

# dd if=/path/to/iso/image.iso of=/dev/sdb bs=512k

The writing process can take some time (as long as 10 - 15 minutes) to complete depending on the image size and speed of the system on which it is running. Once the image has been written, output similar to the following will appear and the USB drive is ready to be used to install RHEL 8:

5956+0 records in
5956+0 records out
3122659328 bytes (3.1 GB, 2.9 GiB) copied, 426.234 s, 7.3 MB/s

macOS

The first step in writing an ISO image to a USB drive attached to a macOS system is to identify the device using the diskutil tool. Before attaching the USB device, open a Terminal window and run the following command:

$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         1000.0 GB  disk0s2
 
/dev/disk1 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         28.0 GB    disk1
   1:                        EFI EFI                     314.6 MB   disk1s1
   2:                 Apple_APFS Container disk2         27.7 GB    disk1s2
 
/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.0 TB     disk2
                                 Physical Stores disk1s2, disk0s2
   1:                APFS Volume Macintosh HD            473.6 GB   disk2s1
   2:                APFS Volume Preboot                 42.1 MB    disk2s2
   3:                APFS Volume Recovery                517.0 MB   disk2s3
   4:                APFS Volume VM                      1.1 GB     disk2s4

Having established a baseline of detected devices, insert the USB drive into a port on the macOS system and run the command again. The same results should appear with one additional entry for the USB drive resembling the following:

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                                                   *16.0 GB    disk3

In the above example, the USB drive has been assigned to /dev/disk3. Before proceeding, unmount the disk as follows:

$ diskutil unmountDisk /dev/disk3
Unmount of all volumes on disk3 was successful

Finally, use the dd command to write the ISO image to the device, taking care to reference the raw disk device (/dev/rdisk3) and entering your user password when prompted:

$ sudo dd if=/path/to/iso/image.iso of=/dev/rdisk3 bs=1m

Once the image has been written, the USB drive is ready.

You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book.

Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($24.99) or Print ($36.99) format

Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages

Buy Print Preview Book

Windows

A number of free tools are available for Windows that will write an ISO image to a USB drive, but one written specifically for writing Linux ISO images is the Fedora Media Writer tool which can be downloaded from the following URL:

https://getfedora.org/en/workstation/download/

Once installed, launch the writer tool and select the Custom image option as highlighted in Figure 3-1:


Rhel 8 fedora media writer.png


Figure 3-1

In the resulting file selection dialog, navigate to and select the RHEL 8 installation ISO image and click on the Open button. After selecting the image, a dialog will appear within which the image can be written to the USB drive. Select the target USB drive from the device menu before clicking on the Write to Disk button:


Rhel 8 fedora media writer writing.png


Figure 3-2

Once the image has been written to the device, the device is ready to be used to perform the installation.

Installing Red Hat Enterprise Linux 8

Insert the RHEL 8 installation media into the appropriate drive and power on the system. If the system tries to boot from the hard disk drive you will need to enter the BIOS set up for your computer and change the boot order so that it boots from the installation media drive first. Once the system has booted you will be presented with the following screen:


Rhel 8 installation boot screen.png


Figure 3-3

Use the arrow keys to navigate between the options and make a selection with the <Enter> key. If the Troubleshooting option is selected the screen shown in Figure 3-4 will appear including options to boot from the current operating system on the local drive (if one is installed), test the system memory, or rescue an installed RHEL 8 system. An option is also available to perform the installation in basic graphics mode for systems without a graphical console:


Rhel 8 troubleshooting boot screen.png


Figure 3-4

Select the option on the main screen to install Red Hat Enterprise Linux and, after a short delay, the first screen of the graphical installer will appear:


Rhel 8 installation welcome screen.png


Figure 3-5

Select your preferred language on the first screen before clicking Continue to proceed to the main installation screen as shown in Figure 3-6:


Rhel 8 installation main screen.png


Figure 3-6

Begin by selecting the Network & Host Name option, enable a network device on your system and enter a host name before clicking the Apply button:


Rhel 8 installation network screen.png


Figure 3-7

If your network connection requires additional settings, click on the Configure... button to access the advanced network settings screen illustrated in Figure 3-8:


Rhel 8 installation advanced networking.png


Figure 3-8

Once the host name has been defined and a network connection enabled, click Done to return to the main screen.

If you wish to change the keyboard, language or time and date settings, select the corresponding option from the Localization column of the main screen. On the Time & Date screen, make a selection corresponding to your geographical location. The option is also provided to use Network Time which automatically synchronizes the system with external Network Time Protocol servers.

Changes to the Installation Source settings should not be necessary since the installation is being performed from local media. To perform the installation from media located on a remote server, select Installation Source, enable the On the network option and then specify the location of the installation media and the type of URL being used. The installation media can, for example, be an ISO image installed either on a remote web server or on a system on the local network using NFS (the topic of NFS file sharing is covered in detail in the chapter entitled “Using NFS to Share RHEL 8 Files with Remote Systems”), or the URL of a remote repository (repositories are essentially online collections of the software, packages and applications that make up the operating system from which installations onto the local system can be performed).

By default, a minimal installation of RHEL 8 will be performed by the installer. This will consist of the minimum set of packages necessary to run the operating system. To select a different installation configuration, choose the Software Selection option to display the screen shown below:


Rhel 8 installation software selection.png


Figure 3-9

Use the left-hand panel to select a basic configuration and the right-hand panel to add any additional packages you know you will need after the system starts up. If the RHEL 8 system is intended to be used with a graphical desktop environment, choose either the Workstation or Server with GUI option. Otherwise, it is generally recommended to start with a minimal system and install additional packages as needed once the system has booted. This avoids installing any packages that may never be needed.

The System Purpose option is optional and does not make any changes to the installation.

The Security Policy option allows additional security packages to be installed on the system that allow security restrictions that comply with the Security Content Automation Protocol (SCAP) standards to be imposed on the system. While selecting a profile from the list installs the necessary packages, the policy restrictions are not enforced until they are enabled on the running system. Unless you work for a government entity or company that mandates this level of security, it is not necessary to select a policy on this screen.

The Kdump feature, when enabled, writes out the state of the operating system kernel in the event of a system crash. This dump file can be useful in identifying the cause of a crash but takes up system memory when enabled. Unless memory is limited on your system, this can be left in the enabled state.

Having configured the basic settings, the next step is to decide how the hard disk drive will be partitioned to accommodate the operating system.

Partitioning a Disk for RHEL 8

When the Installation Destination option is selected, the installer will present a screen similar to the one illustrated in Figure 3-10 below:


Rhel 8 installation destination.png


Figure 3-10

By default, the installer is configured to automatically install the operating system using the available space on the currently selected disk drive and to configure standard partition sizes. If the disk previously contained another operating system, these existing partitions will not be deleted, potentially leaving unused space on the drive after RHEL 8 has been installed. To remove any existing partitions so that they can be reclaimed and used by RHEL 8, enable the I would like to make additional space available option and click on the Done button to display the dialog shown in Figure 3-11.


Rhel 8 installation reclaim space.png


Figure 3-11

To reclaim space, select a partition that is no longer needed and mark it for removal by clicking the Delete button. Once all the partitions that are to be removed have been selected, click on the Reclaim Space button to perform the deletion. The reclaimed space will now be used automatically by the RHEL 8 installer.

To manually configure the layout of the disk in terms of how the available space will be allocated, change the Storage Allocation setting from Automatic to Custom and click Done to display the Manual Partitioning screen (Figure 3-12):


Rhel 8 installation manual partitioning.png


Figure 3-12

The manual partitioning screen provides the option to configure the disk using LVM) or standard partitioning. LVM is the recommended option because it provides flexibility in terms of managing partition sizes once the system is up and running (LVM is covered in detail in the chapter entitled “Adding a New Disk to a RHEL 8 Volume Group and Logical Volume”').

Once a partitioning scheme has been selected, the last step is to decide on the sizes of the partitions and the corresponding filesystem mount points. In general, the default configuration provided by the Click here to create them automatically option will meet most system needs. To manually create partitions and allocate mount points, click on the + button to declare and assign each partition manually.

Another option is to select automatic partition creation, and then use the resulting screen to manually change the partition configuration as needed. Figure 3-13, for example, shows the partition configuration defined by selecting the automatic creation option and allows the settings for each partition to be modified before any changes are made to the disk:


Rhel 8 installation auto partitions.png


Figure 3-13

Once the disk has been configured, click on Done, review the summary of the changes to be made to the disk (Figure 3-14) and click on the Accept Changes button:


Rhel 8 installation partitions summary.png


Figure 3-14

RHEL 8 also allows the contents of the disk to be protected by encryption. This will require a passphrase to be entered each time the system boots. To enable encryption, select the Encrypt my data option on the main Installation Destination screen and, after clicking the Done button, enter the passphrase in the dialog shown in Figure 3-15:


Rhel 8 installation disk encryption.png


Figure 3-15

You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book.

Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($24.99) or Print ($36.99) format

Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages

Buy Print Preview Book

The Physical Installation

Having made the appropriate package selections, clicking Begin Installation will start the process of partitioning the disks and installing the packages that match the chosen installation settings. During this phase, a screen will appear (Figure 3-16) seeking the creation of a root password and an optional user account:


Rhel 8 installation user and password.png


Figure 3-16

The root, or super-user account, is a special user that has administrative privileges on the system. While you will generally use your own account to log into the system, you will need to gain root privileges in order to configure the system and to perform other administrative tasks. Enter a root password, create a user account and wait for the installation to complete.

Once all the system packages have been installed and configured, remove the installation media and click Reboot to restart the system.

Final Configuration Steps

What appears on the console when the system has started up will depend on whether or not the Workstation or Server with GUI option was selected from the Software Selection installation screen. If either of these options was selected during installation, the GDM) login screen will appear. If the minimal or server configuration options were selected, the text based login prompt will be displayed. Regardless of the configuration, log into the system as the user that was created during the final steps of the installation process.

In the case of a Workstation or Server with GUI installation, the GNOME initial setup tool will launch providing configuration options such as language, keyboard layout, location services and connections to online accounts including Google and Facebook. After these settings have been configured (or skipped), the GNOME desktop welcome screen will appear containing links to tutorials on how to use the desktop environment.

Before any updates or additional packages can be installed, the system must be registered with Red Hat. This can be performed at the command prompt or, in the case of the desktop environment, a Terminal window. To launch a Terminal session in the desktop, click Activities in the menu bar (marked A in Figure 3-17), enter Terminal into the search field (B) and select the Terminal launch icon from the results list (C).


Rhel 8 desktop find terminal.png


Figure 3-17

At the prompt, use the su command to gain root privileges:

$ su -

Next, use the subscription-manager tool to register the system with Red Hat, entering your Red Hat Access username and password when prompted to do so:

# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: myusername
Password: 
The system has been registered with ID: 22f0ca3f-8d03-4933-be95-d6c4d8e3fe1a
The registered system name is: rhelserver1.

Finally, attach the system to a subscription service as follows:

# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Subscribed

Installing Updates

As with most operating systems today, each particular release of a RHEL distribution continues to evolve after it has been released to the public. This generally takes the form of bug fixes and security updates and, occasionally, new features that may be downloaded over the internet and installed on your system.

Best practices dictate that the first step after installing RHEL is to make sure any available updates are applied to the system. This can be achieved via the command-line prompt in a Terminal window using the dnf package manager tool. To check for the availability of updates, simply run the following command:

# dnf check-update

Any pending updates may be applied, once again using the dnf tool:

# dnf update

Upon execution, the dnf tool will provide a list of packages that are available for update and prompt for permission to perform the update.

Once the update is complete the installation is essentially finished and RHEL 8 is ready for use.

Summary

The first step in working with RHEL 8 is to install the operating system. In the case of a cloud-based server, this task is typically performed automatically when an operating system image is selected for the system based on a range of options offered by the cloud service provider. Installation on your own hardware, however, involves downloading the installation media in the form of an ISO image, writing that image to suitable storage such as a DVD or USB drive and booting from it. Once running, the installation process allows a range of options to be configured ranging from networking, whether the installation should proceed from the local media or via a remote server or repository, the packages to be installed, and the partitioning of the disk. Once installation is complete, it is important to install any operating system updates that may have been released since the original installation image was created.


You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book.

Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($24.99) or Print ($36.99) format

Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages

Buy Print Preview Book



PreviousTable of ContentsNext
The History of Red Hat LinuxDual Booting RHEL 8 with Windows