Search This Blog

Monday, June 24, 2013

How to convert a Logical Volume Manager volume group with striped logical volume to a VERITAS Volume Manager (tm) disk group using vxvmconvert

1. Partial output of lvdisplay on a Logical Volume Manager (LVM) striped logical volume:

--- Logical volumes ---
LV Name                     /dev/vg01/lvol1
VG Name                     /dev/vg01
LV Permission               read/write  
LV Status                   available/syncd          
Mirror copies               0           
Consistency Recovery        MWC                
Schedule                    striped     
LV Size (Mbytes)            1008           
Current LE                  252      
Allocated PE                252        
Stripes                     3      
Stripe Size (Kbytes)        64                 
Bad block                   on          
Allocation                  strict                   
IO Timeout (Seconds)        default            

  --- Distribution of logical volume ---
  PV Name            LE on PV  PE on PV 
  /dev/dsk/c7t1d0    84        84       
  /dev/dsk/c7t2d0    84        84       
  /dev/dsk/c7t4d0    84        84       
2. Unmount all file systems

3. Run vxvmconvert and select option 1, Analyze LVM Volume Groups for Conversion:

# 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

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,?] vg01

vg01

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

The following disks have been found in the volume group and will be analyzed for VxVM conversion.

 c7t1d0 c7t2d0 c7t4d0

To allow analysis, a new VxVM disk group, dg01, will be fabricated and the disk device c7t1d0 will be added to the disk group with the disk name dg0101.

The c7t1d0 disk has been analyzed and prepared for conversion.

To allow analysis, a new VxVM disk group, dg01, will be fabricated and the disk device c7t2d0 will be added to the  disk group with the disk name dg0102.

The c7t2d0 disk has been analyzed and prepared for conversion.

To allow analysis, a new VxVM disk group, dg01, will be fabricated and the disk device c7t4d0 will be added to the disk group with the disk name dg0103.

The c7t4d0 disk has been analyzed and prepared for conversion.

The first stage of the Analysis process completed successfully.

Second Stage Conversion Analysis of  vg01
Analysis of vg01 found sufficient Private Space for conversion


Conversion Analysis of the following devices was successful.

 c7t1d0 c7t2d0 c7t4d0

Hit RETURN to continue.


  Volume Group Analysis Completed

Hit RETURN to continue.

4. Now select option 2, Convert LVM Volume Groups to VxVM:

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,?] vg01

vg01

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

Specify a name for the new VxVM disk group (default: dg01) EMCdg

The following disks have been found in the vg01 volume group  and will be configured for conversion to VxVM disk groups.

 c7t1d0 c7t2d0 c7t4d0

A new disk group EMCdg will be created and the disk device c7t1d0  will be converted and added to the disk group with the disk name EMCdg01.

The c7t1d0 disk has been analyzed and prepared for conversion.

A new disk group EMCdg will be created and the disk device c7t2d0 will be converted and added to the disk group with the disk name EMCdg02.

The c7t2d0 disk has been analyzed and prepared for conversion.

A new disk group EMCdg will be created and the disk device c7t4d0 will be converted and added to the disk group with the disk name EMCdg03.

The c7t4d0 disk has been analyzed and prepared for conversion.

The first stage of the conversion operation has completed successfully.  If you commit to the changes hereafter, the system
will attempt to umount all of the associated file systems, stop and export each Volume Group, and then attempt to complete the conversion without having to reboot the system. If we are unable to stop and export any of the Volume Groups, then the conversion process will not be able to complete without a reboot. You would then be given the choice to either abort the conversion, or finish the conversion by rebooting the system.

The conversion process will update the /etc/fstab file so that volume devices are used to mount the file systems on this disk device.  You will need to update any other references such as backup scripts, databases, or manually created swap devices. If you do not like the default names chosen for the corresponding logical volumes, you may change these to whatever you like using vxedit.

Second Stage Conversion Analysis of  vg01
Analysis of vg01 found sufficient Private Space for conversion


Conversion Analysis of the following devices was successful.

c7t1d0 c7t2d0 c7t4d0

Hit RETURN to continue.

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

Saving LVM configuration records for Volume Group vg01 ...

LVM Volume Group vg01 records saved.

Unmounting vg01 file systems...

The Volume Manager is now reconfiguring (partition phase)...

Volume Manager: Initializing c7t1d0 as a converted LVM disk.

Volume Manager: Initializing c7t2d0 as a converted LVM disk.

Volume Manager: Initializing c7t4d0 as a converted LVM disk.

Volume Manager:  Reconfiguration will be done without rebooting.

The Volume Manager is now reconfiguring (initialization phase)...

Volume Manager: Adding EMCdg01 (c7t1d0) as a converted LVM disk.

Volume Manager: Adding EMCdg02 (c7t2d0) as a converted LVM disk.

Volume Manager: Adding EMCdg03 (c7t4d0) as a converted LVM disk.
Adding volumes for c7t1d0...
Starting new volumes...
Updating /etc/fstab...

Volume Manager:  Converting LVM Volume Groups to VxVM disk groups.

Convert other LVM Volume Groups? [y,n,q,?] (default: n)
5. Now /etc/fstab has been updated:

# more /etc/fstab:

# System /etc/fstab file.  Static information about the file systems
# See fstab(4) and sam(1M) for further details on configuring devices.
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /opt vxfs delaylog 0 2
/dev/vg00/lvol5 /tmp vxfs delaylog 0 2
/dev/vg00/lvol6 /usr vxfs delaylog 0 2
/dev/vg00/lvol7 /var vxfs delaylog 0 2
/dev/vg00/lvol8 /home vxfs delaylog 0 2
/dev/vx/dsk/EMCdg/lvol1 /data1  vxfs    delaylog        0       2
#NOTE: volume lvol1 (/data1) converted LVM volume vg01/lvol1
6. Make sure all volumes of the newly converted disk group are enabled/active:

# vxprint -g EMCdg -ht

dg EMCdg        default      default  6747000  1058980812.1057.cshp7

dm EMCdg01      c7t1d0       simple   896      4191976  -
dm EMCdg02      c7t2d0       simple   896      4193133  -
dm EMCdg03      c7t4d0       simple   896      4193133  -

v  lvol1        -            ENABLED  ACTIVE   1032192  fsgen     -        ROUND
pl lvol1-01     lvol1        ENABLED  ACTIVE   1032192  STRIPE    3/64     RW
sd EMCdg01-03   lvol1-01     EMCdg01  0        344064   0/0       c7t1d0   ENA
sd EMCdg02-03   lvol1-01     EMCdg02  0        344064   1/0       c7t2d0   ENA
sd EMCdg03-03   lvol1-01     EMCdg03  0        344064   2/0       c7t4d0   ENA

7. Mount all file systems:

# mountall


8. Make sure the file systems are mounted correctly:

# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3     204800   49712  153880   24% /
/dev/vg00/lvol1     295024   42976  222544   16% /stand
/dev/vg00/lvol7    1331200  567952  758424   43% /var
/dev/vg00/lvol6    1290240  688552  597016   54% /usr
/dev/vg00/lvol5     204800    2336  200888    1% /tmp
/dev/vg00/lvol4    1433600  132688 1290776    9% /opt
/dev/vg00/lvol8      20480    2280   18072   11% /home
/dev/vx/dsk/EMCdg/lvol3
                   417792    1205  390558    0% /data3

No comments:

Post a Comment