Manage Logical Volume in RHEL - RHCSA (RH134).pdf

support8872 512 views 11 slides Sep 28, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

Slides on how to manage logical volumes - Part of RHCSA (RH134) syllabus


Slide Content

Manage Logical Volumes

Logical Volume Management(LVM)
Abstracts physical storage, enabling the creation of flexible logical
volumes



Purpose: Simplify storage
management by allowing easy
resizing and allocation of disk
space

Source: 1.3. LVM Architecture Overview | Red Hat Product Documentation

●Physical Volumes (PVs): Actual disks or partitions

●Volume Groups (VGs): Collection of physical volumes
combined into a single storage pool which can be managed
together

●Logical Volumes (LVs): Virtual partitions created from the
volume group which are used by the operating system


Components of LVM

Source: Volume Management (helios.de)

Add Disk and Create LVM Partition

Pre-requisite: Create a partition on a disk before following these commands

Step 1: Change the partition type from ‘Linux’ to ‘Linux LVM’ just after partition
is created
●Command: t ‘8e’







Note: (‘8e’ is hex code associated with LVM)

Step 2: Install the 'lvm2' package on the machine
●Command: yum install lvm2



Step 3: Create the physical volume
●Command: pvcreate <partition-name>

Step 4: Create the volume group
●Command: vgcreate <volume-group-name> <partition-name>

Step 5: Create the logical volume
●Command: lvcreate -n <logical-volume-name> --size <size>
<volume-group-name>

Step 6: Format this disk and assign file system to it
●Command: mkfs.xfs <logical-volume-path>




Step 7: Mount this disk to a drive
●Command: mount <logical-volume-path> <directory-name>

Extend existing disk using LVM











Pre-requisite: Create another disk partition (type: linux > linux LVM)
Extend existing volume group to new partition
●Command: vgextend <existing-volume-group> <partition-name>

Extend the logical volume
●Command: lvextend -L+<size-to-extend> <logical-volume-path>









Extend the file system
●Command: xfs_growfs <logical-volume-path>