LVM pvmove guide for new hardware / data migrations – vmware or tin

Share This:

Quick scenario,

Virtual server had 1 lvm logical group containing 1 volume group and 1 physical volume.
Vmware 5.1 has a limitation of 2TB for a single file on its filestore therefore once expanded SAN volume to 3TB it turned out that wasn’t a good idea…isn’t it?!
Consequences? Virtual raw device mapping was not longer possible (required for veeam replication…)

Solution?

Another larger volume mapped from datastore (rather than raw mapping) of 1.9TB.

LVM volume group extended to include that volume, vgextend /sdc1 (new vol)

LVM physical device move within lvm command moves physical extends onto the new volume – pvmove /sdb1 /sdc1 (move happens on the block level and saves ages on data migrations)

LVM reduce the volume group of the old disk after pvmove finished – vgreduce /sdb1

LVM reize to the new size – lvextend -L +300G lvm_mylvm

resize2fs /dev/vg_mylvm/lvm_mylvm to extend the physical size.

Any new disk could be added to lvm preferably residing on same datastore, sequence for adding:

vgextend vg_lvm /newdev , lvextend -L + newspace (500GB etc) lvm_mylvm

resize2fs /dev/vg_lvm/lvm_mylvm

This method can be used outside of VMware, using physical disks etc.

Leave a comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.