Installing Red Hat Enterprise Linux 7
Red Hat Enterprise Linux (RHEL) is a Linux Operating System developed by Red Hat. RHEL is generally aimed at the commercial market. Red Hat Enterprise Linux is available for multiple platforms including x86, x86_64, PowerPC, IBM pSeries and IBM System z (Mainframe). If you wish to try RHEL 7, you can download an evaluation copy giving you a full 30 day free trial (including updates). (Please note RHEL 7 has now been superseded by RHEL 8.) The following Red Hat Installation guide can be used for installing a Red Hat 7 Minimal Server configuration with a custom disk and Static IP addressing scheme. To register and download your evaluation copy of Red Hat Enterprise Linux, simply follow this Link: Download RHEL
Once you have downloaded your chosen image of RHEL 7 that matches your architecture, you will need to burn this to a blank DVD or if you are using a Virtual System, place the "iso" image in the relevant location that can be accessed by your Virtual System. Once you have burned your "iso" image of RHEL 7 to your DVD, you will need to leave the DVD in the DVD drive and reboot your system. (Assuming that this machine is your intended target system for installation). As your computer reboots, you will need to press the appropriate key to access your system's BIOS settings. On many systems this key will be "F8", "F11" or "F12". Most systems will display a message indicating which key needs to be pressed. Once you have access to your BIOS settings, you will need to modify the boot sequence order of your system to boot from CD/DVD first. Once you have made this change, you can reboot your system and follow the instructions below. If you are installing into a Virtual environment, simply copy the downloaded "iso" image to the relevant folder/data store.
RHEL 7 Installer
To start your installation of RHEL 7, highlight the "Install Red Hat Enterprise Linux 7.x" option and press enter. Your installation will now start.
Testing the media
I would always recommended that you test your media before carrying out an installation for the first time. If you wish to test your media, choose the option "Test this media and install Red Hat Enterprise Linux 7.x". After a media check, your installation will start automatically.
Welcome to Red Hat Enterprise Linux 7
At this screen you will need to choose the language that you would like to use during your installation. In this example, "English", "English (United Kingdom)" has been selected. Once you have made your selection, click on continue in the lower right hand corner of the screen.
At this screen various configuration options are available. Any option that is highlighted must be addressed before you can continue with your installation. It is from this screen that you can configure your Localization settings, Security Policy, Software and System settings.
Date and Time
From this screen you need to choose your geographic location from either the map or from the pull down menu. In this example "Europe" and "London" have been selected. You can adjust the time and date by clicking on the relevant arrows in the lower left and lower right hand corners of the screen. You may also configure your system to use "NTP" for time synchronisation by clicking on the small gear icon in the upper right corner. (see step below)
If you have chosen to use a NTP server for time synchronisation, then you will need to add the address/name of the server you wish to use. Before this step can be configured, you will need to configure your Network Settings first!
Your keyboard settings may be configured from this screen. Additional keyboard layouts may be added if required. If you have added additional keyboard layouts, you can move your chosen layout to the top of the list to make this the new default layout. The layout configuration may be tested by typing into the text box in the upper right hand corner. To add/delete or move layouts, simply use the relevant arrow keys in the lower left hand corner of the screen. Once you have made any changes, click on the "Done" button in the upper left hand corner of the screen.
At this screen you need to verify or choose your Language settings. In the example, "English", "English (United Kingdom)" has been chosen. Click "Done" to continue.
If you have booted from the standard "iso" image of RHEL 7, then no further action is required at this screen. Click on "Done" to continue with your installation.
At this screen you can choose which "Base Environment" is to be used for your installation. Several server configurations are available. You should choose the option that best matches your requirements. In this example, "Minimal Install" has been selected. Any additional "Add-Ons" that are available may be selected from the right hand options panel. In this example, no "Add-Ons" have been selected. Click "Done" to continue with your installation.
This screen allows you to configure your disk partitioning layout. Two options are available. "Automatically configure partitioning" and "I will configure partitioning". For this installation of RHEL 7, I am going to choose the option of manually configuring the disk partition layout "I will configure partitioning". For this installation of Red Hat Enterprise Linux, I am going to create the following partition scheme using Logical Volume Management: Volume Groups (VG), Logical Volumes (LV) size of partition/file system in MB. You may wish to size your partitions/file systems differently to match your requirements. Note, as a rule of thumb, the swap size should be half the size of the physical memory. In this example I have set the swap size to be 1000MB as this RHEL system has 2GB of physical memory. The size of the disk used in this exercise has a capacity of 20GB.
|Mount Point||VG Name||LV Name||Size|
Once you have selected the option "I will configure partitioning", click on the "Done" button in the upper left hand corner of the screen.
At this screen we can see that we have a "20GB" disk available to create our partitions/file systems. Available space is indicated in the lower left of the screen. To start creating our partitions and file systems, we will need to click on the "+" plus button in the lower left hand corner of the screen.
Add a New Mount Point
Each time you click on the click on the "+" plus button in the lower left hand corner of the screen, you will be presented with a small pop up menu. It is from this menu that you can select the "Mount Point" or enter the name of a mount point to create. You also need to specify the "Desired Capacity" to be used with each mount point. Values can be added as "GB" or "MB".
Create a Boot Partition
The first partition we are going to create is the boot partition. The "Mount Point" can be selected from the drop down menu and the desired capacity can by typed into the "Desired Capacity" box. Once the details have been entered, click on "Add Mount Point". Notice, the Device Type is set to "Standard Partition" for a boot partition. A size of 500MB was specified in this example.
Adding additional Filesystems
To add the remainder of our file systems, simply click on the "+" Plus button. Enter the appropriate values as per the table above. In this exercise we are going to change the default name of the Volume Group to be "sysVG". The last filesystem to be created will be "/spare".
The remainder of all file systems will have a Device Type of "LVM" a Volume Group of "sysVG". To change the name of the default Volume Group from "rhel", click on the "Modify" button. A Volume Group configuration box will appear. Simply change the name from the default to "sysVG". The Logical Volume name is entered into the box "Name". For example, if you are creating the "/spare" filesystem, then the name "spareLV" will be used.
You will notice that a filesystem called "/spare" is to be created. This file system is created last as we are going to assign all remaining space to this filesystem. To allocate the remaining space to this filesystem, simply leave the "Desired Capacity" value empty. The reason we allocate the remaining space to "/spare" is to allow us to easily allocate this space back to the Volume Group "sysVG". Once the system is built, we can remove this filesystem and all space will be then available to our system Volume Group "sysVG". This space can then be given to any of the file systems within the Volume Group "sysVG". Details of how to reclaim this space will be covered later. Once you have configured all the file systems, you should end up with a layout similar to the one below. Once you are happy with your configuration, click on "Done" to continue.
Summary of Changes
A summary of changes will now be displayed. If you need to make any modifications, then select "Cancel and Return to Custom Partitioning". To continue, click on the "Accept Changes" button.
"Kdump" is a mechanism that will allow in the event of a system crash information to be collected for determining the cause of the crash. In this example, I have chosen to "Disable" kdump. To disable "kdump", un-check the "Enable Kdump" option. Now click "Done" to continue with your installation.
Configure Network and Hostname
At this screen you can enter the "hostname" to be used for your server and click on "Configure" to manually configure your network interface(s). To update the screen with the newly entered hostname, click on the "Apply" button. If you do not wish to assign a static IP address to your system and you wish to use "DHCP" for the automatic allocation of an IP address, then you can click on the "OFF/ON" box in the upper right hand corner of the screen.
In this example, we are going to assign a Static IP address. Generally all servers normally require a static IP address. This is an address that is assigned specifically to your server and will not change after a restart/reboot of your system.
Host name in this box enter a unique name to identify your system on your network. In this example, I have entered "rhel75a". Click "Apply" to update.
Click "Configure" to start configuring your network settings.
Configuring a Static IP address
Next, you should see a "Pop-Up" menu where we are going to add our IP address, Netmask, Gateway and DNS server information. In the following example I will be using the following Network Addressing Scheme:
IP Address = 192.168.0.88
Netmask = 255.255.255.0
Gateway = 192.168.0.1
DNS Server = 18.104.22.168
You will need to enter your own details here. (Modify where applicable)
From the "Tabs" across the top of the menu, select "IPv4 Settings"
From the "Method" pull down menu, select "Manual"
Now click in the Address, Netmask and Gateway boxes and enter your settings.
Finally, give the name of your DNS Server (IP Address)
If your server is part of a domain, you can specify the order of which Domains should be searched first.
Once all settings have been entered, click "Save" to continue.
Activate Network Interface
To apply our static IP address information to our interface, click on the "ON/OFF" button in the upper right of the screen. Your interface should now activate. Confirmation of your active addressing information is displayed. Click on "Done" to continue with your installation.
From this screen you can select a policy that matches your needs. Various options are available or the entry can be left blank. Click "Done" to continue.
Once all configuration settings have been entered, we are now ready to initiate the installation. This is done by clicking on the "Begin Installation" button in the lower right corner of the screen.
User Account Configuration
The next section of this installation involves defining the root password and creating a new user. Click on each of the highlighted options in turn to enter the requested information. Whilst you are entering the requested details, the installation will continue in the background.
You must specify a root password to be used for the administration of your system. Note, if you supply a weak password, you will be asked to press "Done" twice to confirm you have chosen a weak password! The strength of your password is also indicated.
From this screen you must define the name of a user. In this example I have also chosen the user to be an "Administrator". Again, if you supply a weak password, you will be asked to confirm this. Once you have supplied the relevant credentials, simply click "Done" to continue with the installation. It is strongly recommended that you use the "default" option of "Require a password to use this account".
Red Hat Enterprise Linux has now been successfully installed. Your system needs to be re-booted before you can use it. Click on "Reboot" to finalise your installation. Remember to remove any media from your drives.
At this screen you can now login to your server with the accounts you created earlier.
You can verify that the file systems that were created earlier have been mounted by issuing the command df -hT.
Reclaim space by removing /spare
One of the earlier steps within the installation process was to assign any remaining space to a file system called /spare.
We are now going to remove this filesystem and the space will be released back to the "sysVG" Volume Group.
The following steps need to be followed to free this space:
Unmount the filesystem "/spare" by issuing the command: umount /spare
Remove the Logical Volume "spareLV" by issuing the command: lvremove /dev/sysVG/spareLV
Edit the file /etc/fstab and remove the following line:
/dev/mapper/sysVG-spareLV /spare xfs defaults 0 0
You can issue the command "pvs". You should now see space available within the Volume Group "sysVG" (6.48GB).
[root@rhel75a ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 sysVG lvm2 a-- 19.53g 0 [root@rhel75a ~]# [root@rhel75a ~]# umount /spare [root@rhel75a ~]# [root@rhel75a ~]# lvremove /dev/sysVG/spareLV Do you really want to remove active logical volume sysVG/spareLV? [y/n]: y Logical volume "spareLV" successfully removed [root@rhel75a ~]# [root@rhel75a ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 sysVG lvm2 a-- 19.53g 6.48g
Display assinged IP Address
To verify that we have the correct IP address that we assigned, you can issue the command: ip a s. You should now see output similar to the one below.
[root@rhel75a ~]# ip a s 1: lo:
mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 08:00:27:10:fd:ae brd ff:ff:ff:ff:ff:ff inet 192.168.0.88/24 brd 192.168.0.255 scope global noprefixroute enp0s3 valid_lft forever preferred_lft forever inet6 fe80::4a17:43ad:381d:6f66/64 scope link noprefixroute valid_lft forever preferred_lft forever
Register Installation with Red Hat
Before you can access any repositories from the Red Hat Network, you will need to register your system. In the example that follows, I will be registering a 30 day evaluation copy of RHEL 7.5 which will provide 30 days of updates.
[root@rhel75a ~]# subscription-manager register Registering to: subscription.rhsm.redhat.com:443/subscription Username: xxxxxxxxxxxx Password: The system has been registered with ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx The registered system name is: rhel75a
List Available Subscriptions
To list available subscriptions you can issue the command: subscription-manager list --available
[root@rhel75a ~]# subscription-manager list --available +-------------------------------------------+ Available Subscriptions +-------------------------------------------+ Subscription Name: 30 Day Red Hat Enterprise Linux Server Self-Supported Evaluation Provides: Red Hat Container Images Red Hat Ansible Engine Oracle Java (for RHEL Server) Red Hat Enterprise Linux Atomic Host Beta Red Hat Enterprise Linux Server Red Hat Enterprise Linux Atomic Host Red Hat Container Images Beta Red Hat Beta SKU: RHXXXXX Contract: XXXXXXXX Pool ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Provides Management: No Available: 2 Suggested: 1 Service Level: Self-Support Service Type: L1-L3 Subscription Type: Instance Based Ends: 14/05/18 System Type: Physical
From the above we can see that we have a 30 day evaluation Subscription for RHEL 7.5
Add a subscription
To add a subscription to our server we need to issue the following "subscription-manager" command along with the "Pool ID" that was obtained from the above output:
[root@rhel75a ~]# subscription-manager subscribe --pool=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Successfully attached a subscription for: 30 Day Red Hat Enterprise Linux Server Self-Supported Evaluation
Verify Connection to Repositories
Now that you have activated your repositories, you can issue the "yum repolist command to confirm this.
[root@rhel75a ~]# yum repolist Loaded plugins: product-id, search-disabled-repos, subscription-manager repo id repo name status rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 20,111 rhel-7-server-rt-rpms/7Server/x86_64 Red Hat Enterprise Linux for Real Time (RHEL 7 Server) (RPMs) 288 repolist: 20,399
Update your System
Whenever you build a new system, it is always a good idea to check if there are any updates available. To check for updates, enter the command "yum list updates". For a full list of "yum commands", follow the link yum commands
root@rhel75a ~]# yum list updates Loaded plugins: product-id, search-disabled-repos, subscription-manager Updated Packages krb5-libs.x86_64 1.15.1-19.el7 rhel-7-server-rpms selinux-policy.noarch 3.13.1-192.el7_5.3 rhel-7-server-rpms selinux-policy-targeted.noarch 3.13.1-192.el7_5.3 rhel-7-server-rpms subscription-manager.x86_64 1.20.11-1.el7_5 rhel-7-server-rpms subscription-manager-rhsm.x86_64 1.20.11-1.el7_5 rhel-7-server-rpms subscription-manager-rhsm-certificates.x86_64 1.20.11-1.el7_5 rhel-7-server-rpms tzdata.noarch
Install Available Updates
If you have followed the above process and updates are available to your system, then these can be installed by running the command "yum update". The example below is an extract from the output from this command. To install the updates, reply "y" at the prompt when asked.
[root@rhel75a ~]# yum update Loaded plugins: product-id, search-disabled-repos, subscription-manager Resolving Dependencies --> Running transaction check ---> Package krb5-libs.x86_64 0:1.15.1-18.el7 will be updated ---> Package krb5-libs.x86_64 0:1.15.1-19.el7 will be an update ---> Package selinux-policy.noarch 0:3.13.1-192.el7 will be updated ---> Package selinux-policy.noarch 0:3.13.1-192.el7_5.3 will be an update ---> Package selinux-policy-targeted.noarch 0:3.13.1-192.el7 will be updated ---> Package selinux-policy-targeted.noarch 0:3.13.1-192.el7_5.3 will be an update ---> Package subscription-manager.x86_64 0:1.20.10-1.el7 will be updated ---> Package subscription-manager.x86_64 0:1.20.11-1.el7_5 will be an update ---> Package subscription-manager-rhsm.x86_64 0:1.20.10-1.el7 will be updated ---> Package subscription-manager-rhsm.x86_64 0:1.20.11-1.el7_5 will be an update ---> Package subscription-manager-rhsm-certificates.x86_64 0:1.20.10-1.el7 will be updated ---> Package subscription-manager-rhsm-certificates.x86_64 0:1.20.11-1.el7_5 will be an update ---> Package tzdata.noarch 0:2018c-1.el7 will be updated ---> Package tzdata.noarch 0:2018d-1.el7 will be an update --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================= Package Arch Version Repository Size ================================================================================================================= Updating: krb5-libs x86_64 1.15.1-19.el7 rhel-7-server-rpms 748 k selinux-policy noarch 3.13.1-192.el7_5.3 rhel-7-server-rpms 453 k selinux-policy-targeted noarch 3.13.1-192.el7_5.3 rhel-7-server-rpms 6.6 M subscription-manager x86_64 1.20.11-1.el7_5 rhel-7-server-rpms 993 k subscription-manager-rhsm x86_64 1.20.11-1.el7_5 rhel-7-server-rpms 285 k subscription-manager-rhsm-certificates x86_64 1.20.11-1.el7_5 rhel-7-server-rpms 200 k tzdata noarch 2018d-1.el7 rhel-7-server-rpms 481 k Transaction Summary ================================================================================================================= Upgrade 7 Packages Total download size: 9.6 M Is this ok [y/d/N]: