lvdisplay is a command in Linux used to display information about Logical Volumes (LVs) in a Linux Logical Volume Manager (LVM) system. The output of the command shows details such as LV name, VG name, size, read/write status, access permissions, and more. The command is used to view the properties of LVs and to verify the status of LVM storage configurations.
If you want to see the details of the volume in a Volume Group, you can use the lvdisplay command. Below is an example of lvdisplay command. Here, Vol1 is the Volume Group name.
$ sudo lvdisplay Vol1 --- Logical volume --- LV Path /dev/Vol1/lvtest LV Name lvtest VG Name Vol1 LV UUID 4W2369-pLXy-jWmb-lIFN-SMNX-xZnN-3KN208 LV Write Access read/write LV Creation host, time … -0400 LV Status available # open 0 LV Size 2.00 GiB Current LE 513 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2
In the lvdisplay command about, below information is displayed:
- LV Name: The name of the logical volume.
- VG Name: The name of the volume group.
- LV UUID: A unique ID that is given to the volume.
- LV Write Access: The read/write status of the volume. As you can see, users who have enough file system permissions can write to this volume.
- LV Status: The current status of the volume. This should read available; otherwise, the volume cannot be used.
- open: The number of files that are open on the volume.
- LV Size: The size of the volume.
- Current LE: The number of logical extents. A logical extent is the logical representation of the physical extent in the volume.
- Segments: The number of physical devices on which this volume is contained.
- Allocation: The current allocation status. This parameter should be set to inherit.
- Read Ahead Sectors: The number of sectors the operating system should read ahead on a volume. For performance optimization, you can set this number. That is, if the operating system asks for the information in section 13 and the Read Ahead Sectors parameter is set to 4, it would read sectors 13 to 17. Although this sounds like something you would want to do, on modern hardware the controller of the storage device takes care of this, so there is no need to set this parameter.
- Block Device: The address that the kernel uses to find this volume.
If you encounter the below error while running the command lvdisplay:
lvdisplay: command not found
you may try installing the below package as per your choice of distribution:
|Debian||apt-get install lvm2|
|Ubuntu||apt-get install lvm2|
|Alpine||apk add lvm2|
|Arch Linux||pacman -S lvm2|
|Kali Linux||apt-get install lvm2|
|CentOS||yum install lvm2|
|Fedora||dnf install lvm2|
|Raspbian||apt-get install lvm2|
lvdisplay Command Examples
1. Display information about all logical volumes:
# sudo lvdisplay
2. Display information about all logical volumes in volume group vg1:
# sudo lvdisplay vg1
3. Display information about logical volume lv1 in volume group vg1:
# sudo lvdisplay vg1/lv1