Skip to contentSkip to conversation

Long-term snapshots possible?

linux-lvm Jason Smith 6 participants 7 messages Mar 11, 2003 – Mar 13, 2003

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi. Like many others, I'm interested in using LVM2 as a componet for a Linux-based file server.

When needed, I had hoped to sacrifice disk space for long-term filesystem snapshots, by creating multiple snapshots and rotating them out on perhaps a weekly basis. The intent is to emulate the convenience and power of similar snapshot features in commercial file servers.

My problem is, this does not currently look possible without a severe performance hit. If a volume has, for example, five active snapshots, then the deltas seem to get written five times, once per snapshot volume.

Alternatively, I could use meta-snapshots, but they are not currently implemented, and that idea sounds klugy.

So then do the LVM developers and users recommend against multiple concurrent snapshots of a volume? Should I keep hope for this great feature, only found in commercial file servers?

Thanks for any input.

- --
Jason Smith
Open Enterprise Systems
Bangkok, Thailand
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+bgCmm5qEoSbpT3kRAjxRAJ9TNBPYJdAkMjfrW+vZdbGcsKXXiwCgmzCD FwlwesFuyYHYE1dsFIbmAv0=
=1opb
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 5 lines · Jason Smith

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi. Like many others, I'm interested in using LVM2 as a componet for a Linux-based file server.

i only have experience with the first lvm implementation, not with lvm2.

Quoted 4 lines

When needed, I had hoped to sacrifice disk space for long-term filesystem snapshots, by creating multiple snapshots and rotating them out on perhaps a weekly basis. The intent is to emulate the convenience and power of similar snapshot features in commercial file servers.

i used to do 4. Every hour, every 8 hour, every day, and every week. I gave up because it was too unstable. But since that there has been found a few bugs in lvm1 snapshots.

Quoted 3 lines

My problem is, this does not currently look possible without a severe performance hit. If a volume has, for example, five active snapshots, then the deltas seem to get written five times, once per snapshot volume.

How would you not do that ? You have to store the snapshots some how.

Quoted 2 lines

Alternatively, I could use meta-snapshots, but they are not currently implemented, and that idea sounds klugy.

meta snapshots ?

Quoted 3 lines

So then do the LVM developers and users recommend against multiple concurrent snapshots of a volume? Should I keep hope for this great feature, only found in commercial file servers?

well, if you need it you can either implement it yourself, or possibly find someone who can do it for you.

Quoted 1 line

Thanks for any input.

Until this get made you can simulate this, though with the exception that it will take a little time, and use linear to the number of snapshots extra space.
You take a snapshot. Then you create another LV, mkfs it, and rsync the data from the snapshot to the new LV. When that is done you have a "snapshot" that doesnt take cpu time and performance, just space.

JonB

#2 lore raw
Quoted 2 lines · On Tue, Mar 11, 2003 at 09:46:16PM +0100, [email protected] wrote:

How would you not do that ? You have to store the snapshots some how.

Right you do have to store them. But if the block references were in the reverse direction than they are currently then the disk penalty for snapshots would not increase linearly with the number of snapshots.

As I understand it, the way LVM works currently is that if a block that is in one or more snapshots is going to be altered, the contents of the block, prior to commiting the new contents, is copied to all of the snapshots, one copy per snapshot, hence the linear penalty to keeping multiple snapshots.

However if the updating of a block that was in one or more snapshots were done such that the existing block was not overwritten but instead a new block was allocated for the "live" (non-snapshot) device to write the new contents, there would be a constant cost (the cost of writing one block and accounting for it in the "live" device) rather than a linearly increasing cost no matter how many snapshots there were.

This is not likely possible the way LVM works currently (or it would work this way :-) however.

This is one of the advantages filesytem level snapshots have over block level snapshots. Filesystems can change block pointers easily enough that it can make one constant cost change per overwritten block no matter how many snapshots are referencing the old block still.

b.

Signature · 1 line
Brian J. Murrell
#3 lore raw
In reply to [email protected]
Quoted 5 lines · On Tue, Mar 11, 2003 at 09:46:16PM +0100, [email protected] wrote:
Quoted 3 lines

My problem is, this does not currently look possible without a severe performance hit. If a volume has, for example, five active snapshots, then the deltas seem to get written five times, once per snapshot volume.

How would you not do that ? You have to store the snapshots some how.

It would be similar to netapp's snapshots. the active data blocks are shared with the snapshots until a change occurs in active, then active gets a new block and all the snapshots keep sharing the old block. :) Very fast, and low space usage.

"Mmmm, WAFL ... <gargle gargle>" -- Homer Simpson, IT Manager ;)

Signature · 3 lines
Randomly Generated Tagline:
"To win, you must treat a pressure situation as an opportunity to succeed,
 not an opportunity to fail." - Gardner Dickinson
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 1 line · Theo Van Dinter

"Mmmm, WAFL ... <gargle gargle>" -- Homer Simpson, IT Manager ;)

That was exactly what I want. Presumably, the best answer is indeed in the filesystem. _Maybe_ something could be done with the Reiserfs 4 plugin architecture.

Still, it's great news to hear that chaining is in the pipe.

- --
Jason Smith
Open Enterprise Systems
Bangkok, Thailand
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+cC2zm5qEoSbpT3kRAr2iAJ94Ioq0Nmkz07RgMiAcvBNCRoZr8gCfbTkS STz/9neqhw0/BDCwv/gBsvA=
=DlEV
-----END PGP SIGNATURE-----

#5 lore raw
In reply to Jason Smith
Quoted 5 lines · Jason Smith

My problem is, this does not currently look possible without a severe performance hit. If a volume has, for example, five active snapshots, then the deltas seem to get written five times, once per snapshot volume.

I posted a patch (in January?) to implement chained snapshots with LVM1, ensuring that a delta is only copied once, at most. The downside is that the snapshots are no longer independent, and you can't remove a recent snapshot without invalidating all the older snapshots. But it is more efficient.

I didn't keep the message, but I believe chained snapshots will be implemented in LVM2 sometime this year.

Dale J. Stephenson
[email protected]

#6 lore raw
Quoted 8 lines · Dale J. Stephenson
Quoted 6 lines · Jason Smith

My problem is, this does not currently look possible without a severe performance hit. If a volume has, for example, five active snapshots, then the deltas seem to get written five times, once per snapshot volume.

Quoted 8 lines

I posted a patch (in January?) to implement chained snapshots with LVM1, ensuring that a delta is only copied once, at most. The downside is that the snapshots are no longer independent, and you can't remove a recent snapshot without invalidating all the older snapshots. But it is more efficient.

I didn't keep the message, but I believe chained snapshots will be implemented in LVM2 sometime this year.

Yes they will show up in LVM2 later.

FYI: LVM1 is in feature freeze since last year.

Quoted 10 lines

Dale J. Stephenson
[email protected]

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

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

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-