LinuxCommandLibrary

lvdisplay

Display logical volume information

TLDR

Display information about all logical volumes

$ sudo lvdisplay
copy

Display the information in a short format (same as running lvs)
$ sudo lvdisplay [[-C|--columns]]
copy

Display information about all logical volumes in volume group vg1
$ sudo lvdisplay [vg1]
copy

Display information about logical volume lv1 in volume group vg1
$ sudo lvdisplay [vg1/lv1]
copy

SYNOPSIS

lvdisplay [OPTIONS] [LogicalVolumePath|VolumeGroupName/LogicalVolumeName...]
lvdisplay [OPTIONS] -a|--all

PARAMETERS

-a, --all
    Displays information about all logical volumes on the system, regardless of whether they are active or inactive.

-c, --colon
    Generates output in a colon-separated format, which is easily parseable by scripts and other programs. This is useful for automated data extraction.

-o, --options field1[,field2...]
    Specifies which fields (columns) of information to display. Common fields include lv_name, vg_name, lv_size, lv_attr, lv_uuid, etc. Multiple fields can be separated by commas.

-S, --select selection
    Displays only logical volumes that match the specified selection criteria. The criteria use SQL-like syntax (e.g., 'lv_size > 10G').

-s, --segments
    Displays information about the segments that make up the logical volume. This can show how the LV is distributed across physical extents and devices.

-v, --verbose
    Increases the verbosity of the output, providing more detailed information, which can be useful for debugging or in-depth analysis.

-u, --units unit
    Specifies the units to use for displayed sizes (e.g., 'b' for bytes, 'k' for kilobytes, 'm' for megabytes, 'g' for gigabytes, 't' for terabytes, 'p' for petabytes, 'e' for exabytes, or 'h' for human-readable).

--noheadings
    Suppresses the display of column headings when outputting in table format, often used when scripting.

--nosuffix
    Suppresses the unit suffix (e.g., 'G', 'M') from size values in the output.

DESCRIPTION

The lvdisplay command is a crucial utility within the Logical Volume Manager (LVM) framework on Linux systems. It is designed to provide comprehensive and detailed information about one or more logical volumes (LVs). This information includes, but is not limited to, the logical volume's name, UUID, size, current status (e.g., active, inactive, snapshot), allocation policy, associated volume group, and underlying physical volume segments.

Administrators use lvdisplay to monitor the state of their LVM configurations, troubleshoot issues, verify creation or modification operations, and gather data for capacity planning. When executed without any arguments, it displays information for all logical volumes detected on the system. Users can also specify particular logical volumes by name or path to get targeted details. The command offers various options to control the verbosity and format of its output, making it adaptable for both human readability and script parsing.

CAVEATS

Running lvdisplay typically requires root privileges or sudo access to view all logical volume information.
The interpretation of certain output fields, such as the LV Attributes string (lv_attr), requires familiarity with LVM's internal attribute flags. While powerful, the -o/--options and --select features necessitate knowledge of available field names and query syntax.

OUTPUT FORMATS

Beyond the default human-readable output, lvdisplay offers significant flexibility. The -o or --options flag allows users to precisely define which columns of data are displayed, enabling custom reports. For programmatic parsing, the -c or --colon option provides a stable, machine-readable format. Modern versions also support --reportformat json for structured JSON output, which is ideal for integration with scripting languages and automated systems.

LV ATTRIBUTES (LV_ATTR)

The lv_attr field in the output (when requested via -o lv_attr or in default verbose output) is a string of characters representing various attributes of the logical volume. Each character denotes a specific characteristic, such as accessibility (e.g., 'w' for writeable), allocation type (e.g., 'l' for linear, 's' for snapshot), and health status (e.g., 'a' for active). Understanding these attributes is key to fully interpreting the state of a logical volume.

HISTORY

The Logical Volume Manager (LVM) was originally conceived by Sistina Software. LVM2, a complete rewrite of the original LVM, was integrated into the Linux kernel starting from version 2.6.0. lvdisplay has been a fundamental utility within LVM from its early stages, serving as the primary tool for administrators to inspect the state and configuration of logical volumes. Its evolution has focused on enhancing output flexibility (e.g., support for JSON, customizable columns via -o), improving performance, and adapting to new LVM features such as thin provisioning, RAID LVs, and VDO, ensuring its continued relevance as a core LVM diagnostic and reporting command.

SEE ALSO

pvdisplay(8), vgdisplay(8), lvcreate(8), lvremove(8), lvextend(8), lvreduce(8), lvs(8), lvm(8)

Copied to clipboard