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

Re: lvm: creating a snapshot



Don Armstrong <don@debian.org> writes:

> On Sun, 05 Oct 2014, lee wrote:
>> So it would have to be at least a partition? I don't have one free ...
>> I could use the swap partition temporarily for something like that.
>
> Doesn't matter. It just has to be a block device that you can add as a
> physical volume to the volume group. [And obviously, it shouldn't be a
> block device which already exists within the volume group, like a file
> on a logical volume which is in the volume group... that way lies
> madness.]

Isn't a logical volume of a volume group "just" a block device?  The VMs
have their LVs as block devices just fine.

>> Once I added such a partition to a volume group, can I simply remove
>> it from the VG when I don't need it anymore?
>
> Yes, you can use pvmove to make sure that everything is off of that
> physical volume, and then vgreduce to remove that physical volume from
> the volume group.
>
> 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?  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.  That would provide the
required the free space for the snapshots in that VG.

Isn't that possible?

I fail to see why/how LVM is awesome.  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'?


The VG is like this:

D....|..|................................D

I would have to reduce it to this, unless it's possible to split a VG
into multiple parts:

D....|................................|__D

Then I would need to shrink the partition the VG resides on to be able
to create a second partition behind it which I then could add to the
other VG to make the snapshots.  That's anything but awesome.

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?


-- 
Hallowed are the Debians!


Reply to: