Table of Contents
Introduction to lvdisplay command
lvdisplay command displays the properties of LVM logical volumes. It shows the attributes of a logical volume like size, read/write status, allocation policy, mapping etc.
Are you new to LVM and still learning how it works?
We have written detailed articles covering different areas of managing logical volumes, which you can follow using the below links:
Manage Logical Volume in Linux - One STOP Solution
Understand LVM Architecture
Create LVM during installation RHEL/CentOS 7/8
How to use LVM Snapshot for Backup and Restore
Create Mirrored Logical Volume
Create Striped Logical Volume
lvdisplay command output content
lvdisplay command displays the following information of the logical volume.
- LV Path: Path of the logical volume
- LV Name: Name of the logical volume
- VG Name: Name of the volume group
- LV UUID: Unique ID of the logical volume
- LV Write Access: The read/write permission of the logical volume
- LV Status: The current status of the logical volume. The active logical volume has the status
availableand the inactive logical volume has the status
- open: Number of files that are open on the logical volume.
- LV Size: Size of the logical volume
- Current LE: Number of logical extents in the logical volume
- Segments: Number of physical devices that contains the logical volume
- Allocation: Current allocation policy of the logical volume
- Read ahead sectors: Number of sectors on the logical volume that the operating system should read ahead
- Block Device: The kernel uses this address to find the logical volume
lvchange command allows you to change the attributes of a logical volume. For detailed instructions, see 10+ lvchange command examples in Linux [Cheat Sheet].
Different examples to use lvdisplay command
1. Display all the logical volumes information
lvdisplay command is used without any arguments, it shows the information of all logical volumes.
root@ubuntu-PC:~# lvdisplay --- Logical volume --- LV Path /dev/vol_grp/lvol0 LV Name lvol0 VG Name vol_grp LV UUID NmNUn0-QKnq-SUnf-5kKl-sm3l-Cq0L-k9QR0d LV Write Access read/write LV Creation host, time ubuntu-PC, 2022-02-18 21:43:27 +0545 LV snapshot status source of snap [active] LV Status available # open 0 LV Size 40.00 MiB Current LE 10 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Path /dev/vol_grp/lvol1 LV Name lvol1 VG Name vol_grp LV UUID siyXiY-rsiN-6Vpe-YR5o-y8Oa-69iL-DKUdZ2 LV Write Access read/write LV Creation host, time ubuntu-PC, 2022-02-18 21:43:36 +0545 LV Status available # open 0 LV Size 60.00 MiB Current LE 15 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 ...
2. Display information of a specific logical volume
You can specify a path of the logical volume to view the information of that logical volume.
# lvdisplay LV_path
The following command displays only the information of the logical volume
lvol1 in the volume group
If snapshot logical volumes have been created for the original logical volume, lvdisplay shows a list of all snapshot logical volumes and their status (active or inactive) as well.
3. Display the colon separated output
--colon option generates the colon separated output for easier parsing in scripts or programs.
# lvdisplay -c
# lvdisplay --colon
4. Display output in columns
--columns option displays the logical volume information in columns. It is equivalent to the
# lvdisplay -C
# lvdisplay --columns
5. Display the mapping of logical extents to physical volumes and physical extents
--maps option of lvdisplay command displays the mapping of logical extents to physical volumes and physical extents.
# lvdisplay -m
# lvdisplay --maps
6. lvdisplay command to display all the information
--all option includes information about internal logical volumes in the output. They are components of normal LVs, such as mirrors, which are not independently accessible, e.g. not mountable.
# lvdisplay -a
# lvdisplay -all
lvdisplay command is a useful command that displays information about a logical volume. We have covered the most common examples of lvdisplay command. We hope this tutorial helps you to understand how to use the lvdisplay command in Linux.
If you have any confusion, please let us know in the comment section below.