6.9 Manage and configure LVM (Logical Volume Manager) storage
Introduction:
LVM (Logical Volume Manager) is a powerful storage management solution for Linux systems that allows administrators to manage disk space more flexibly by abstracting physical storage devices into logical volumes. Here's an overview of some common LVM commands and their usage:
lvmdiskscan: This command scans all disks visible to the system and provides information about them, including the device name, size, and type of partition table. It's useful for identifying available disks to be used with LVM.
lvmdiskscan
pvcreate: This command initializes physical volumes (disks or partitions) to be used by LVM.
pvcreate /dev/sdb1
vgcreate: This command creates a volume group, which is a collection of physical volumes. Volume groups are used as a pool of storage from which logical volumes are created.
vgcreate myvg /dev/sdb1
lvcreate: This command creates logical volumes within a volume group. Logical volumes are like partitions but with more flexibility in terms of resizing and management.
lvcreate -n mylv -L 10G myvg
pvs: This command displays information about physical volumes, including their size, free space, and volume group membership.
pvs
vgs: This command displays information about volume groups, including their size, free space, and associated physical volumes.
vgs
lvs: This command displays information about logical volumes, including their size, associated volume group, and mount point (if applicable).
lvs
These commands provide the basic building blocks for managing and configuring LVM storage. With LVM, administrators can dynamically resize logical volumes, add or remove physical volumes from volume groups, and perform various other storage management tasks without downtime.
Subscribe to my newsletter
Read articles from Vijay Kumar Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Vijay Kumar Singh
Vijay Kumar Singh
I'm Vijay Kumar Singh, a Linux, DevOps, Cloud enthusiast learner and contributor in shell scripting, Python, networking, Kubernetes, Terraform, Ansible, Jenkins, and cloud (Azure, GCP, AWS) and basics of IT world. ๐ปโจ Constantly exploring innovative IT technologies, sharing insights, and learning from the incredible Hashnode community. ๐ On a mission to build robust solutions and make a positive impact in the tech world. ๐ Let's connect and grow together! #PowerToCloud