lvs Command Examples in Linux

A logical volume (LV) is created using the LVM’s lvcreate command. This is the final object in logical volume creation. An LV consists of storage space chunks from a VG pool. It can be formatted with a filesystem, mounted, and used just like a typical disk partition.

After creating a logical volume, you can display its properties using lvdisplay. or lvs if you just want to see a short summary. To do this, you need to use the complete device name of the logical volume. In this device name, you’ll first use the name of the device directory /dev, followed by the name of the volume group, which in turn is followed by the name of the logical volume. For instance, the logical volume data in volume group volgroup would use the device name /dev/volgroup/data.

lvs Command Examples in Linux

1. To report logical volume info:

# lvs 

2. To report all logical volume:

# lvs --all 

3. To Use with –separator to align the output columns:

# lvs --aligned 

4. To Add an “LVM2_” prefix plus the field name to the output:

# lvs --nameprefixes 

5. To Suppress the headings line that is normally the first line of output:

# lvs --noheadings 

6. To suppress the suffix on output sizes:

# lvs --nosuffix 

7. To comma-separated ordered list of columns:

# lvc -o
# lvc --options 

8. To use default columns that emphasize segment information:

# lvs --segments 

9. To comma-separated ordered list of columns to sort by:

# lvs -O
# lvs --sort 

10. To output columns as rows:

# lvs --rows 

11. To string to use to separate each column:

# lvs --separator Separator 

12. To produce output immediately without sorting or aligning the columns properly:

# lvs --unbuffered 

13. To all sizes are output in these units:

# lvs --units hHbBsSkKmMgGtTpPeE 

14. To when used with –nameprefixes, output values in the field=value pairs are not quoted:

# lvs --unquoted 
Related Post