[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 System Management Guide: Operating System and Devices

Migrating the Contents of a Physical Volume

This procedure describes how to move the physical partitions belonging to one or more specified logical volumes from one physical volume to one or more other physical volumes in a volume group.

You might want to use this procedure to move the data from a failing disk before it is removed for repair or replacement. This procedure can be used on physical volumes in the rootvg volume group or on physical volumes in a user-defined volume group.

Attention: When the boot logical volume is migrated from a physical volume, the boot record on the source should be cleared. Failure to clear this record may result in a system hang. When you execute the bosboot command, you must also execute mkboot -c (see step 4 of the following procedure.)

Prerequisites

Be sure you read and understand the following articles:

Procedure

  1. Determine which disks are in the volume group. Make sure that the source and destination physical volumes are in the same volume group. If the source and destination physical volumes are in the same volume group, proceed to step 3.
    lsvg -p VGname
    The output will look similar to the following:
    rootvg:
    PV_NAME    PV STATE   TOTAL PPs   FREE PPs   FREE DISTRIBUTION
    hdisk0     active     159         0          00..00..00..00..00
  2. If you are planning to migrate to a new disk, such as when you have a failing disk, perform the following steps:

    1. Make sure the disk is available by entering the following:
      lsdev -Cc disk
      The output should resemble the following:
      hdisk0  Available  00-08-00-30  670 MB  SCSI  Disk Drive
      hdisk1  Available  00-08-00-20  857 MB  SCSI  Disk Drive
    2. If the disk is listed and in the available state, make sure it does not belong to another volume group using the following command:
      lspv
      In the following example, hdisk1 can be used as a destination disk:
      hdisk0     0000078752249812   rootvg
      hdisk1     000000234ac56e9e   none
    3. If the disk is not listed or is not available, you need to check or install the disk.

    4. Add the new disk to the volume group using the command:
      extendvg VGName hdiskNumber
  3. Make sure that you have enough room on the target disk for the source that you want to move:

    1. Determine the number of physical partitions on the source disk by using the following command (SourceDiskNumber will be of the form 'hdiskNumber'):
      lspv SourceDiskNumber | grep "USED PPs"
      The output will look similar to the following:
      USED PPs:      159 (636 megabytes)
      In this example, you would need 159 FREE PPs on the destination disk to successfully complete the migration.

    2. Determine the number of free physical partitions on the destination disk or disks using the following command for each destination disk (DestinationDiskNumber will be of the form 'hdiskNumber'):
        lspv DestinationDiskNumber | grep "FREE PPs"
      Add the FREE PPs from all of the destination disks. If the sum is larger than the number of USED PPs from step 3, you will have enough space for the migration.

  4. Follow this step only if you are migrating data from a disk in the rootvg volume group. If you are migrating data from a disk in a user-defined volume group, proceed to step 5.

    Check to see if the boot logical volume (hd5) is on the source disk:

    lspv -l SourceDiskNumber | grep hd5
    If you get no output, the boot logical volume is not located on the source disk. Continue to step 5.

    If you get output similar to the following:

    hd5            2   2   02..00..00..00..00   /blv
    then run the following command:
    migratepv -l hd5 SourceDiskNumber DestinationDiskNumber
    Next, you will get a message warning you to perform the bosboot command on the destination disk. You must also perform a mkboot -c command to clear the boot record on the source. Do the following:
    bosboot -a -d /dev/DestinationDiskNumber
    then:
    bootlist -m normal DestinationDiskNumber
    then:
    mkboot -c -d /dev/SourceDiskNumber
  5. Now you can migrate your data. Enter the following SMIT fast path:
    smit migratepv 
  6. List the physical volumes (PF4), and select the source physical volume you examined previously.

  7. Go to the DESTINATION physical volume field. If you accept the default, all the physical volumes in the volume group are available for the transfer. Otherwise, select one or more disks with adequate space for the partitions you will be moving (from step 4).

  8. If you wish, go to the Move only data belonging to this LOGICAL VOLUME field, and list and select a logical volume. You will move only the physical partitions allocated to the logical volume specified that are located on the physical volume selected as the source physical volume.

  9. Press Enter to move the physical partitions.

  10. If you now want to remove the source disk from the volume group, such as when it is failing, enter the following command:
    reducevg VGNname SourceDiskNumber
  11. If you want to physically remove the source disk from the system, such as when it is failing, enter the following command:
    rmdev -l SourceDiskNumber -d

[ Previous | Next | Contents | Glossary | Home | Search ]