• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lvm Command Examples in Linux

by Deepika

The lvm command is used to manage physical volumes, volume groups, and logical volumes in a Linux Logical Volume Manager (LVM) system. The lvm command launches an interactive shell, allowing you to perform various LVM management operations.

Physical volumes (PVs) represent the actual storage devices, such as hard drives or solid-state drives, in a LVM system. Volume groups (VGs) are collections of physical volumes that are used to create logical volumes (LVs). LVs are virtual partitions on a VG that can be resized, moved, and otherwise managed without affecting the underlying physical storage.

With the lvm shell, you can perform a wide range of LVM management tasks, including:

  • Creating and deleting physical volumes
  • Creating and deleting volume groups
  • Creating and deleting logical volumes
  • Extending and reducing the size of logical volumes
  • Moving logical volumes between physical volumes
  • Displaying information about physical volumes, volume groups, and logical volumes And more.

The lvm shell provides a convenient and powerful way to manage LVM storage in Linux, allowing you to dynamically allocate, manage, and reconfigure storage as needed.

lvm Command Examples

1. Start the Logical Volume Manager interactive shell:

# lvm

2. List the Logical Volume Manager commands:

# lvm help

3. Initialize a drive or partition to be used as a physical volume:

# lvm pvcreate /dev/sdXY

4. Display information about physical volumes:

# lvm pvdisplay

5. Create a volume group called vg1 from the physical volume on `/dev/sdXY`:

# lvm vgcreate vg1 /dev/sdXY

6. Display information about volume groups:

# lvm vgdisplay

7. Create a logical volume with size 10G from volume group vg1:

# lvm lvcreate -L 10G vg1

8. Display information about logical volumes:

# lvm lvdisplay

Filed Under: Linux

Some more articles you might also be interested in …

  1. arpspoof: command not found
  2. extrace: command not found
  3. virt-manager: command not found
  4. setserial: command not found
  5. auditd Command Examples in Linux
  6. dep: A CLI tool for deployment of PHP applications
  7. composer-require-checker: A CLI tool to analyze Composer dependencies for soft dependencies
  8. ansible-galaxy – Create and manage Ansible roles (Command Examples)
  9. host Command Examples in Linux
  10. cradle deploy: Manage Cradle deployments

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright