mellotanica mellotanica - 1 year ago 48
Linux Question

lvm: create snapshot between volume groups

is there a way to create a snapshot of a logical volume (

) that resides into volume group
inside a different volume group (say

i have my root logical volume in volume group
on the SSD and i want to take a snapshot of the volume on the second volume grout
that sits onto the mechanical hard disk, so i tried to execute

lvcreate -L 10G -s -n vgB/rootSnapshot vgA/rootVolume

and some other variants but had no luck..

Answer Source

The snapshot volume must reside on the same VG as lv1.

For your situation, you may want to consider creating one VG (vgA) that spans over two PVs (pv1 for SSD, and pv2 for mechanical hard disk). Then you can create lv1 on pv1 and lvsnap on pv2.

 lvcreate -L 100G -n lv1 vgA /dev/pv1
 lvcreate -L 10G -s -n lvsnap /dev/vgA/lv1 /dev/pv2