• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pvs Command Examples in Linux

by admin

To display the LVM physical volume on a system, you can use either the pvs command or the pvscan command as the root user. For example, the below commands create a physical volume on /dev/sdc1 partition and views the information about it in the next pvs command.

$ sudo pvcreate /dev/sdc1        ### Make sdc1 an LVM physical volume
 Physical volume “/dev/sdc1” successfully created
$ sudo pvs                       ### View physical LVM partitions
  PV               VG            Fmt  Attr   PSize   PFree
  /dev/sdc1                      lvm2 a--    3.73g   3.73g

To implement LVMs, we create three objects:

  • Physical volumes: This represents the raw disk space as disk partitions. When we use partitions, the partition type should be set to Linux LVM with an ID of 8E using the fdisk partitioning tool.
  • Volume groups: This aggregates physical volumes together so that the disk space can be consumed to logical volumes.
  • Logical volumes: This represents the block device that can be shared. It consumes space that is allocated from volume groups.

pvs Command Examples

1. To display the PV info:

# pvs 

2. To see all the information:

# pvs --all 

3. To align the output:

# pvs --alligned 

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

# pvs --nameprefixes 

5. To suppress the headings:

# pvs --noheadings 

6. To suppress the suffix on output sizes:

# pvs --nosuffix 

7. To comma-separated ordered list of columns:

# pvs -o
# pvs --options 

8. To produces one line of output for each contiguous allocation:

# pvs --segments 

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

# pvs -O
# pvs --sort 

10. To output columns as rows:

# pvs --rows 

11. To use the string to separate each column:

# pvs --separator , 

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

# pvs --unbuffered 

13. To All sizes are output in these units:

# pvs --units hHbBsSkKmMgGtTpPeE 

14. To get the help for pvs:

# pvs --help 

15. To get the version:

# pvs --version 

16. To set to verbose mode:

# pvs -v
# pvs --verbose 

Filed Under: Linux

Some more articles you might also be interested in …

  1. Troubleshooting kdump Issues in CentOS/RHEL
  2. How to Troubleshoot Performance Issues on Linux – Beginners Guide
  3. f5fpc Command Examples
  4. mumble Command Examples in Linux
  5. Linux “rm” Command Examples
  6. fprintd-delete: command not found
  7. lxi Command Examples in Linux
  8. jpegtran for image optimization
  9. How to Setup SSH keys for “passwordless” SSH Login on CentOS/RHEL
  10. How to Determine Which Process is Writing to Disk in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright