You are on page 1of 9

03/09/2021 Eninam - Learning

Friday September 3, 2021


Red Hat Certified System Administration 8
Email: bagnadavid@outlook.fr
Eninam BAGNABANA Phone: (+228) 91 98 48 07
Home Login Courses .... Chapters Exercises Evaluations Quizz
Labs .... .... ....

Chapter 15: Managing Advanced Storage

Sommaire
Understanding LVM
Creating LVM Logical Volumes
Resizing LVM Logical Volumes
Configuring Stratis
Configuring VDO

Understanding LVM

Logical Volume Management (LVM)


www.learning.bg/courses/RHCSA8/index.php?chap=15 1/9
03/09/2021 Eninam - Learning

LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing
logical volumes With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes.
LVM physical volumes can be placed on other block devices which might span two or more disks.

The physical volumes are combined into logical volumes, with the exception of the /boot/ partition. The /boot/
partition cannot be on a logical volume group because the boot loader cannot read it. If the root (/) partition is
on a logical volume, create a separate /boot/ partition which is not a part of a volume group.

Since a physical volume cannot span over multiple drives, to span over more than one drive, create one or
more physical volumes per drive.

You can then access the application by selecting from your menu panel System → Administration →Logical
Volume Management. Alternatively you can start the Logical Volume Management utility by typing system -
config-lvm from a terminal

Basic configuration Steps


when installing OS

1. Create standard partition


/boot

2. Create n physical volumes

3. Create volume group (add n


physical volumes)

4. Create logical volume


mounted on /

5. Create logical volume swap

www.learning.bg/courses/RHCSA8/index.php?chap=15 2/9
03/09/2021 Eninam - Learning

6. Create logical volume


mounted on /home

Commands

[root@redhat ~]# system-config-lvm LVM GUI administration tool

[root@redhat ~]# yum install system-config-lvm install LVM GUI administration tool

There are many commands and management utilities for working with LVM. Here is an overview of them

[root@redhat ~]# pvdisplay Displays detailed information on physical volumes

[root@redhat ~]# vgdisplay Displays detailed information on volume groups

Migrating Data
www.learning.bg/courses/RHCSA8/index.php?chap=15 3/9
03/09/2021 Eninam - Learning

Suppose you have a drive that is old or dying and you’d like to remove it from the system. On a system with
normal partitions, you would have to copy all the data from one disk to another while the disk is offline
(because of file locks). Having LVM makes this easier because you can migrate your data from one disk to
another, even while the disk is online! This capability is very useful when you need to replace a disk. If you
want to replace /dev/hdb because it’s failing, you can use the pvmove command to migrate the physical
extents (which is really your data) to another physical volume (/dev/hdc). Because you removed /dev/hdc
from the volume group in the previous section, you need to add it back.

# pvmove /dev/hdb /dev/hdc

Creating LVM Logical Volumes

Creating Volumes

Steps

1. Create n Physical Volumes


2. Create Volume Group: add n Physical Volumes in a volume Group
3. Create m Logical Volumes

Physical Volume

www.learning.bg/courses/RHCSA8/index.php?chap=15 4/9
03/09/2021 Eninam - Learning

[root@redhat ~]# pvcreate special file Creates a new physical volume

Example

[root@redhat ~]# pvcreate /dev/sdd

Physical volume "/dev/sdd" successfully created

[root@redhat ~]# pvs Displays physical volumes

[root@redhat ~]# pvdisplay Displays detailed information on physical volumes

Volume Group

Creates a new volume group

[root@redhat ~]# vgcreate group_name physical_volume1 physical_volume2 …

Example

[root@redhat ~]# vgcreate MON-VOLUME /dev/sdd /dev/sde /dev/sdf

Volume group "MON-VOLUME" successfully created

Example

[root@localhost ~]# vgcreate MON-VOLUME /dev/sdb1 /dev/sdb2 /dev/sdb3

Volume group "MON-VOLUME" successfully created

Displays volume groups

[root@redhat ~]# vgs

VG #PV #LV #SN Attr VSize VFree


www.learning.bg/courses/RHCSA8/index.php?chap=15 5/9
03/09/2021 Eninam - Learning

MON-VOLUME 3 0 0 wz--n-119.99g119.99g
rhel 1 3 0 wz--n-59.51g 0
[root@redhat ~]# vgdisplay Displays detailed information on volume groups

Logical Volume

Creates a new logical volume

Syntax

[root@redhat ~]# lvcreate Options Volume-Group

Options

-L (size) [M,G]

-p (permissions) [r,rw]

-n (name)

Example

[root@redhat ~]# lvcreate -L 50G -p rw -n LOG-VOL MON-VOLUME

Logical volume "LOG-VOL" created

Commands

[root@redhat ~]# lvs Displays logical volumes

[root@redhat ~]# lvdisplay Displays detailed information on logical volumes

www.learning.bg/courses/RHCSA8/index.php?chap=15 6/9
03/09/2021 Eninam - Learning

Resizing LVM Logical Volumes

vgextend Extends an existing volume group

lvextend Extends a logical volume

lvresize Resizes a logical volume

lvreduce Reduces a logical volume

lvrename Renames a logical volume

pvmove Moves/migrates data from one physical volume to another

vgreduce Reduces a volume group

pvremove Removes a physical volume

vgremove Removes a volume group

[root@rhel8 user1]# lvremove Logical-Volume Removes a logical volume

[root@rhel8 user1]# lvremove /dev/GRP-01/LOG-1

Configuring Stratis

www.learning.bg/courses/RHCSA8/index.php?chap=15 7/9
03/09/2021 Eninam - Learning

Stratis
In RHEL 8, Red Hat has added two advanced storage types: Stratis and VDO.

Stratis is a so-called volume-managing file system, and it introduces advanced storage features that were not
available in previous versions of RHEL:

• Thin provisioning: This feature enables a Stratis file to present itself to users as much bigger than it really is.
This is useful in many environments, such as virtual desktops, where each user may see 20 GiB of available
storage in total although a much lower amount is actually provisioned to each user.

• Snapshots: A Stratis snapshot allows users to take a “picture” of the current state of a file system. This
snapshot makes it easy to revert to the previous state of a file system, rolling back any changes that have
been made.

• Cache tier: Cache tier is a Ceph storage feature that ensures that data can be stored physically closer to the
Ceph client, which makes data access faster.

• Programmatic API: The programmatic API ensures that storage can easily be configured and modified
through API access. This is particularly interesting in cloud environments, where setting up storage directly
from cloud-native applications is extremely useful.

• Monitoring and repair: Whereas old file systems need tools like fsck to verify the integrity of the file system,
Stratis has built-in features to monitor the health of the file system and repair it if necessary.

Stratis Architecture
www.learning.bg/courses/RHCSA8/index.php?chap=15 8/9
03/09/2021 Eninam - Learning

The lowest layer in the Stratis architecture is the pool. From a functional perspective, the Stratis pool is
comparable to an LVM volume group. A pool represents all the available storage and consists of one or more
storage devices, which in a Stratis environment are referred to as blockdev. These block devices may not be
thin provisioned at the underlying hardware level. Stratis creates a /dev/stratis/poolname directory for each
pool.

From the Stratis pool, XFS file systems are created. Note that Stratis only works with XFS, and the XFS file
system it uses is integrated with the Stratis volume. When creating a file system, no size is specified, and
each file system can grow up to the size of all the available storage space in the pool. Stratis file systems are
always thin provisioned. The thin volume automatically grows as more data is added to the file system.

Configuring VDO

VDO

Eninam Learning 2021

www.learning.bg/courses/RHCSA8/index.php?chap=15 9/9

You might also like