Extending Existing Logical Volumes On Red Hat 7 Enterprise
Extending Existing Logical Volumes On Red Hat 7 Enterprise
Lab
Extending
Existing
Logical
Volumes
Contents Related Courses
Introduction 1
Red Hat CSA 7
Setting Up the Volumes 1
Working with
Logical Volumes
Extending Logical
Volumes, and Swap
to a System Non-
Destructively
Need Help?
Linux Academy
Community
• Username: linuxacademy
• Password: 123456
• Root Password: 123456
Extending Existing Logical Volumes Linux Academy
Introduction
In a previous lab, we learned how to use the Logical Volume Manager (LVM) to create and manage
logical volumes. In this lab, we review these concepts and then learn how to extend and move volume
groups, physical extents, and logical volumes.
This lab contains three physical disks attached to the lab server that need to be configured with LVM.
Before you begin, log into your server, and switch to the root user or prepend the below commands with
sudo as a superuser.
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xc1ab6071.
Syncing disks.
-1-
Extending Existing Logical Volumes Linux Academy
-2-
Extending Existing Logical Volumes Linux Academy
Create a new disk using gdisk for the /dev/xvdg disk; use the entire disk for a single parition:
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Extend the volume group, and display to ensure it has extended properly:
-3-
Extending Existing Logical Volumes Linux Academy
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 2
Act PV 2
VG Size 39.99 GiB
PE Size 4.00 MiB
Total PE 10238
Alloc PE / Size 256 / 1.00 GiB
Free PE / Size 9982 / 38.99 GiB
You may have noticed that in this section we used gdisk and not fdisk, creating a GPT partition
(compared to fdisk’s MBR). We can migrate old MBR disks to GPT since we can copy the physical
extends from one partition to the other.
If you navigate to the mounted directory (/mnt/mymount) you can see that your files are still there.
Although the files were written on the xvdf1 disk, because we moved them off the initial group, they are
still available.
-4-
Extending Existing Logical Volumes Linux Academy
Now if you perform df -h on your system, you can see that the system still has not read the changes we
have made. To fix this, we need to resize the file system:
Notice the use of the mount location and not the volume name.
-5-