User Tools

Site Tools


mount_a_lvm_vmdk_to_another_guest

Restore the VMDK to the right datastore. You'll need the host.vmdk and host-flat.vmdk files

Add the disk via the vSphere console

Rescan your bus

echo "- - -" > /sys/class/scsi_host/host2/scan

Rescan for LVM

pvscan

Look for the end volume

lvs

and mount the LVM to your mount point.

Note this works if you're just going to add one disk from the VM (and the machine has never been cloned). If you're dealing with clones you'll have to do a bit more work. The issue is that that LVM volume ID may be the same as well as the blkid. The blkid being the same is only an issue if you want to export the disk via NFS.

So before you mount the disk, I've found it is a good practice it import it.

First, check to see what disks were added by the bus scan:

dmesg

And check for the latest disk adds. Then you'll want to import it

vgimportclone -n <new volume group name> <list of disks eg /dev/sdl /dev/sdm...>

At this point you can change the volume group to active

vgchange -a y <vg_name>

And mount the volume

mount_a_lvm_vmdk_to_another_guest.txt · Last modified: 2016/07/29 13:05 by The SuperUser