5+ lvdisplay command examples in Linux [Cheat Sheet]

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:

Advertisement

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 available and the inactive logical volume has the status unavailable.
  • 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

When lvdisplay command is used without any arguments, it shows the information of all logical volumes.

# lvdisplay

Sample Output:

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.

Advertisement
# lvdisplay LV_path

Sample Output:

The following command displays only the information of the logical volume lvol1 in the volume group vol_grp.

lvdisplay command to display logical volume information

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.

lvdisplay command to display information of logical volume

 

3. Display the colon separated output

The -c or --colon option generates the colon separated output for easier parsing in scripts or programs.

# lvdisplay -c

OR

# lvdisplay --colon

Sample Output:

lvdisplay command to generate colon separated output

 

4. Display output in columns

The -C or --columns option displays the logical volume information in columns. It is equivalent to the lvs command.

# lvdisplay -C

OR

# lvdisplay --columns

Sample Output:

lvdisplay command to display output in columns

 

5. Display the mapping of logical extents to physical volumes and physical extents

The -m or --maps option of lvdisplay command displays the mapping of logical extents to physical volumes and physical extents.

# lvdisplay -m

OR

# lvdisplay --maps

Sample Output:

lvdisplay command to display mapping of logical extents to physical volumes and physical extents

 

6. lvdisplay command to display all the information

The -a or --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

OR

# lvdisplay -all

 

Conclusion

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.

 

What’s Next

10+ lvchange command examples in Linux [Cheat Sheet]
lvremove command examples in Linux [Cheat Sheet]

 

Further Reading

man page for lvdisplay command

 

Didn't find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

Leave a Comment

X