All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] snapshotting to a different volume group
@ 2008-04-17 14:58 Stephane Chazelas
  2008-04-18  8:24 ` Heinz Mauelshagen
  0 siblings, 1 reply; 5+ messages in thread
From: Stephane Chazelas @ 2008-04-17 14:58 UTC (permalink / raw)
  To: linux-lvm

Hiya,

I hope you could help me on this:


in short:

is it possible to create a snapshot LV of an original LV
but in a different volume group?

or alternatively, what's the best way to bring up a LV in a VG
that is missing a PV (as in a disk crash) if that LV has all its
extents on still sane PVs?


in long:

basically, this is what I would like to do:

I have two disks, not as much as I would like, and I want:
  - to have 100GB of data mirrored (using Linux software raid
    (mdadm)) on 2 disks so that it survives disk crashs
  - to make a number of frequent snapshots of that data to
    be able to restore things in case of human errors.
  - (and I also want to have some "striped" storage space for
    worthless data).

BUT, I don't want to have the snapshot volumes mirrored.

My initial idea was to have 2 volume groups: a "safe" one with
only one /dev/md0 PV and an "unsafe" one with the striped LVs
and the snapshots.

However I couldn't find how to create snapshots of the LVs in
"safe" into the "unsafe" VG. It seems to me that it should be
possible, shouldn't it?

Anyway, then I merged the two "safe" and "unsafe" VGs into one
"vol" VG. Now I can make snapshots of the LV physically located
on /dev/md0 into the "unsafe" area.

But if one of the disks fails, /dev/md0 will still be available
but the "vol" VG won't be able to come up because of the other
missing PVs.

If such a thing happen, I can happily live with the missing
snapshots and "unsafe" storage for a while until I buy a
replacement HD, but how should I do about making sure that the
/dev/md0 filesystem is still available in the mean time?

Or is there a more straightforward way to achieve this that I
haven't thought of?

TIA,
Stephane

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] snapshotting to a different volume group
  2008-04-17 14:58 [linux-lvm] snapshotting to a different volume group Stephane Chazelas
@ 2008-04-18  8:24 ` Heinz Mauelshagen
  2008-04-18  9:35   ` Stephane Chazelas
  2008-04-18 11:53   ` Stephane Chazelas
  0 siblings, 2 replies; 5+ messages in thread
From: Heinz Mauelshagen @ 2008-04-18  8:24 UTC (permalink / raw)
  To: linux-lvm

On Thu, Apr 17, 2008 at 03:58:09PM +0100, Stephane Chazelas wrote:
> Hiya,
> 
> I hope you could help me on this:
> 
> 
> in short:
> 
> is it possible to create a snapshot LV of an original LV
> but in a different volume group?

No, not with LVM.

> 
> or alternatively, what's the best way to bring up a LV in a VG
> that is missing a PV (as in a disk crash) if that LV has all its
> extents on still sane PVs?

vgchange -P -ay

If you have 2 disks, you better mirror them to be completely
HA on the spindle side of things and avoid any such config hassle,
potentially leaving you with lost data.

Heinz

> 
> 
> in long:
> 
> basically, this is what I would like to do:
> 
> I have two disks, not as much as I would like, and I want:
>   - to have 100GB of data mirrored (using Linux software raid
>     (mdadm)) on 2 disks so that it survives disk crashs
>   - to make a number of frequent snapshots of that data to
>     be able to restore things in case of human errors.
>   - (and I also want to have some "striped" storage space for
>     worthless data).
> 
> BUT, I don't want to have the snapshot volumes mirrored.
> 
> My initial idea was to have 2 volume groups: a "safe" one with
> only one /dev/md0 PV and an "unsafe" one with the striped LVs
> and the snapshots.
> 
> However I couldn't find how to create snapshots of the LVs in
> "safe" into the "unsafe" VG. It seems to me that it should be
> possible, shouldn't it?
> 
> Anyway, then I merged the two "safe" and "unsafe" VGs into one
> "vol" VG. Now I can make snapshots of the LV physically located
> on /dev/md0 into the "unsafe" area.
> 
> But if one of the disks fails, /dev/md0 will still be available
> but the "vol" VG won't be able to come up because of the other
> missing PVs.
> 
> If such a thing happen, I can happily live with the missing
> snapshots and "unsafe" storage for a while until I buy a
> replacement HD, but how should I do about making sure that the
> /dev/md0 filesystem is still available in the mean time?
> 
> Or is there a more straightforward way to achieve this that I
> haven't thought of?
> 
> TIA,
> Stephane
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat GmbH
Consulting Development Engineer                   Am Sonnenhang 11
Storage Development                               56242 Marienrachdorf
                                                  Germany
