Moving volumes to physical disks

You can use the following steps to move data off of VxVM volumes.

To move data off of VxVM volumes

  1. Evacuate as many disks as possible by using one of the following methods:

    • the "Remove a disk" option in vxdiskadm

    • the Veritas Enterprise Administrator

    • the vxevac script from the command line.

  2. Remove the evacuated disks from Veritas Volume Manager control using the following commands:

    # vxdg -g diskgroup rmdisk disk_media_name 
    # /usr/lib/vxvm/bin/vxdiskunsetup -C disk_access_name
    # vxdisk rm disk_access_name

    For example:

    # vxdg -g mydg rmdisk mydg01
    # /usr/lib/vxvm/bin/vxdiskunsetup -C hdisk1
    # vxdisk rm hdisk01
  3. Decide which volume to move first. If the volume to be moved is mounted, unmount it. If the volume is being used as a raw partition for database applications, make sure that the application is not updating the volume and that data on the volume has been synchronized.

  4. On the free disk space, create an LVM logical volume that is the same size as the VxVM volume. If there is not enough free space for the logical volume, add a new disk to the system for the first volume to be removed. For subsequent volumes, you can use the free space generated by the removal of the first volume.

  5. Copy the data on the volume onto the newly created LVM logical volume using the following command:

    # dd if=/dev/vx/dsk/diskgroup/volume of=/dev/vgvol

    where diskgroup is the name of a VxVM disk group, volume is the old volume in that disk group, and vgvol is a newly created LVM volume.

    If the volume contains a VxFS file system, the user data managed by VxFS in the volume must be backed up or copied to a native AIX file system in an LVM logical volume.

  6. The entries in /etc/filesystems for volumes holding VxFS file systems, that were copied to native file systems in step 5, must be modified according to the change in step 5.

  7. Mount the disk if the corresponding volume was previously mounted.

  8. Remove the volume from VxVM using the following command:

    # vxedit -g diskgroup -rf rm volume
  9. Remove any disks that have become free (have no subdisks defined on them) by removing volumes from VxVM control. To check if there are still some subdisks remaining on a particular disk, use the following command:

    # vxprint -g diskgroup -F "%sdnum" disk_media_name
  10. If the return code is not 0, there are still some subdisks on this disk that must be subsequently removed. If the return code is 0, remove the disk from VxVM control using the following commands:

    # vxdg -g diskgroup rmdisk disk_media_name
    # vxdisk rm disk_access_name
  11. Copy the data in the next volume to be removed to the newly created free space.

  12. Reboot the system after all volumes have been converted successfully. Verify that no open volumes remain after the system reboot using the following command:

    # vxprint -Aht -e v_open
  13. If any volumes remain open, repeat the steps listed above.