Logical Volume Manager (LVM) - adds an extra layer between the physical disks and the file system, which allows you to resize your storage on the fly, use multiple disks, instead of one, etc.
Concepts:
Physical Volume: - Physical Volume represents the actual disk / block device.
Volume Group: - Volume Groups combines the collection of Logical Volumes and Physical Volumes into one administrative unit.
Logical Volume: - A Logical Volume is the conceptual equivalent of a disk partition in a non-LVM system.
File Systems: - File systems are built on top of logical volumes.
What we are doing today:
We have a disk installed on our server which is 150GB that is located on /dev/vdb
, which we will manage via LVM and will be mounted under /mnt
Dependencies:
Update and Install LVM:
1 2 3 4 |
|
Create the Logical Volume:
Initialize the Physical Volume to be managed by LVM, then create the Volume Group, then go ahead to create the Logical Volume:
1 2 3 |
|
Build the Linux Filesystem with ext4 and mount the volume to the /mnt
partition:
1 2 3 |
|
Other useful commands:
To list Physical Volume Info:
1 2 3 |
|
To list Volume Group Info:
1 2 3 |
|
And viewing the logical volume size from the volume group:
1 2 3 |
|
Information about Logical Volumes:
1 2 3 |
|