Mauelshagen@RedHat.com                            PHONE +49  171 7803392
                                                  FAX   +49 2626 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] snapshotting to a different volume group
  2008-04-18  8:24 ` Heinz Mauelshagen
@ 2008-04-18  9:35   ` Stephane Chazelas
  2008-04-18 11:53   ` Stephane Chazelas
  1 sibling, 0 replies; 5+ messages in thread
From: Stephane Chazelas @ 2008-04-18  9:35 UTC (permalink / raw)
  To: mauelshagen, LVM general discussion and development

2008-04-18 10:24:36 +0200, Heinz Mauelshagen:
> On Thu, Apr 17, 2008 at 03:58:09PM +0100, Stephane Chazelas wrote:
[...]
> > is it possible to create a snapshot LV of an original LV
> > but in a different volume group?
> 
> No, not with LVM.

Hi Heinz,

thanks. I've just come accross zumastor while reading the ML
archives. It looks promising for what I'm trying to achieve. I
suspect it's gonna be the same wrt to snapshot though, but I'll
give it a try.

> > or alternatively, what's the best way to bring up a LV in a VG
> > that is missing a PV (as in a disk crash) if that LV has all its
> > extents on still sane PVs?
> 
> vgchange -P -ay

Oh thanks. I missed that as the option was described in lvm(8)
and not in vgchange(8). I'll see how to make it fit in the
initrd scripts.

> If you have 2 disks, you better mirror them to be completely
> HA on the spindle side of things and avoid any such config hassle,
> potentially leaving you with lost data.
[...]

I didn't get that ("the spindle side of things"??). Do you mean
I should mirror the whole disks? Note that they are not the same
size. The thing is I have 400 GB of disk space available, I only
need 100GB of data to be "safe". If I had 2 200GB drives and
wanted to mirror everything, and have 50GB for snapshots, that
would leave me with 150 GB for data. While as I need only 100GB
of safe data and don't need the snapshots to be mirrored. I can
have 250 GB of storage, 150 GB of which I don't care if it's
lost (mirrors and snapshots).

Best regards,
Stephane

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] snapshotting to a different volume group
  2008-04-18  8:24 ` Heinz Mauelshagen
  2008-04-18  9:35   ` Stephane Chazelas
@ 2008-04-18 11:53   ` Stephane Chazelas
  2008-04-18 12:45     ` Stephane Chazelas
  1 sibling, 1 reply; 5+ messages in thread
From: Stephane Chazelas @ 2008-04-18 11:53 UTC (permalink / raw)
  To: mauelshagen, LVM general discussion and development

2008-04-18 10:24:36 +0200, Heinz Mauelshagen:
[...]
> > or alternatively, what's the best way to bring up a LV in a VG
> > that is missing a PV (as in a disk crash) if that LV has all its
> > extents on still sane PVs?
> 
> vgchange -P -ay
[...]

I just tried that with loop devices. Unfortunately, the LV comes
up in read-only.  And lvdisplay doesn't show the still sane LVs.

dmsetup info shows it as read-only and lvdisplay -P as
read/write, btw:

lvdisplay -P:

--- Logical volume ---
LV Name                /dev/test/fs
VG Name                test
LV UUID
U03Sgj-dVYW-TBSs-fJHN-qXbm-y3vf-nN58mV
LV Write Access        read/write

dmsetup info:

Name:              test-fs
State:             ACTIVE (READ-ONLY)
Read Ahead:        256
Tables present:    LIVE
Open count:        1
Event number:      0
Major, minor:      253, 4
Number of targets: 1
UUID:
LVM-CL1U6NmSQ0QxvXkg8Iy4BEJE4kzEAJokU03SgjdVYWTBSsfJHNqXbmy3vfnN58mV


By bypassing LVM2 and using dmsetup directly, would I
theoretically be able to setup a snapshot outside of LVM2
managed volume groups, is it worth me trying to dig that way?
Something like: having a LVM (or not) volume group with only
/dev/md0 and creating snapshots of that elsewhere while leaving
the VG containing /dev/md0 undisturbed?

TIA,
Stephane

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] snapshotting to a different volume group
  2008-04-18 11:53   ` Stephane Chazelas
@ 2008-04-18 12:45     ` Stephane Chazelas
  0 siblings, 0 replies; 5+ messages in thread
From: Stephane Chazelas @ 2008-04-18 12:45 UTC (permalink / raw)
  To: mauelshagen, LVM general discussion and development

2008-04-18 12:53:15 +0100, Stephane Chazelas:
[...]
> By bypassing LVM2 and using dmsetup directly, would I
> theoretically be able to setup a snapshot outside of LVM2
> managed volume groups, is it worth me trying to dig that way?
> Something like: having a LVM (or not) volume group with only
> /dev/md0 and creating snapshots of that elsewhere while leaving
> the VG containing /dev/md0 undisturbed?
[...]

[replying to myself]

OK, I get it.

When one creates a snapshot, he changes the original block
device to be a "snapshot-origin" so that every write to the
device is forked into:
  - copying the original block to the snapshot device(s) COW(s)
  - writing to the original device.

So, if I've got the COWs on a failed disk, I suspect this might
degrade the performances or even stop the snapshot-origin from
working altogether wouldn't it?

I'll keep testing...

-- 
Stephane

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-18 12:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-17 14:58 [linux-lvm] snapshotting to a different volume group Stephane Chazelas
2008-04-18  8:24 ` Heinz Mauelshagen
2008-04-18  9:35   ` Stephane Chazelas
2008-04-18 11:53   ` Stephane Chazelas
2008-04-18 12:45     ` Stephane Chazelas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.