[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: lvm: creating a snapshot



On Tue, 07 Oct 2014, lee wrote:
> Don Armstrong <don@debian.org> writes:
> > Doesn't matter. It just has to be a block device that you can add as
> > a physical volume to the volume group.
> 
> Isn't a logical volume of a volume group "just" a block device? The
> VMs have their LVs as block devices just fine.

Sure.

> > This is actually one of the many reasons why lvm is awesome. You can
> > migrate whole servers from one set of drives to another with no
> > downtime by using vgextend/pvmove/vgreduce.
> 
> Provided that you have free space on your disks?

You're swapping drives, so presumably one whole set of drives is empty.

> Besides the swap partition, the only block device I have available is
> a LVM logical volume which belongs to a different VG than the VG I
> want to backup LVs of.
> 
> The logical path would be to add the free LV from the other VG to the
> VG that has LVs which I want to make snapshots of in order to back
> them up because that's the only available block device.

On Tue, 07 Oct 2014, lee wrote:
> Can I merge multiple volume groups into one?

Yes, using vgmerge, assuming one of the VG is inactivated.
 
> I don't want to move LVs from one device to another. Is it possible to
> reduce a VG by some amount which is in between the beginning and the
> end of the VG (i. e. by the space which is now assigned to a LV)?

> Isn't there a command like 'lvcopy' or 'lvbackup' or 'vgcopy' or
> 'vgbackup'?

It's called dd.

> The VG is like this:

[...]

Lets back up here. What is the output of sudo pvs; sudo lvs; sudo vgs; ?

Do I understand you correctly that you want to snapshot a logical
volume, but currently don't have the space on the volume group that your
logical volume is on?

> It's very well possible that this VG doesn't reside on a partition but
> on the device itself. How would I convert that into two partitions
> without losing data?

Volume groups don't reside on partitions or devices. They encompass
physical volumes which do.

You can't change the underlying partitioning scheme under a physical
volume which is in use, but if you have enough space, you can migrate
things out to make a phsyical volume unused.

 
> That should be easily possible because the LVs can reside where they
> are, and their container is the only thing that changes.  Once they are
> merged, I should be able to move any LV to any device which is part of
> the VG.
> 
> I wouldn't need to move any of the VGs because the VG resulting from the
> merge would have free space so that I could finally make snapshots.
> When I'm done with the snapshots, I could split the VG again.
> 
> Is that possible?
> 
> 
> -- 
> Hallowed are the Debians!
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 87vbnwg2w1.fsf@yun.yagibdah.de">https://lists.debian.org/[🔎] 87vbnwg2w1.fsf@yun.yagibdah.de
> 

-- 
Don Armstrong                      http://www.donarmstrong.com

This message brought to you by weapons of mass destruction related
program activities, and the letter G.


Reply to: