subscribe iconSubscribe to this information
POWER7 information

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] [-fg FGName1:] PhysVol ...

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

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

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

pv -add -file [-clustername ClusterName] [-sp StoragePool] [-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] [-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 list all the physical volumes. 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 flag fails if there is no 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 or a failure group.
-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.
-sp Specifies the name of the shared storage pool.
-verbose Displays detailed information about the physical volume.

Examples

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

    The system displays the following output:

    Given physical volume(s) have been added successfully
  2. To add two physical volumes to the shared storage pool that has multiple failure groups, type the following command:
    pv –add hdisk1 hdisk2

    The system displays the following output:

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

    The system displays the following output:

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

    The system displays the following output:

    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.
  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

  8. To replace physical volumeshdisk1 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:

    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 two failure groups, type the following command:
    pv -list

    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
    
    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
  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
  11. 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
  12. To list physical volumes in a shared storage pool that has a failure group fg2, 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
  13. To list the physical volumes in a storage pool by using a specific UDID, 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
  14. To list the physical volumes names as hdisk7 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
  15. 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


Send feedback Rate this page

Last updated: Wed, June 03, 2015