pv command

Purpose

Manages physical volumes in a shared storage pool.

Syntax

To add physical volumes to only one failure group in a shared storage pool:

pv -add [-clustername ClusterName] [-sp StoragePool] [-tier TierName] [-fg FGName1:] PhysVol ...

To add physical volumes to one or more failure groups in a shared storage pool:

pv -add [-clustername ClusterName] [-sp StoragePool] [-tier TierName] -fg FGName1:PhysVol ... [FGName2: PhysVol ...] ...

To add physical volumes to only one failure group in a shared storage pool, by using the file name:

pv -add -file [-clustername ClusterName] [-sp StoragePool] [-tier TierName] [-fg FGName1:] FileName

To add physical volumes to one or more failure groups in a shared storage pool, by using the file name:

pv -add -file [-clustername ClusterName] [-sp StoragePool] -fg FGName1:FileName1 [FGName2: FileName2] …

To remove physical volumes from a shared storage pool:

pv -remove [-clustername ClusterName] [-sp StoragePool] -pv PhysVol ...

To remove physical volumes by using the file name:

pv -remove -file [-clustername ClusterName] [-sp StoragePool] -pv FileName

To replace physical volumes in a shared storage pool:

pv -replace [-clustername ClusterName] [-sp StoragePool] -oldpv PhysVol ... -newpv PhysVol ...

To replace physical volumes by using the file name:

pv -replace -file [-clustername ClusterName] [-sp StoragePool] -oldpv FileName1 -newpv FileName2

To list physical volumes in a shared storage pool:

pv -list [-clustername ClusterName] [-sp StoragePool] [-tier TierName] [-fg FGName] [-attr Attribute=Value] [-verbose | -field FieldName ...] [-fmt Delimiter [-header]]

To list physical volumes that are cluster capable:

pv -list -capable [-clustername ClusterName ] [-field FieldName ...] [-fmt Delimiter [-header ]]

Description

The pv command is used to manage the physical volumes in a shared storage pool (SSP). By using the pv command, various operations, such as add, replace, remove, and list, can be performed on the physical volumes in an SSP. A new physical volume can be added to the SSP by using the -add flag. An existing physical volume can be replaced with a new physical volume by using the -replace flag, but ensure that the size of physical volume is equal to or more than the size of the old physical volume that is replaced. Use -remove flag to remove the physical volumes from the SSP. If the list of physical volumes is huge, use the file option to input all the physical volumes for -add , -remove, -replace options. To display information about the physical volumes in an SSP, use the -list operation and use the verbose option to display the detailed information about physical volumes. Use the attr option to filter the output of the -list flag to print name, udid, size, and state attributes.
Note: The remove action fails if there is not enough free space in the shared storage pool to accommodate the data from the physical volume that is removed.

Flags

Flag name Description
-add Adds the specified physical volumes to a shared storage pool.
-attr Specifies the attribute and value of the physical volume.

Supports the following attributes: name, udid, size, and state.

-capable Lists the physical volumes, that can be added to shared storage pool.
-clustername Specifies the name of the cluster.
-fg Specifies the name of the failure groups in the storage pool.
-field Specifies a list of fields to be displayed.
Supports the following attributes if the -list flag is specified:
pool_name, tier_name, fg_name, pv_name, pv_udid, pv_state, size, pv_desc
Supports the following attributes if the -list and -capable flags are specified:
pv_name, size, udid
-file Specifies that a file name is provided with the add, remove, and replace options. The file must contain physical volume names that are separated by a white space.
-fmt Separates the output fields by using a user-specified delimiter character.
-header Specifies the display field names in the formatted listing output.
-list Lists the physical volumes in a shared storage pool.
-newpv Lists one or more physical volumes that are replacing the existing physical volumes in the shared storage pool. This option specifies the file name instead of the physical volume names if the file option is used.
-oldpv Lists one or more physical volumes in the shared storage pool that are replaced with the new physical volumes. This option specifies the file name instead of the physical volume names if the file option is used.
-remove Removes one or more physical volumes from a shared storage pool.
-replace Replaces one or more physical volumes within a shared storage pool.
Note: If multiple physical volumes are being replaced, all of them must belong to the same failure group.
-sp Specifies the name of the shared storage pool.
-tier Specifies the name of the tier.
-verbose Displays detailed information about the physical volume.

