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.
lvdisplay Command Examples
1. To display all the logical volumes information:
2. To view/print all the information:
3. To generate colon seperated output
# lvdisplay -c # lvdisplay --colon
4. To display the mapping of logical extents to physical volumes and physical extents
# lvdisplay -m # lvdisplay --mpas
5. To Display output in columns
# lvdisplay -C # lvdisplay --columns