LVM: Difference between revisions

From DWIKI
Line 51: Line 51:




=lvremove:  Logical volume vg-kvm/vps-snapshot is used by another device.==
==lvremove:  Logical volume vg-kvm/vps-snapshot is used by another device.==
???
???
*http://naveen161089.blogspot.nl/2014/03/forcefully-remove-lvm.html
*http://naveen161089.blogspot.nl/2014/03/forcefully-remove-lvm.html

Revision as of 11:13, 7 October 2016

Logical Volume Management on Linux

NOTE: remember to add snapshot support when calling lvcreate

Related commands

lvdisplay

lsblk

partprobe

lvchange

vgchange

dmsetup

vgs

lvcreate

FAQ

Access logical volumes within logical volume

partprobe /dev/mapper/vg-mydata
lsblk

This will show the (sub) partitions/volumes, then edit /etc/lvm/lvm.conf

filter = [ "a|.*/|", "a|mydata|","r|.*|" ]

Then run:

vgscan
lvscan
vgs

Now you should see the names of the volumes you're looking for, so now:

vgchange -a y guestsname_mydata-home

and then you should be able to

mount /dev/mapper/guestsname_mydata-home

When done, remember to change back the filter in lvm.conf, default is

filter = [ "a|.*/|" ]

and of course then once again

vgscan
lvscan


lvremove: Logical volume vg-kvm/vps-snapshot is used by another device.

???

some say lvchange -an the snapshot first, but that disables the lv it's connected to as well