Examples

  1. To add two physical volumes to the shared storage pool that has only one failure group, type the following command:
    pv –add hdisk33 hdisk34

    The system displays the following output:

    Given physical volume(s) have been added successfully
    Note: You cannot use the following command to add two physical volumes to the shared storage pool that has multiple failure groups:
    pv –add hdisk1 hdisk2

    The system displays the following output, as this is an incorrect example when multiple failure groups are present:

    Failed to add disk(s) to the Storage Pool.
    Multiple Failure Groups are present.
  2. To add physical volumes to multiple failure groups, type the following command:
    pv –add –fg fg1: hdisk42 hdisk43 fg2: hdisk53 hdisk54

    The system displays the following output:

    Given physical volume(s) have been added successfully
  3. To add multiple physical volumes (where none of the physical volumes are in use) to only one failure group in a shared storage pool, type the following command:
    pv –add hdisk1 hdisk2

    The system displays the following output, as in this example hdisk2 is in use:

    The given request has been partially succeeded.
    PV is currently in use.
    hdisk2
    Note: The physical volume hdisk1 is successfully added to the shared storage pool and the physical volume hdisk2 cannot be added because it is in use.
  4. To add physical volumes to multiple failure groups in a specific tier in a multi tier environment, type the following command:
    pv –add -tier tier2 –fg fg1: hdisk42 hdisk43 fg2: hdisk53 hdisk54

    The system displays the following output:

    Given physical volume(s) have been added successfully.
  5. To remove a physical volume in a shared storage pool, type the following command:
    pv -remove -pv hdisk7

    The system displays the following output:

    Given physical volume(s) have been removed successfully.
  6. To replace hdisk1 with hdisk2 in a shared storage pool, type the following command:
    pv –replace –clustername mycluster –sp mysp –oldpv hdisk1 -newpv hdisk2

    The system displays the following output:

    Given physical volume(s) have been replaced successfully
  7. To replace physical volumes that are specified in the pvfile1 file with physical volumes specified in the pvfile2, in a shared storage pool, type the following command:
    pv –replace -file –oldpv pvfile1 -newpv pvfile2

    The system displays the following output:

    Given physical volume(s) have been replaced successfully

    The contents of file pvfile1: hdisk1 hdisk2 hdisk3 hdisk4.

    The contents of file pvfile2: hdisk21 hdisk33.

    Note: All these physical volumes must belong to the same failure group. Otherwise, the command fails.
  8. To replace physical volumes hdisk1 and hdisk2 with hdisk3 and hdisk4 (that are in use) in a shared storage pool, type the following command:
    pv –replace –oldpv hdisk1 hdisk2 -newpv hdisk3 hdisk4

    The system displays the following output, as this is an example for partial success only:

    The given request has been partially succeeded.
    PV is in use
    hdisk4
  9. To list all the physical volumes in a shared storage pool that has failure groups, type the following command:
    pv -list

    The system displays the following output for a cluster with two failure groups:

    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg1
    PV_NAME     SIZE(MB)    STATE        UDID
    hdisk4      10240       ONLINE       3E213600A0B80006E25060000B93E50ADBC110F1818      FAStT03IBMfcp
    hdisk5      10240       ONLINE       3E213600A0B80006E25060000D2E64F755F420F1818      FAStT03IBMfcp
    
    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg2
    PV_NAME     SIZE(MB)    STATE        UDID
    hdisk6      10240       ONLINE       3E213600A0B80006E25060000B93E50ADBC110F1828      FAStT03IBMfcp
    hdisk7      10240       ONLINE       3E213600A0B80006E25060000D2E64F755F420F1828      FAStT03IBMfcp
    
    POOL_NAME: testsp
    TIER_NAME: tier2
    FG_NAME: fg1
    PV_NAME SIZE(MB) STATE UDID
    hdisk42 10240 ONLINE 3E213600A0B80006E25060000B93E50ADBC110F1819 FAStT03IBMfcp
    hdisk43 10240 ONLINE 3E213600A0B80006E25060000D2E64F755F420F1820 FAStT03IBMfcp
    POOL_NAME: testsp
    TIER_NAME: tier2
    FG_NAME: fg2
    PV_NAME SIZE(MB) STATE UDID
    hdisk53 10240 ONLINE 3E213600A0B80006E25060000B93E50ADBC110F1829 FAStT03IBMfcp
    hdisk54 10240 ONLINE 3E213600A0B80006E25060000D2E64F755F420F1830 FAStT03IBMfcp
  10. To list the detailed information about physical volumes that are in a shared storage pool, type the following command:
    pv –list –verbose

    The system displays the following output:

    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg1
    PV_NAME: hdisk4
    PV_SIZE(MB): 10240
    PV_STATE: ONLINE
    PV_UDID: 3E213600A0B80006E25060000B93E50ADBC110F1818      FAStT03IBMfcp
    PV_DESC: MPIO IBM 2107 FC Disk
    
    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg1
    PV_NAME: hdisk5
    PV_SIZE(MB): 10240
    PV_STATE: ONLINE
    PV_UDID: 3E213600A0B80006E25060000D2E64F755F420F1818      FAStT03IBMfcp
    PV_DESC: MPIO IBM 2107 FC Disk
    
    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg2
    PV_NAME: hdisk6
    PV_SIZE(MB): 10240
    PV_STATE: ONLINE
    PV_UDID: 3E213600A0B80006E25060000B93E50ADBC110F1828      FAStT03IBMfcp
    PV_DESC: MPIO IBM 2107 FC Disk
    
    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg2
    PV_NAME: hdisk7
    PV_SIZE(MB): 10240
    PV_STATE: ONLINE
    PV_UDID: 3E213600A0B80006E25060000D2E64F755F420F1828      FAStT03IBMfcp
    PV_DESC: MPIO IBM 2107 FC Disk
    
    POOL_NAME: testsp
    TIER_NAME: tier2
    FG_NAME: fg1
    PV_NAME: hdisk42
    PV_SIZE(MB): 10240
    PV_STATE: ONLINE
    PV_UDID: 3E213600A0B80006E25060000B93E50ADBC110F1819 FAStT03IBMfcp
    PV_DESC: MPIO IBM 2107 FC Disk
    POOL_NAME: testsp
    TIER_NAME: tier2
    FG_NAME: fg1
    PV_NAME: hdisk43
    PV_SIZE(MB): 10240
    PV_STATE: ONLINE
    PV_UDID: 3E213600A0B80006E25060000D2E64F755F420F1820 FAStT03IBMfcp
    PV_DESC: MPIO IBM 2107 FC Disk
    POOL_NAME: testsp
    TIER_NAME: tier2
    FG_NAME: fg2
    PV_NAME: hdisk53
    PV_SIZE(MB): 10240
    PV_STATE: ONLINE
    PV_UDID: 3E213600A0B80006E25060000B93E50ADBC110F1829 FAStT03IBMfcp
    328 Power Systems: Virtual I/O Server and Integrated Virtualization Manager commands
    PV_DESC: MPIO IBM 2107 FC Disk
    POOL_NAME: testsp
    TIER_NAME: tier2
    FG_NAME: fg2
    PV_NAME: hdisk54
    PV_SIZE(MB): 10240
    PV_STATE: ONLINE
    PV_UDID: 3E213600A0B80006E25060000D2E64F755F420F1830 FAStT03IBMfcp
    PV_DESC: MPIO IBM 2107 FC Disk
  11. To list all the physical volumes in a given failure group in a given tier in a shared storage pool, type the following command:
    pv-list -tier tier1 -fg fg1

    The system displays the following output:

    POOL_NAME: testsp
          TIER_NAME: tier1
          FG_NAME: fg1
          PV_NAME    SIZE(MB)    STATE       UDID
          hdisk4     10240       ONLINE      3E213600A0B80006E25060000B93E50ADBC110F1818  FAStT03IBMfcp
          hdisk5     10240       ONLINE      3E213600A0B80006E25060000D2E64F755F420F1818  FAStT03IBMfcp
  12. To list physical volumes in a formatted output with comma (,) as the delimiter, type the following command:
    pv –list –fmt ,

    The system displays the following output:

    testsp,tier1,fg1,hdisk3,10240,ONLINE,3E213600A0B80006E25060000B93E50ADBC110F1818      FAStT03IBMfcp
    testsp,tier1,fg1,hdisk5,10240,ONLINE,3E213600A0B80006E25060000D2E64F755F420F1818      FAStT03IBMfcp
    testsp,tier1,fg2,hdisk6,10240,ONLINE,3E213600A0B80006E25060000B93E50ADBC110F1828      FAStT03IBMfcp
    testsp,tier1,fg2,hdisk7,10240,ONLINE,3E213600A0B80006E25060000D2E64F755F420F1828      FAStT03IBMfcp
    testsp,tier2,fg1,hdisk42,10240,ONLINE,3E213600A0B80006E25060000B93E50ADBC110F1819      FAStT03IBMfcp
    testsp,tier2,fg1,hdisk43,10240,ONLINE,3E213600A0B80006E25060000D2E64F755F420F1820      FAStT03IBMfcp
    testsp,tier2,fg2,hdisk53,10240,ONLINE,3E213600A0B80006E25060000B93E50ADBC110F1829      FAStT03IBMfcp
    testsp,tier2,fg2,hdisk54,10240,ONLINE,3E213600A0B80006E25060000D2E64F755F420F1830      FAStT03IBMfcp
  13. To list physical volumes in a failure group fg2 in a shared storage pool, type the following command:
    pv –list –fg fg2

    The system displays the following output:

    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg2
    PV_NAME     SIZE(MB)    STATE        UDID
    hdisk6      10240       ONLINE       3E213600A0B80006E25060000B93E50ADBC110F1828      FAStT03IBMfcp
    hdisk7      10240       ONLINE       3E213600A0B80006E25060000D2E64F755F420F1828      FAStT03IBMfcp
    
    POOL_NAME: testsp
    TIER_NAME: tier2
    FG_NAME: fg2
    PV_NAME SIZE(MB) STATE UDID
    hdisk53 10240 ONLINE 3E213600A0B80006E25060000B93E50ADBC110F1829 FAStT03IBMfcp
    hdisk54 10240 ONLINE 3E213600A0B80006E25060000D2E64F755F420F1830 FAStT03IBMfcp 
  14. To list the physical volume with a specific UDID in a storage pool, type the following command:
    pv –list –attr pv_udid=”3E213600A0B80006E25060000B93E50ADBC110F1828      FAStT03IBMfcp”

    The system displays the following output:

    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg2
    PV_NAME     SIZE(MB)    STATE        UDID
    hdisk6      10240       ONLINE       3E213600A0B80006E25060000B93E50ADBC110F1828      FAStT03IBMfcp
  15. To list the physical volume with a specific name in a storage pool, type the following command:
    pv –list –attr pv_name=hdisk7

    The system displays the following output:

    POOL_NAME: testsp
    TIER_NAME: tier1
    FG_NAME: fg2
    PV_NAME     SIZE(MB)    STATE        UDID
    hdisk7      10240       ONLINE       3E213600A0B80006E25060000D2E64F755F420F1828      FAStT03IBMfcp
  16. To list physical volumes that are cluster capable in a shared storage pool or a failure group, type the following command:
    pv –list -capable

    The system displays the following output:

    PV_NAME     SIZE(MB)     STATE    UDID
    hdisk11     10240       	N/A      3E213600A0B80006E25060000B94050ADBC580F1818      FAStT03IBMfcp
    hdisk12    	10240       	N/A      3E213600A0B80006E24E600002FDD50ADB6640F1818      FAStT03IBMfcp
    hdisk14    	5120        	N/A      3E213600A0B80006E24E600002FFC50ADB68F0F1818      FAStT03IBMfcp
    hdisk15    	5120        	N/A      3E213600A0B80006E25060000B94250ADBCA50F1818      FAStT03IBMfcp
    hdisk16    	5120        	N/A      3E213600A0B80006E24E60000301750ADB6B00F1818      FAStT03IBMfcp



Last updated: Wed, November 18, 2020