* [linux-lvm] Snapshots
@ 2009-09-17 14:24 Jon Hardcastle
2009-09-17 14:32 ` [linux-lvm] Snapshots Mike Snitzer
2009-09-17 14:37 ` [linux-lvm] Snapshots Peter Keller
0 siblings, 2 replies; 4+ messages in thread
From: Jon Hardcastle @ 2009-09-17 14:24 UTC (permalink / raw)
To: linux-lvm
Hi,
Do I need some free extents to create a READ ONLY snapshot? I dont have free extents but require a read-only snapshot before doing an upgrade.
Cheers.
-----------------------
N: Jon Hardcastle
E: Jon@eHardcastle.com
'Do not worry about tomorrow, for tomorrow will bring worries of its own.'
-----------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* [linux-lvm] Re: Snapshots
2009-09-17 14:24 [linux-lvm] Snapshots Jon Hardcastle
@ 2009-09-17 14:32 ` Mike Snitzer
2009-09-17 14:37 ` [linux-lvm] Snapshots Peter Keller
1 sibling, 0 replies; 4+ messages in thread
From: Mike Snitzer @ 2009-09-17 14:32 UTC (permalink / raw)
To: Jon, LVM general discussion and development
On Thu, Sep 17 2009 at 10:24am -0400,
Jon Hardcastle <jd_hardcastle@yahoo.com> wrote:
> Hi,
>
> Do I need some free extents to create a READ ONLY snapshot? I dont
> have free extents but require a read-only snapshot before doing an
> upgrade.
Yes, even though you intend to only read from the snapshot the upgrade
will cause data to be copied out from the origin to the snapshot. So
you definitely need some free extents.
Mike
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [linux-lvm] Snapshots
2009-09-17 14:24 [linux-lvm] Snapshots Jon Hardcastle
2009-09-17 14:32 ` [linux-lvm] Snapshots Mike Snitzer
@ 2009-09-17 14:37 ` Peter Keller
1 sibling, 0 replies; 4+ messages in thread
From: Peter Keller @ 2009-09-17 14:37 UTC (permalink / raw)
To: LVM general discussion and development
Dear John,
On Thu, 17 Sep 2009, Jon Hardcastle wrote:
> Hi,
>
> Do I need some free extents to create a READ ONLY snapshot? I dont have
> free extents but require a read-only snapshot before doing an upgrade.
Extents are written to the snapshot when changes take place on the volume
that the snapshot is based on. If you have no free extents, trying to create
a snapshot strikes me as pointless: you may as well mount the origin volume
read-only and back up its contents directly (or unmount it and back it up at
the level of the volume). Or do you have some special circumstances?
If you make the snapshot read-only, as soon as changes occur on the origin
volume the snapshot will become useless: some of the data that are required
to make the snapshot usable (i.e. unchanged copies of altered blocks on the
origin volume) will no longer exist.
Regards,
Peter.
--
Peter Keller Tel.: +44 (0)1223 353033
Global Phasing Ltd., Fax.: +44 (0)1223 366889
Sheraton House,
Castle Park,
Cambridge CB3 0AX
United Kingdom
^ permalink raw reply [flat|nested] 4+ messages in thread
* [linux-lvm] Snapshots
@ 2009-09-10 23:25 jonr
2009-09-11 13:44 ` [linux-lvm] Snapshots Mike Snitzer
0 siblings, 1 reply; 4+ messages in thread
From: jonr @ 2009-09-10 23:25 UTC (permalink / raw)
To: LVM general discussion and development
Hello List,
I don't get it!
I have a xen system that has a DomU of FC11 with a 20GB LV for the
disk. I created a snapshot using this command:
lvcreate -L +10G -s -n s_cgate-be1 /dev/xenvg/cgate-be1
This is the output of an 'lvdisplay' of the snapshot LV:
lvdisplay /dev/xenvg/s_cgate-be1
--- Logical volume ---
LV Name /dev/xenvg/s_cgate-be1
VG Name xenvg
LV UUID 7c1kEs-xYoO-Qxem-2E2M-hlee-pc4Q-zm6TZ5
LV Write Access read/write
LV snapshot status active destination for /dev/xenvg/cgate-be1
LV Status available
# open 2
LV Size 20.00 GB
Current LE 5120
COW-table size 10.00 GB
COW-table LE 2560
Allocated to snapshot 0.11%
Snapshot chunk size 4.00 KB
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:15
I then shutdown the DomU and pointed the 'Disk...' line in the config
file for the DomU to the snapshot. It boots.
OK, I must be missing the simple answer because I cannot seem to grasp
the concept of snapshots.
1. How can I have a 20GB LV as a disk and the snapshot be 10GB and
boot the entire OS?
2. Can I create a DomU and then snapshot the LV and use the snapshot
to create other DomU's?
3. If 2 is yes, would I want to continue using the snapshot as the
disk or is there something else that should be done, i.e. dd the drive
to a new LV?
In the 'lvdisplay' of the snapshot I have these extra lines:
LV snapshot status active destination for /dev/xenvg/cgate-be1
# open 2
COW-table size 10.00 GB
COW-table LE 2560
Allocated to snapshot 0.11%
Snapshot chunk size 4.00 KB
4. Does the 0.11% mean that the 10GB snapshot file is only using .11%
of the 10GB LV?
If there is a good doc out there explaining all of this could someone
just post a link. I don't mind reading but am not getting the answers
to the above. I have found lots of docs explaining how to do it but
nothing going much further than that.
Thanks for any help,
Jon
^ permalink raw reply [flat|nested] 4+ messages in thread
* [linux-lvm] Re: Snapshots
2009-09-10 23:25 jonr
@ 2009-09-11 13:44 ` Mike Snitzer
0 siblings, 0 replies; 4+ messages in thread
From: Mike Snitzer @ 2009-09-11 13:44 UTC (permalink / raw)
To: LVM general discussion and development
On Thu, Sep 10 2009 at 7:25pm -0400,
jonr@destar.net <jonr@destar.net> wrote:
> Hello List,
>
> I don't get it!
The snapshot diagrams from Alasdair's old FOSDEM slides should help you
visualize the kernel layers involved beneath LVM (e.g. dm-snapshot):
http://people.redhat.com/agk/talks/FOSDEM_2005/
Starting with the "Snapshot" slide through "Two Snapshots". Without
having text associated with each slide it may be too terse for you
but I recommend having a look...
> 1. How can I have a 20GB LV as a disk and the snapshot be 10GB and boot
> the entire OS?
The snapshot LV is backed by the "COW" in the diagrams above. If you
wanted to accommodate _every_ block changing in the origin LV (copied out
to the snapshot LV) you'd have to size the snapshot LV to be a bit
larger than the origin LV (snapshot metadata has some small overhead).
Sizing your snapshot LV is all about how you intend to use the
snapshot. E.g. what is the expected rate of change to the origin LV
while you intend to have the snapshot active? If you'll be changing the
origin extensively then you want to use a larger snapshot LV.
> 2. Can I create a DomU and then snapshot the LV and use the snapshot to
> create other DomU's?
Sure, but I'd imagine you'd have to change some unique identifiers in
the DomU so that it can co-exist with the original. These changes would
get written through the "snapshot" layer in the kernel and directly out
to the COW (would never touch the origin LV; not to be confused with
"origin" layer :).
> 3. If 2 is yes, would I want to continue using the snapshot as the disk
> or is there something else that should be done, i.e. dd the drive to a
> new LV?
Depends how permanent you need the new DomU to be. And how much
simultaneous change you expect to the original DomU.
The emerging "multi-snapshot" implementation that Mikulas Patocka is
actively working on is really geared toward this Xen DomU snapshot
use-case. Mikulas has posted his patches to dm-devel but it'll be a bit
longer before they are all merged into an upstream Linux kernel.
Mike
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-09-17 14:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 14:24 [linux-lvm] Snapshots Jon Hardcastle
2009-09-17 14:32 ` [linux-lvm] Snapshots Mike Snitzer
2009-09-17 14:37 ` [linux-lvm] Snapshots Peter Keller
-- strict thread matches above, loose matches on Subject: below --
2009-09-10 23:25 jonr
2009-09-11 13:44 ` [linux-lvm] Snapshots Mike Snitzer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).