Install CentOS 7
Installing CentOS 7 Minimal Server
CentOS (Community Enterprise Operating System) is a free open source Linux operating system that has 100% binary comparability with Red Hat Enterprise Linux (RHEL). Because of this compatibility, many organisations have chosen CentOS as their choice of distribution. The following installation guide takes you through the process of installing a minimal server build with custom disk layout and static IP addressing scheme using a CentOS installation image. The following guide may also be used for an installation of RHEL 7 minimal server build. To install CentOS 7/RHEL 7 simply follow the instructions below:
To download your iso image of CentOS 7, simply follow this Link: CentOS 7 Download
Once you have downloaded your chosen iso image of CentOS 7, you will need to burn this to a blank DVD. For software that can do this, search for "dvd iso burning software" in the search box located towards the top of this page. Your computer may already have CD/DVD burning software installed such as "Brasero, K3B, Nero, CDBurnerXP or Roxio". Once you have burned your "iso" image of CentOS 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 the 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 iso image to the relevant folder.
CentOS 7 Installer
To start your installation of Centos 7, simply highlight the "Install CentOS 7" option and press enter. Your installation will now start. You may also test your installation media first (see below)
It is 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 CentOS 7". After a media check, your installation will start.
Welcome to CentOS 7
At this screen you will need to choose the language that you would like to use during the installation process. In this example, "English", "English (United Kingdom)" has been chosen. Once you have made your selection, click on continue.
At this screen various options that can be configured are available. Any options that are highlighted must be addressed before you can continue. It is from this screen that you can configure your Time Zone, Language, keyboard, installation source, additional software add ons, configure disk layout and network settings.
Date and Time
From this screen you you need to choose your location from either the map or the pull down menus. In this example "Europe" and "London" have been chosen. If you have an active internet connection, then your location will probably have been selected for you automatically based on your IP address. You can adjust the time and date by clicking on the relevant arrows in the lower left and 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 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" has been chosen. Click "Done" to continue.
If you have booted from a standard iso image, then no further action is required from this screen. Click on "Done" to continue.
At this screen you can choose which base environment is to be used. In this example, "Minimal Install" has been selected. Any additional "Add-Ons" may be selected from the right hand option menu. In this example, no "Add-Ons" have been selected. Click "Done" to continue.
This screen allows you to configure your disk partitioning layout. Two options are available. "Automatically configure partitioning" and "I will configure partitioning". In this example, I am going to choose the option of manually configuring my partition layout "I will configure partitioning"
For this exercise I am going to create the following partitions using Logical Volume Management: Volume Groups (VG), Logical Volumes (LV) size of partition/file system in MB. 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 to 1000MB as this example system has 2GB of physical memory. The size of our disk 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 right of the screen.
From this screen we can see that we have a "20GB" disk available to create our partitions. This 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.
Create 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.
Adding Additional File systems
To add the remainder of our file systems, simply click on the + Plus button. A pop up box will appear where you can either type the name of the filesystem or select one of the default from the pull down menu. The box contains a pull down for "Mount Point" and Desired Capacity.
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 "centos", 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 (5975MB in this example). The reason we allocate the remaining space to "/spare" is to allow us to easily allocate this space 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. 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 a system 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 the installation.
Configure Network and Hostname
At this screen we can enter the hostname to be used for our server and click on "Configure" to manually configure our network interfaces. 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 simply click on the "OFF/ON" box in the upper right hand corner.
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.
Host name in this box enter a unique name to identify your system on a network. In this example, I will be entering "centos72m".
Click "Configure" to start configuring our network settings.
Configuring a Static IP Address
You should now 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 addressing:
IP Address = 192.168.0.70
Netmask = 255.255.255.0
Gateway = 192.168.0.1
DNS Server = 192.168.0.1
You will need to add your own details that match your network settings.
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
Once all settings have been entered, click "Save" to continue.
Activate Network Interface
To apply our static IP address information to our interface, simply click on the "ON/OFF" button in the upper right of the screen. Your interface should now be active. Click on "Done" to continue.
Once all our configuration settings have been entered, we are ready now to initiate the installation. This is done by clicking on the "Begin Installation" button in the lower right corner of the screen.
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 now specify a root password to be used for administering 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!
From this screen you must define the name of a user. In this example I have also chosen the use 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.
CentOS is now installed, however, you need to click on the "Finish Configuration" button.
CentOS is now 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.
Verify your File systems
You can verify that the file systems that were created have been mounted by issuing the command df -h.
The command "pvs" is used to display our space allocation information. From the output, we can see that there is no space currently available within the Volume Group "sysVG". This is indicated under the column "PFree".
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 allocated back to the "sysVG" Volume group.
The following steps are 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 re-issue the command "pvs". You should now see space available within the Volume Group "sysVG".
Verify IP address
To verify that we have the correct IP address assigned, you can issue the command: ip a s. You should now see output similar to the one below.
Verify Connection to Repositories
To verify that your system can see any "Active" repositories, you may issue the command "yum repolist.
Note if you are installing RHEL 7, then you will need to activate your repositories first by registering you system through the "subscription-management" process.
Details can be found at Register RHEL 7 System