Symantec logo

Converting LVM volume groups to VxVM disk groups

 To convert LVM volume groups to VxVM disk groups

  1. Identify the LVM disks and volume groups that are to be converted. Use LVM administrative utilities such as vgdisplay to identify the candidate LVM volume groups and the disks that comprise them. You can also use the listvg operation in vxvmconvert to examine groups and their member disks, and the list operation to display the disks known to the system as shown here:

    # vxvmconvert

    Volume Manager Support Operations

    Menu:: VolumeManager/LVM_Conversion

    1 Analyze LVM Volume Groups for Conversion

    2 Convert LVM Volume Groups to VxVM

    3 Roll back from VxVM to LVM

    list List disk information

    listvg List LVM Volume Group information

    ? Display help about menu

    ?? Display help about the menuing system

    q Exit from menus

    The list operation displays information about the disks on a system.

    Select an operation to perform: list

    List disk information

    Menu:: VolumeManager/LVM_Conversion/ListDisk

    Use this menu operation to display a list of disks. You can

    also choose to list detailed information about the disk at a

    specific disk device address.

    Enter disk device or "all"[<address>,all,q,?](default: all) all

    DEVICE DISK GROUP STATUS

    cciss/c0d0 - - online invalid

    cciss/c0d1 - - online

    sda - - online

    sdb disk01 rootdg online

    sdc disk02 rootdg online

    sdd disk03 rootdg online

    sde - - error

    sdf - - error

    sdg - - error

    sdh - - error

    Device to list in detail [<address>,none,q,?] (default: none)

    The DEVICE column shows the disk access names of the physical disks. If a disk has a disk media name entry in the DISK column, it is under VM control, and the GROUP column indicates its membership of a disk group. The STATUS column shows the availability of the disk to VxVM. LVM disks are displayed in the error state as they are unusable by VxVM.

    To list LVM volume group information, use the listvg operation:

    Select an operation to perform: listvg

    List LVM Volume Group information

    Menu:: VolumeManager/LVM_Conversion/ListLVMVolumeGroups

    Use this menu operation to display a list of LVM volume Groups.

    You can also choose to list detailed information about the LVMVG

    at a specific disk device address.

    Enter Volume Group (i.e.- vg04) or "all"

    [<address>,all,q,?] (default: all)

    LVM VOLUME GROUP INFORMATION

    Name Type Physical Volumes

    vg02 Non-Root /dev/sdf /dev/sdh1

    Volume Group to list in detail

    [<address>,none,q,?] (default: none) vg02

    --- Volume group ---

    VG Name vg02

    VG Access read/write

    VG Status available/resizable

    VG # 0

    MAX LV 256

    Cur LV 0

    Open LV 0

    MAX LV Size 255.99 GB

    Max PV 256

    Cur PV 2

    Act PV 2

    VG Size 16.95 GB

    PE Size 4 MB

    Total PE 4338

    Alloc PE / Size 0 / 0

    Free PE / Size 4338 / 16.95 GB

    VG UUID IxlERp-poi2-GO2D-od2b-G7fd-3zjX-PYycMn

    --- No logical volumes defined in "vg02" ---

    --- Physical volumes ---

    PV Name (#) /dev/sdf (2)

    PV Status available / allocatable

    Total PE / Free PE 2169 / 2169

    PV Name (#) /dev/sdh1 (1)

    PV Status available / allocatable

    Total PE / Free PE 2169 / 2169

    List another LVM Volume Group? [y,n,q,?] (default: n)

  2. Plan for the new VxVM logical volume names. Conversion changes the device names by which your system accesses data in the volumes. LVM creates device nodes for its logical volumes in /dev under directories named for the volume group. VxVM create device nodes in /dev/vx/dsk/diskgroup and /dev/vx/rdsk/diskgroup. After conversion is complete, the LVM device nodes no longer exist on the system.

    For file systems listed in /etc/fstab, vxvmconvert substitutes the new VxVM device names for the old LVM volume names, to prevent problems with fsck, mount, and other such utilities. However, other applications that refer to specific device node names may fail if the device no longer exists in the same place. Examine the following types of application to see if they reference LVM device names, and are at risk:

  3. Select item 1 Analyze LVM Volume Groups for Conversion from the vxvmconvert main menu to see if conversion of each LVM volume group is possible.

    This step is optional. Analysis can be run on a live system while users are accessing their data. This is useful when you have a large number of groups and disks for conversion to allow for the optimal planning and management of conversion downtime.

    The following is sample output from the successful analysis of a volume group:

    Volume Manager Support Operations

    Menu:: VolumeManager/LVM_Conversion

    1 Analyze LVM Volume Groups for Conversion

    2 Convert LVM Volume Groups to VxVM

    3 Roll back from VxVM to LVM

    list List disk information

    listvg List LVM Volume Group information

    ? Display help about menu

    ?? Display help about the menuing system

    q Exit from menus

    Select an operation to perform: 1

    Analyze one or more LVM Volume Groups

    Menu:: VolumeManager/LVM_Conversion/Analyze_LVM_VGs

    Use this operation to analyze one or more LVM Volume Groups for

    possible conversion to VxVM disk groups. This operation checks

    for problems that would prevent the conversion from completing

    successfully. For example, it calculates the space required to

    add an LVM Volume Group's disk's to a VxVM disk group and

    to replace any existing LVM partitions and volumes with VxVM

    Volume Manager volumes, plexes, and sub-disks.

    For this release, conversion is only allowed for Non-root LVM

    Volume Groups. Hence, analysis is only allowed on Non-root LVM

    Volume Groups.

    More than one Volume Group or pattern may be entered at the

    prompt.

    Here are some LVM Volume Group selection examples:

    all: analyze all LVM Volume Groups (all except Root VG)

    listvg: list all LVM Volume Groups

    list: list all disk devices

    vg_name: a single LVM Volume Group, named vg_name

    <pattern>: for example: vg04 vg09 vg08

    Select Volume Groups to analyze:

    [<pattern-list>,all,list,listvg,q,?] vg02

    vg02

    Analyze this Volume Group? [y,n,q,?] (default: y) y

    Conversion Analysis of the following devices was successful.

    /dev/sdf /dev/sdh1

    Hit RETURN to continue.

    Second Stage Conversion Analysis of vg02

    Volume Group vg02 has been analyzed and prepared for conversion.

    Volume Group Analysis Completed

    Hit RETURN to continue.

If off-disk data migration is required because there is insufficient space for on-disk data migration, you are prompted to select additional disks that can be used.

The analysis may fail for one of a number of reasons.

See "Volume group conversion limitations" on page 528.

The messages output by vxvmconvert explain the type of failure, and detail actions that you can take before retrying the analysis.

See "Examples of second stage failure analysis" on page 538.

  1. Back up your LVM configuration and user data before attempting the conversion to VxVM. Similarly, you should back up the LVM configuration itself.
    Warning: During a conversion, any spurious reboots, power outages, hardware errors or operating system bugs can have unpredictable consequences. You are advised to safeguard your data with a set of verified backups.

    Before running vxvmconvert, you can use the vgcfgbackup utility to save a copy of the configuration of an LVM volume group, as shown here:

    # vgcfgbackup volume_group_name

    This creates a backup file, /etc/lvmconf/volume_group_name.conf. Save this file to another location (such as off-line on tape or some other medium) to prevent the conversion process from overwriting it. If necessary, the LVM configuration can be restored from the backup file.

    The vxvmconvert utility also saves a snapshot of the LVM configuration data during conversion of each disk. This data is saved in a different format from that of vgcfgbackup, and it can only be used with the vxvmconvert program. With certain limitations, you can use the data to reinstate the LVM volumes after they have been converted to VxVM. Even though vxvmconvert provides this mechanism for backing up the LVM configuration, you are advised to use vgcfgbackup to save the LVM configuration information for each LVM volume group.

    Before performing a backup of the user data, note that backup procedures may have dependencies on the volume names that are currently in use on your system. Conversion to VxVM changes the volume names. You need to understand the implications that such name changes have for restoring from any backups that you make.

  2. Prevent access by applications to volumes in the volume groups to be converted. This may require you to stop databases, unmount file systems, and so on.

    vxvmconvert attempts to unmount mounted file systems before starting conversion. However, it makes no attempt to stop applications that are using those file systems, nor does it attempt to deal with applications such as databases that are running on raw LVM volumes.

    The LVM logical volumes to be converted must all be available to the vxvmconvert process. Do not deactivate the volume group or any logical volumes before running vxvmconvert.

    You can use the following command to activate a volume group:

    # vgchange -a y volume_group_name

  3. Start the conversion of each volume group by selecting item 2 Convert LVM Volume Groups to VxVM from the vxvmconvert main menu. The volume group is analyzed to ensure that conversion is possible. If the analysis is successful, you are asked whether you wish to perform the conversion.

    Convert one volume group at a time to avoid errors during conversion.

    The following is sample output from a successful conversion:

    Volume Manager Support Operations

    Menu:: VolumeManager/LVM_Conversion

    1 Analyze LVM Volume Groups for Conversion

    2 Convert LVM Volume Groups to VxVM

    3 Roll back from VxVM to LVM

    list List disk information

    listvg List LVM Volume Group information

    ? Display help about menu

    ?? Display help about the menuing system

    q Exit from menus

    Select an operation to perform: 2

    Convert one or more LVM Volume Groups

    Menu:: VolumeManager/LVM_Conversion/Convert_LVM_VGs

    Use this operation to convert LVM Volume Groups to VxVM disk

    groups.

    This adds the disks to a disk group and replaces existing LVM

    volumes with VxVM volumes. LVM-VxVM Volume Group conversion

    may require a reboot for the changes to take effect. For this

    release, only non-root LVM Volume Groups can be converted.

More than one Volume Group or pattern may be entered at the

prompt.

Here are some LVM Volume Group selection examples:

all: convert all LVM Volume Groups (all except Root VG)

listvg: list all LVM Volume Groups

list: list all disk devices

vg_name: a single LVM Volume Group, named vg_name

<pattern>: for example: vg04 vg08 vg09

Select Volume Groups to convert:

[<pattern-list>,all,list,listvg,q,? vg02

vg02

Convert this Volume Group? [y,n,q,?] (default: y) y

Conversion Analysis of the following devices was successful.

/dev/sdf /dev/sdh1

Hit RETURN to continue.

Second Stage Conversion Analysis of vg02

Volume Group vg02 has been analyzed and prepared for conversion.

Are you ready to commit to these changes?[y,n,q,?](default: y) y

vxlvmconv: making log directory /etc/vx/lvmconv/vg02.d/log.

vxlvmconv: starting conversion for VG "vg02" - Thu Feb 26

09:08:57 IST 2004

vgchange -- volume group "vg02" successfully deactivated

vxlvmconv: checking disk connectivity

Starting Conversion of vg02 to VxVM

fdisk ..

disksetup ..

dginit ..

make .

volinit ..

vxlvmconv: Conversion complete.

Convert other LVM Volume Groups? [y,n,q,?] (default: n)

If off-disk data migration is required because there is insufficient space for on-disk data migration, you are prompted to select additional disks that can be used.

  1. After converting the LVM volume groups, you can use the list operation in vxvmconvert to examine the status of the converted disks, as shown in this example:

    Select an operation to perform: list

    List disk information

    Menu:: VolumeManager/LVM_Conversion/ListDisk

    Use this menu operation to display a list of disks. You can

    also choose to list detailed information about the disk at a

    specific disk device address.

    Enter disk device or "all"[<address>,all,q,?](default: all) all

    DEVICE DISK GROUP STATUS

    cciss/c0d0 - - online invalid

    cciss/c0d1 - - online

    sda - - online

    sdb disk01 rootdg online

    sdc disk02 rootdg online

    sdd disk03 rootdg online

    sde1 vg0101 vg01 online

    sdf vg0201 vg02 online

    sdg vg0102 vg01 online

    sdh1 vg0202 vg02 online

    Device to list in detail [<address>,none,q,?] (default: none)

The LVM disks that were previously shown in the error state are now displayed as online to VxVM.

You can also use the vxprint command to display the details of the objects in the converted volumes (the TUTIL0 and PUTIL0 columns are omitted for clarity):

# vxprint

Disk group: rootdg

TY NAME ASSOC KSTATE LENGTH PLOFFS STATE

dg rootdg rootdg - - - -

dm disk01 sdb - 17778528 - -

dm disk02 sdc - 17778528 - -

dm disk03 sdd - 17778528 - -

Disk group: vg01

TY NAME ASSOC KSTATE LENGTH PLOFFS STATE

dg vg01 vg01 - - - -

dm vg0101 sde1 - 17774975 - -

dm vg0102 sdg - 17772544 - -

v stripevol gen ENABLED 1638400 - ACTIVE

pl stripevol-01 stripevol ENABLED 1638400 - ACTIVE

sd vg0102-01 stripevol-01 ENABLED 819200 0 -

sd vg0101-01 stripevol-01 ENABLED 819200 0 -

Disk group: vg02

TY NAME ASSOC KSTATE LENGTH PLOFFS STATE

dg vg02 vg02 - - - -

dm vg0201 sdf - 17772544 - -

dm vg0202 sdh1 - 17774975 - -

v concatvol gen ENABLED 163840 - ACTIVE

pl concatvol-01 concatvol ENABLED 163840 - ACTIVE

sd vg0202-02 concatvol-01 ENABLED 163840 0 -

v stripevol gen ENABLED 81920 - ACTIVE

pl stripevol-01 stripevol ENABLED 81920 - ACTIVE

sd vg0202-01 stripevol-01 ENABLED 40960 0 -

sd vg0201-01 stripevol-01 ENABLED 40960 0 -

  1. Implement the changes to applications and configuration files that are required for the new VxVM volume names. (You prepared the information for this step in step 2.)
  2. File systems can now be mounted on the new devices, and applications can be restarted. If you unmounted any file systems before running vxvmconvert, remount them using their new volume names. The vxvmconvert utility automatically remounts any file systems that were left mounted.
  3. The disks in each new VxVM disk group are given VM disk media names that are based on the disk group name. For example, if a disk group is named mydg, its disks are assigned names such as mydg01, mydg02, and so on. Plexes within each VxVM volume are named mydg01-01, mydg01-02, and so on. If required, you can rename disks and plexes.

    See "Renaming a disk" on page 136.

    See "Changing plex attributes" on page 243.

    Only rename VxVM objects in the converted disk groups when you are fully satisfied with the configuration. Renaming VxVM objects prevents you from using vxvmconvert to restore the original LVM volume groups.