How To Install CentOS 7 by manually Creating LVM Linux Partitions

line5

What Is CentOS?

The CentOS Project is a community-driven free software effort focused on delivering a robust open source ecosystem.

Find more at: https://www.centos.org/

Lab Configuration

In this lab scenario 32 Gb hard disk is used to manually create LVM (Logical Volume Manager) Linux partitions namely boot, swap, root, home, var, srv and tmp. Feel free to adjust the sizes of the partitions accordingly to the requirement of your organization.

TUTORIAL

Firstly download CentOS 7 at https://www.centos.org/download/ and create bootble CD/DVD

Select Install CentOS 7

CentOS 64-bit-2017-05-19-05-42-39

CentOS 64-bit-2017-05-19-05-43-09

Choose the language and press continue

Watermark CentOS 64-bit-2017-05-19-05-44-58

Watermark CentOS 64-bit-2017-05-19-05-52-35

Watermark CentOS 64-bit-2017-05-19-05-52-36.png

Date & Time

CentOS 64-bit-2017-05-19-05-52-45

Language Support

CentOS 64-bit-2017-05-19-05-53-48

Keyboard Layout

CentOS 64-bit-2017-05-19-05-54-04

Installation Source

CentOS 64-bit-2017-05-19-05-54-12

Software Selection

In this scenario minimal install is selected

Watermark CentOS 64-bit-2017-05-19-05-54-21.png

Installation destination

In this tutorial LVM Linux partitions are created manually

If you are going to create the root (/) partition as a LVM, be sure to create a standard /boot partition separately to keep the boot files and the Linux kernel because the system cannot boot form LVM partitions.

Watermark CentOS 64-bit-2017-05-19-06-35-25

Create The Standard Partition

Create a Standard Boot Partition

Mount Point: /boot
Desired Capacity: 250mb
Device Type: Standard Partition
File System: ext4
Label: boot

CentOS 64-bit-2017-05-19-09-18-21

CentOS 64-bit-2017-05-24-01-30-56

CentOS 64-bit-2017-05-24-01-32-18

Press Update Settings

CentOS 64-bit-2017-05-24-01-35-03

Create The New LVM PV And Rest of The Partitions

Root  partition

Mount Point: /
Desired Capacity: 5 GB
Device Type: LVM [new LVM PV should be created – NewLVM-PV]
File System: ext4
Label: root

CentOS 64-bit-2017-05-24-10-31-43

Create a new LVM PV – NewLVM-PV

CentOS 64-bit-2017-05-24-10-32-54

CentOS 64-bit-2017-05-24-10-33-41

CentOS 64-bit-2017-05-24-10-34-17

Swap partition

Desired capacity is calculated according to the system RAM. If the system RAM is less than 2 GB it should be multiplied by 2, if the system RAM is more than 2 GB, should add 500 mb to the system RAM.

EX -:
system RAM is 250 mb —> Desired Capacity is 500 mb [250 mb * 2]
system RAM is 3 GB —> Desired Capacity is 3.5 GB [3 GB + 500 mb]

Mount Point: not mounted or labled
Desired Capacity: 2 GB [since the system RAM is 1 GB, 1 GB mulitiplied by 2]
Device Type: LVM [NewLVM-PV]
File System: swap
Label: swap

CentOS 64-bit-2017-05-24-10-34-40

CentOS 64-bit-2017-05-24-10-35-35

Home partition

Mount Point: /home
Desired Capacity: 4 GB
Device Type: LVM [NewLVM-PV]
File System: ext4
Label: home

CentOS 64-bit-2017-05-24-10-35-57

CentOS 64-bit-2017-05-24-10-36-49

Tmp partition (optional)

Mount Point: /tmp
Desired Capacity: 2 GB
Device Type: LVM [NewLVM-PV]
File System: ext4
Label: tmp

CentOS 64-bit-2017-05-24-10-37-19

CentOS 64-bit-2017-05-24-10-38-01

Var partition (optional) on web and mail servers (LVM)

Mount Point: /var
Desired Capacity: 3 GB
Device Type: LVM [NewLVM-PV]
File System: ext4
Label: var

CentOS 64-bit-2017-05-24-10-38-27

CentOS 64-bit-2017-05-24-10-39-02

Srv partition (optional) on FTP servers (LVM)

Mount Point: /srv
Desired Capacity: 3 GB
Device Type: LVM [NewLVM-PV]
File System: ext4
Label: srv

CentOS 64-bit-2017-05-24-10-39-24

After creating required partitions press Done

Watermark CentOS 64-bit-2017-05-24-10-40-03

Select Accept Changes

Watermark CentOS 64-bit-2017-05-24-10-40-53

Press Begin Installation

CentOS 64-bit-2017-05-24-10-40-58

Configure Root account password to complete installation

last 1

last 2

Press Finish Configuration

last 3

Press Reboot

last 4

After The REBOOT

After the reboot, login to the root account using the password given

CentOS 64-bit-2017-05-24-05-46-10

To view the file system table use the command [find more at: https://www.howtogeek.com/howto/38125/htg-explains-what-is-the-linux-fstab-and-how-does-it-work/]

cat /etc/fstab

A file named /etc/fstab lists the devices (typically hard disk partitions) that are to be mounted at boot time.

CentOS 64-bit-2017-05-24-07-28-32

CentOS 64-bit-2017-05-24-07-24-45

To view users

cat /etc/passwd

CentOS 64-bit-2017-05-24-09-11-42

To view created groups

cat /etc/group

CentOS 64-bit-2017-05-24-10-18-59