Install RHEL7 or CentOS7 on a PC

Installing RHEL7 or CentOS7

Installing RHEL7 or CentOS7 on a PC is fairly easy to do. In this tutorial, we will review the installation process step-by-step. Today’s focus will be the Red Hat Enterprise Linux (RHEL) operating system.

Table of Contents

Introduction

Although, the Community Enterprise Operating System or CentOS Linux install process is essentially the same–one major difference between RHEL7 and CentOS7 is that Redhat is a paid product.
Hands on a keyboard

Image by Oleg Magni from Pexels

Pre-Installation Checks

However, Redhat does offer a 60-day trial period for learning and testing purposes. Also, this tutorial assumes you have a personal computer or PC available to install RHEL7. If this is true, proceed to the next step and download the RHEL7 ISO from the Redhat website.
Redhat 60-day trial

Photo by admingeek from Redhat

Download the latest RHEL7 ISO

Before we can download the ISO, we need to register for an account with Redhat by filling out our name, address, phone, email, and other personal details. In addition, we will be creating a user account name and set its password. After completing the required information and accepting Redhat’s terms and agreements, by default Redhat will automatically pop up the very latest ISO release for download (RHEL8.5 at the time of this publication).

Download the latest CentOS7 ISO

Downloading the CentOS7 ISO is pretty straightforward as well. We can download a copy of the ISO by using the wget command (below) or visiting the centos.org website.

				
					[admin@vm1:~] $ wget http://mirror.umd.edu/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Everything-2009.iso
				
			

However, as we mentioned earlier in this post, our focus will be the RHEL7 installation.

Redhat Download Selection

Photo by admingeek from Redhat

Click the start here link to go to Redhat’s download page. Then, click the Switch to Version 7 and Below link to go to the RHEL7 download page.

Redhat Download Page

Photo by admingeek from Redhat

Scroll down and select the binary DVD option circled in red below. This will initiate the download of the rhel-server-7.9-x86_64-dvd.iso.

Redhat Download Page

Photo by admingeek from Redhat

Create a bootable USB flash drive

Now that the ISO is downloaded, we need to copy it to a media device (in this case, a USB flash drive) and make it bootable so we can install RHEL7 on our PC. One way to do this is by executing the data definition or dd command on a Linux machine.

Preparing a USB flash drive

  • Insert the USB flash drive into a USB port on your Linux Machine (In this example, we’re using an 8GB flash drive)
  • Run the df command and you should see the USB device mounted under the /media partition. 
  • NOTE: if you do not find the USB auto-mounted after running the df command, you can run the fdisk -l command to locate the device. The image below shows our USB Drive mapped to /dev/sdd. Typically, you’d expect to see it mapped to /dev/sdb but, we have other external devices attached to this machine as well; /dev/sdd is the next available drive name.  
Output of the fdisk -l command

Photo by admingeek from Infotechys

Preparing the ISO

After we’ve located our USB flash drive, we can copy the rhel-server-7.9-x86_64-dvd.iso we downloaded to the flash, by executing the dd command to make it bootable (below).

				
					[admin@vm1:~]$ sudo dd if=~/rhel-server-7.9-x86_64-dvd.iso of=/dev/sdd bs=1M status=progress
1245347234 bytes (1.4 GB, 1.4 GiB) copied, 104 s, 23.4 MB/s
4512022528 bytes (4.5 GB, 4.2 GiB) copied, 272 s, 16.6 MB/s
4317+0 records in
4317+0 records out
4526702592 bytes (4.5 GB, 4.2 GiB) copied, 272.945 s, 16.6 MB/s
				
			

Add the status=progress option to the dd command to output the copy in progress to your terminal.

RHEL7 Pre-Installation Steps

