create snapshot from a lv with a lv on another vg

Hi,
i’m using lvm on some sles 10 SP4 systems. I’d like to have the ability of snapshotting some lv’s, but due to lack of diskspace this is currently not possible.
I’d like to install another hd, create a pv on it, create a new vg and then snapshot one or more lv’s.
Is this possible although the snapshot lv’s reside on another vg ?
I’d could add the new pv of course to the existing vg, but how can i be sure that the new pv is not only used by the snapshots but also from the existing lv’s ?
I installed already one hd for the snapshots, but now the hd is broken. And i’m a bit afraid of removing it because i’m unsure if there isn’t some data form the existing lv’s (not from the snapshots !) on it.
pvdisplay says all extends form this pc are free.

Thanks.

Bernd

Hi,

snapshots has to be in same VG as the source.

Why do you want to prevent lvm to use the new PV for non-snapshot PE´s ?
One could set Allocatable = no (pvchange -x n /dev/newdisk) after creating the snapshot,
but that will beak the snapshot when the snapshot wants to grow and there
no free PE elsewhere.

To the broken HD: when pvdisplay says there are no allocated PE´s on that pv - it should be safe
to remove the PV from the VG. If one try to vgreduce a in-use PV it will complain.

regards

Michael

Hi Michael,

i removed the broken hd doing vgreduce and pvremove and it seemed to work.
The new hd is NOT part of a RAID. I have a RAID system in this server, but it is fully occupied. No space to add a disk to the RAID in the server.
The new hd is just connected via IDE.
So all data which resides on the additional hd is lost when the hd breaks. The snapshot is just temporary, before changes of a webapplication (configuration and scripts) running on the server. It does not have to provide the data over a long period.
If the app does not work properly, i will revert quickly. But if data resides for a longer period on this single hd, and suddenly it breaks, i have a problem.
When i create a snapshot, i can explicitly tell to use this hd: “lvcreate --size 5G --name snap_usr --snapshot /dev/vg1/lv3 -v /dev/hdd1”. Right ?
The existing RAID system does not have enough free space in the vg to create new lv’s for snapshots.
But what is if i don’t extend the existing logical volumes, just create new ones for snapshots ? Will then be data from the existing lv’s moved to the new hd ? Or just the new data from the snapshots will be stored on the new hd ?
Does lvm “move” existing data ? The existing lv’s and the existing vg does currently fit exactly to the RAID system, with just some MB’s free.

Bernd

in general one can define where lvcreate to put the PE´s on. I did not try to do so
for snapshots, but syntax seem to be ok…

If you dont extend the existing lvols (manualy or by using thin lvols) nor pvmove them i do not see any reason why lvm
should start to move PE´s from the old disks to the new disk or alloc new PE´s there.

Michael

Hi Michael,

i believe the same. So for the moment i’m safe.
Thanks for your help.

Bernd