[linux-lvm] How to use hardware snapshots [was (no subject)]

Alasdair G Kergon agk at redhat.com
Thu Mar 16 15:34:41 UTC 2006


On Thu, Mar 16, 2006 at 04:08:12PM +0100, fredrik.backman at nll.se wrote:
> Im doing a snapshot (hardware-based in EVA5000) of a LV (lvm2) and i 
> wonder what is the correct way to use this snapshot? Problem is that 
> this snapshot has the same ID as the original one. In HP-UX a would do a 
> vgchgid on this snapshot-LV. Any help would be aprreciated.

Firstly your snapshot will be at the PV level not the LV level.
You must take a hardware snapshot of a complete VG i.e. every PV
within that VG.   [If that's too much data, use pvmove and vgsplit first.]

Current lvm tools can't handle two cloned VGs on the same machine,
so you have to hide the old one before you can manipulate the new one.

Make a temporary copy of /etc/lvm/ somewhere.
Edit lvm.conf there so it filters out everything except your cloned PVs.
Set the environment variable LVM_SYSTEM_DIR to point to your temporary
copy of /etc/lvm.  

Run pvchange --uuid on each of the new PVs.
Run vgchange --uuid on the VG.  Run vgrename to give it a unique name.
Then remove the LVM_SYSTEM_DIR environment variable and run vgscan
and you should be able to use both old and new VGs.

[I'm hoping to enhance the tools to simplify this process late next month.]

Alasdair
-- 
agk at redhat.com




More information about the linux-lvm mailing list