When the copy is complete, remove the USB flash drive and insert it into the new PC to begin the installation. Power on the new PC and press one of the function keys (F keys) to get to the boot menu. Depending on your type of PC, the function keys will vary (see the table below listing popular PC and laptop brands and their respective function keys required to get to the one-time boot menus (below):

Popular PC/Laptop Brands

Function Keys

Hewitt Packard (HP)

F9

DELL

ESC + F12 or F12

ACER

ESC + F9, F12

Hewitt Packard (HP) Compaq

F10

Lenovo

F12

ASUS

ESC or F8

Toshiba

F12 or F2

IBM

F12

NEC

F2

Hewitt Packard (HP) Proliant

F11

RHEL7 Installer Screen

Select the option to boot from the USB flash drive to get to the Redhat Installer Screen (below). Your machine will begin to load the Redhat Installer Screen.

Press the UP arrow to highlight the Install Red Hat Enterprise Linux 7.9 option and press the ENTER key.

Redhat Installer Screen

Photo by admingeek from Infotechys

The installer will load to the Welcome to Red Hat Enterprise Linux 7.9 page with the English (United States) language option selected by default. Select the language you’d like to proceed with or press the continue button to go with the default option.

Redhat Language Selection Screen

Photo by admingeek from Infotechys

Next, we are presented with the INSTALLATION SUMMARY screen.

Here we can select what software package we want to install by choosing the SOFTWARE SELECTION. Also, notice that “Automatic partitioning is selected” by default for the INSTALLATION DESTINATION option, and the NETWORK & HOST NAME option is currently set to “Not connected”.

We will address all three of these options below.

Red hat Installation Summary

Photo by admingeek from Infotechys

By default, the SOFTWARE SELECTION is set to a Minimal Install. However, we can choose to go with any number of software packages as displayed in the image below.

Redhat Software Selection

Photo by admingeek from Infotechys

For demonstration purposes, we will go with the default option for the SOFTWARE SELECTION or the Minimal Install option and proceed to the INSTALLATION DESTINATION section.

Redhat Installation Destination Page

Photo by admingeek from Infotechys

In the Installation Destination section, we are going to make some changes to the way our 100GB disk is partitioned. In other words, we will not be going with the automatically selected partitions. Therefore, ensure the disk with the checkmark and the “I will configure partitioning” options are both selected (circled in red above).

NOTE: The selected /dev/vda device indicates we’re performing our installation on a virtual disk. You should see a different device name because you’re installing RHEL7 on a PC.

Disk partitioning using LVM

Before we proceed with disk partitioning, lets examine the image below. 

  • As you can see, when opting for the automatic partitioning, half of the available storage is allocated to the /root partition, and the remaining half is roughly allocated to the swap, /boot, and /home partitions with the majority of the available space assigned to /home.
  • Also, we can see that Logical Volume Manager (LVM) is used to provision those partitions with the exception of /boot which needs to be a standard partition.
  • Finally, the volume group name is rhel_vm4-dev-infotechys, this is the default option which adds “rhel”+ “hostname”. In this case, we provided the hostname: vm4-dev-infotechys as we will observe in the (Network & Host Name) section.
Redhat Manual Partitioning

Photo by admingeek from Infotechys

Partition specifications

The manual disk partitioning procedure will include the following changes:

  1. Change the volume group name from rhel-vm4-dev-infotechys to vg00
  2. Allocate 25GB of storage space to the /root partition
  3. Allocate 12GB of storage space to the /home partition
  4. Allocate 2GB of storage space to the /boot partition
  5. Allocate 4GB of storage space to the swap partition
  6. Allocate the remaining available space (roughly 60GB in our case, yours will be different) to the /extras partition. We can use this partition for extending or creating logical volumes as we see fit in the future.

Changing the volume group name

Changing the volume group name is a fairly easy procedure but, first, we need to ensure that all existing partitions are wiped from the disk as (seen in the image below). Click the minus (“-“) sign at the bottom of screen until all existing partitions are deleted. At completion, all of your disk space should now be available to be partitioned.

Manual Disk Partitioning

Photo by admingeek from Infotechys

As you can see (above), LVM is the default partitioning scheme selected. Click the plus (“+”) sign to proceed with creating a partition. We will change the volume group name as part of this process.

create the root partition

Photo by admingeek from Infotechys

Click the down arrow next to the text box labeled “Mount point:” and select the “/” for the root partition (as shown above). Then, enter the size you want allocated to root in the “Desired Capacity:” text box. In our case, we’ll go with 25GiB and click the Add mount point button to continue.

Redhat manual partitioning

Photo by admingeek from Infotechys

To Change the volume group name, click the down arrow next to the Volume Group and click the “Create a new volume group” option. Then, enter the new name in the text box labeled Name: and click the “Save” button to continue.

Redhat Manual Partitioning

Photo by admingeek from Infotechys

You’ll notice the volume group name has changed to vg00. Now, we can proceed to creating the /home partition. Click the “+” sign to create a new partition and select the /home partition–allocate 12GiB of storage to it.

Redhat Manual Partitioning

Photo by admingeek from Infotechys

Next, repeat the same steps for creating the remaining partitions: Allocate 2GB to /boot, 4GB to swap, and the remaining storage to /extras. When provisioning the /extras partition, enter /extras into the text box labeled “Mount point:” as it is not listed in the drop down menu.

Click the “Done” button and the “Accept Changes” button to continue.

Redhat Manual Partitioning

Photo by admingeek from Infotechys

Hostname and Networking Configurations

Now that we have set the disk partitions and opted to go with the minimal install, we can proceed with configuring the hostname and network settings. For the purposes of this demonstration, we’ll keep things simple and go with DHCP for the network setting. Also, in the hostname text box at the bottom of the page, enter the hostname you’d like to use.

Click the “Apply” button to set the hostname.

NOTE: The hostname was populated for us by default, because we entered DNS records for this machine prior to creating this post.

Click the switch at the top right-hand corner of the screen (circled in red) to “ON”. Turning on the DHCP option, sets the IP address, subnet mask, default route, and DNS address for your machine automatically. Click the “Done” button to continue.

Network and hostname settings

Photo by admingeek from Infotechys

Begin the RHEL7 Installation

Now that we’ve configured the hostname and network settings, we can proceed with the install. Click the “Begin Installation” button to continue.
Red Hat Installation in Progress

Photo by admingeek from Infotechys

Configuring the User Settings

As part of the reboot process, we’ve set the root user password and an administrative user account called admin. After the installation is complete, click the reboot button to continue.

Redhat reboot page

Photo by admingeek from Infotechys

Your machine should boot past the grub menu and get you to the login console.

Grub Menu

Photo by admingeek from Infotechys

Log onto your RHEL7 machine with your user name and password.

Login Console

Photo by admingeek from Infotechys

Conclusion

Congratulations!! You’ve now completed the installation of RHEL7 on your PC. The same steps (with a few changes) apply to the CentOS7 installation. In fact, we may post a CentOS7-specific installation tutorial based on the feedback we receive from you. Was this article helpful to you? Are there any Linux-related topics you’d like us to write about? If so, leave us a comment below. We’d love to hear from you!  

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *