LVM (Logical Volume Manager)

Describes what is LVM (Logical Volume Manager) on Linux systems. Commands are provides on how to display LVM related information.

What Is LVM (Logical Volume Manager)? - LVM is a storage manager that allows you to create a single or multiple logical storage volumes across multiple physical disks or partitions.

There are 3 basic concepts used by LVM:

The diagram (source: opensource.com) below provides a good illustration of how PV, VG and LV work together to support file systems.

LVM (Logical Volume Manager)
LVM (Logical Volume Manager)

Here are some commands you can use to display LVM related information on your CentOS computer:

1. List PVs with "fdisk -l" command.

herong$ sudo fdisk -l | grep LVM
/dev/sda7       1750822912 1953523711  202700800  96.7G 8e Linux LVM

2. List VGs with "vgs" command. The output shows that I have 1 VG called "cl" running on 1 PV and serving 3 LV. The total size of the VG is 96.65 GB.

herong$ sudo vgs
  VG #PV #LV #SN Attr   VSize  VFree
  cl   1   3   0 wz--n- 96.65g    0

3. List VGs with "lvs" command. The output shows that I have 3 LVs "home", "root" and "swap", created on the "cl" Volume Group.

herong$ sudo lvs
  LV   VG Attr       LSize  Pool Origin Data%  Meta%  Move Log
  home cl -wi-ao---- 38.94g
  root cl -wi-ao---- 50.00g
  swap cl -wi-ao----  7.71g

4. List LVs mounting points with the "df" command. "cl-root" and "cl-home" LVs are mounted. "cl-swap" is not mounted.

herong$ df | grep cl
/dev/mapper/cl-root    52403200  24618844  27784356  47% /
/dev/mapper/cl-home    40813088   6703912  34109176  17% /home

Table of Contents

 About This Book

 Introduction to Linux Systems

 Cockpit - Web Portal for Administrator

 Process Management

 Files and Directories

 Users and Groups

File Systems

 "df" - Display Free Space of File System

 Mount USB Drive as File System

 "fdisk" - Format Disk Partitions

 "dd" - Copy Data from/to Storage Devices

 Use "dd" Command to Test I/O Speed

 "hdparm" - Hard Disk Parameters

 "du" - Display Disk Usage of Directories

 Mount Windows NTFS File System

 Access Persmissions on "ntfs-3g" File System

 Mount Windows Shared Folders

 W95 Ext'd (LBA) Partition

 File System Types, IDs and Formats

LVM (Logical Volume Manager)

 "parted" - Partition Manipulation Program

 Reformat NTFS Partition into EXT4 Partition

 Unreachable Remote File Systems

 Installing CentOS

 SELinux - Security-Enhanced Linux

 Network Connection on CentOS

 Software Package Manager on CentOS - DNF and YUM

 Running Apache Web Server (httpd) on Linux Systems

 Running PHP Scripts on Linux Systems

 Running MySQL Database Server on Linux Systems

 Running Python Scripts on Linux Systems

 vsftpd - Very Secure FTP Daemon

 Postfix - Mail Transport Agent (MTA)

 Dovecot - IMAP and POP3 Server

 Email Client Tools - Mail User Agents (MUA)

 GCC - C/C++ Compiler

 Conda - Environment and Package Manager

 Tools and Utilities

 References

 Full Version in PDF/EPUB