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:

  1. 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
    
  2. pvcreate: This command initializes physical volumes (disks or partitions) to be used by LVM.

     pvcreate /dev/sdb1
    
  3. 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
    
  4. 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
    
  5. pvs: This command displays information about physical volumes, including their size, free space, and volume group membership.

     pvs
    
  6. vgs: This command displays information about volume groups, including their size, free space, and associated physical volumes.

     vgs
    
  7. 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.

0
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