Moving populated disks out of rootdg or moving rootdg to another system

contributed by Neil Bliss

First, moving populated disks between diskgroups.

  1. Get a list of disks in the diskgroup that you intend to move the populated disks out of.
    # vxdisk list | grep rootdg

  2. Get the configuration of the diskgroup.
    # vxprint -ht -g rootdg

  3. Determine which disks contain the volumes that are to be moved.

  4. Save the configuration of the desired volumes in a format that can be used later by vxmake to recreate the volumes. Specify all volumes on the disks in question, plus any unassociated plexes and their child subdisks, plus any unassociated subdisks.
    # vxprint -hmQq -g rootdg vol01 vol02 vol03 > /tmp/volinfo

  5. Unmount the appropriate filesystems, and/or stop any processes holding the volumes open.

  6. Stop all the volumes.
    # vxvol -g rootdg stop vol01 vol02 vol03

  7. Remove from the configuration database the definitions of the structures ( (volumes, plexes, subdisks) to be moved. NOTE that this does not affect your data.
    # vxedit -g rootdg -r rm vol01 vol02 vol03

  8. Remove the disks from the original diskgroup.
    # vxdg -g roodg rmdisk rootdg01 rootdg02 rootdg03 rootdg04

  9. If you are moving the disks to a preexisting diskgroup, SKIP THIS STEP. If not, initialize the diskgroup using one of your disks. It is simplest to keep the old disk names until a later step.
    # vxdg init newdg rootdg01=c1t2d0s2

  10. Add the disks to their new disk group. It is simplest to keep the old disk names until a later step.
    # vxdg -g newdg adddisk rootdg02 rootdg03 rootdg04

  11. Verify that the disks are in their new diskgroup.
    # vxdisk list | grep newdg

  12. Reload the object configuration into the new diskgroup.
    # vxmake -g newdg -d /tmp/volinfo

  13. Verify the configuration of the new diskgroup.
    # vxprint -ht -g newdg

  14. Test your data.

Second, moving rootdg between systems.



  1. Get the diskgroup ID (dgid) of rootdg from the old host.
    # vxdisk -s list

    (example)

    Disk:   c1t5d0s2
    type:   sliced
    flags:  online ready private autoconfig autoimport imported
    diskid: 824180434.4523.csclust2
    dgname: rootdg
    dgid:   824180442.4528.csclust2
    hostid: csclust1
     
    Disk:   c1t9d0s2
    type:   sliced
    flags:  online ready private autoconfig autoimport imported
    diskid: 824180440.4525.csclust2
    dgname: rootdg
    dgid:   824180442.4528.csclust2
    hostid: csclust1
     
    Disk:   c1t13d0s2
    type:   sliced
    flags:  online ready private autoconfig autoimport imported
    diskid: 830532975.3418.csclust1
    dgname: rootdg
    dgid:   824180442.4528.csclust2
    hostid: csclust1
    

  2. Shutdown the old host, remove the disks, and connect the disks to the new host.

  3. Import the diskgroup with its new name, assigning ownership of the diskgroup to the new host, using the dgid for the diskgroup name.
    # vxdg -C -n newdg import 824180442.4528.csclust2

  4. Perform the necessary steps to make the new host and VxVM recognize the new disks. I.e. perform the steps necessary to make the OS see the disks, and then perform a 'vxdctl enable' to restart vxconfigd so that VxVM also recognizes the disks.

  5. Start all volumes in the diskgroup.
    # vxrecover -g newdg -sb