Skip to contentSkip to conversation

snapshot merging?

DISCUSSION Tomasz Chmielewski 6 participants 8 messages Sep 21, 2008 – Sep 24, 2008 Btrfs file system

lore
Share & tools
lore
#0 lore raw

At the beginning of August, Mikulas Patocka posted to linux-kernel mailing list about adding snapshot merging to LVM[1].

Basicaly, snapshot merging means that it is possible to turn a snapshot back into its origin.

Using LVM, however, means that you need to have free place outside of the filesystem (i.e., in physical volume) to make snapshots, which is not always possible on workstations and some servers.

Is something similar available, or planned, for btrfs? I didn't find anything similar on "btrfs design" page in the wiki.

[1] http://kerneltrap.org/Linux/LVM_Snapshot_Merging

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org
#1 lore raw
Quoted 6 lines · Tomasz Chmielewski

At the beginning of August, Mikulas Patocka posted to linux-kernel mailing list about adding snapshot merging to LVM[1].

Basicaly, snapshot merging means that it is possible to turn a snapshot back into its origin.

Quoted 7 lines

Using LVM, however, means that you need to have free place outside of the filesystem (i.e., in physical volume) to make snapshots, which is not always possible on workstations and some servers.

Is something similar available, or planned, for btrfs? I didn't find anything similar on "btrfs design" page in the wiki.

Writeable snapshot has been available in btrfs for a long time.

Quoted 3 lines

[1] http://kerneltrap.org/Linux/LVM_Snapshot_Merging

Writeable snapshot means you can mount/modify snapshots as you like. In other words, btrfs does snapshot merging automatically.

Yan Zheng

#2 lore raw
Quoted 7 lines · Zheng Yan
Quoted 6 lines · Tomasz Chmielewski

At the beginning of August, Mikulas Patocka posted to linux-kernel mailing list about adding snapshot merging to LVM[1].

Basicaly, snapshot merging means that it is possible to turn a snapshot back into its origin.

Quoted 8 lines
Quoted 7 lines

Using LVM, however, means that you need to have free place outside of the filesystem (i.e., in physical volume) to make snapshots, which is not always possible on workstations and some servers.

Is something similar available, or planned, for btrfs? I didn't find anything similar on "btrfs design" page in the wiki.

Writeable snapshot has been available in btrfs for a long time.

Writeable snapshots and snapshot merging are two different things.

Quoted 4 lines
Quoted 2 lines

[1] http://kerneltrap.org/Linux/LVM_Snapshot_Merging

Writeable snapshot means you can mount/modify snapshots as you like. In other words, btrfs does snapshot merging automatically.

With LVM, you can also modify snapshots as you like, but it doesn't mean LVM supports snapshot merging right now (that is, you have to apply the patches described on the page above to have "snapshot merging" feature).

Maybe let me show you an example:

0) you have your "original" root filesystem
1) you make a snapshot of your rootfs
2) you upgrade your distribution (version 1.0 -> version 2.0-alpha)
3) you realise that some of the things don't work as expected - you mark that your snapshot should be turned into an original
4) you reboot (as your rootfs is mounted, you have to) and from now on your snapshot turns into the original from point 0.

Of course, one could boot off a live CD and copy the snapshot into the original, but that involves additional operating system to be booted.

Or, you could copy data from snapshot to the original while your system is running, but that could be risky for running programs (you replace libc, lots of libraries, binaries etc.).

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org
#3 lore raw
Quoted 32 lines · Tomasz Chmielewski
Quoted 7 lines · Zheng Yan
Quoted 6 lines · Tomasz Chmielewski

At the beginning of August, Mikulas Patocka posted to linux-kernel mailing list about adding snapshot merging to LVM[1].

Basicaly, snapshot merging means that it is possible to turn a snapshot back into its origin.

Quoted 8 lines
Quoted 7 lines

Using LVM, however, means that you need to have free place outside of the filesystem (i.e., in physical volume) to make snapshots, which is not always possible on workstations and some servers.

Is something similar available, or planned, for btrfs? I didn't find anything similar on "btrfs design" page in the wiki.

Writeable snapshot has been available in btrfs for a long time.

Writeable snapshots and snapshot merging are two different things.

Quoted 4 lines
Quoted 2 lines

[1] http://kerneltrap.org/Linux/LVM_Snapshot_Merging

Writeable snapshot means you can mount/modify snapshots as you like. In other words, btrfs does snapshot merging automatically.

With LVM, you can also modify snapshots as you like, but it doesn't mean LVM supports snapshot merging right now (that is, you have to apply the patches described on the page above to have "snapshot merging" feature).

Maybe let me show you an example:

Quoted 8 lines

0) you have your "original" root filesystem
1) you make a snapshot of your rootfs
2) you upgrade your distribution (version 1.0 -> version 2.0-alpha)
3) you realise that some of the things don't work as expected - you mark that your snapshot should be turned into an original
4) you reboot (as your rootfs is mounted, you have to) and from now on your snapshot turns into the original from point 0.

You can mount the snapshot created in step 1 as your rootfs. (by changing rootfs mount option in the boot parameter)

Yan Zheng

#4 lore raw
In reply to Tomasz Chmielewski
Quoted 3 lines · Tomasz Chmielewski
Quoted 1 line

Writeable snapshot has been available in btrfs for a long time.

Writeable snapshots and snapshot merging are two different things.

I think what Mikulas really means by "snapshot merging" is what we call "revert to snapshot" in ddsnap (google Zumastor ddsnap). The latter is more appropriate terminology IMHO. For a snapshotted volume, this just requires copying any blocks that belong to the snapshot and not the origin back to the origin. Similarly, one could revert any snapshot "back" (quotes because there is not necessarily any relationship in time) to any other. For a filesystem it will not be nearly so simple, because at best only part of the job can be done at the physical block level.

Regards,

Daniel

#5 lore raw
Quoted 5 lines · Daniel Phillips
Quoted 3 lines · Tomasz Chmielewski
Quoted 1 line

Writeable snapshot has been available in btrfs for a long time.

Writeable snapshots and snapshot merging are two different things.

Quoted 9 lines

I think what Mikulas really means by "snapshot merging" is what we call "revert to snapshot" in ddsnap (google Zumastor ddsnap). The latter is more appropriate terminology IMHO. For a snapshotted volume, this just requires copying any blocks that belong to the snapshot and not the origin back to the origin. Similarly, one could revert any snapshot "back" (quotes because there is not necessarily any relationship in time) to any other. For a filesystem it will not be nearly so simple, because at best only part of the job can be done at the physical block level.

It took me a while to get what was meant by snapshot merging. Consider this a vote for the "revert" terminology. :) Although, it calls into question some of my assumptions about what people use snapshots for.

What do people use snapshots for?

Cheers,
Eric

#6 lore raw

Dnia 2008-09-24, =C5=9Bro o godzinie 02:54 -0600, Eric Anopolsky pisze:

Quoted 1 line

What do people use snapshots for?

=20
I use snapshots as "quick backup", as addition to full backups done by Bacula. It much faster and easier to recover previous version of file from snapshot than from backup software. Revert is not necessary.

OpenSolaris guys use snapshots for safe system upgrade. With ability t=
o
select rootfs from before upgrade at GRUB screen and boot into older installation. Revert is crucial in case of wedged upgrade.

--=20
Tomasz Torcz

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to Daniel Phillips
Quoted 5 lines · Daniel Phillips
Quoted 3 lines · Tomasz Chmielewski
Quoted 1 line

Writeable snapshot has been available in btrfs for a long time.

Writeable snapshots and snapshot merging are two different things.

Quoted 9 lines

I think what Mikulas really means by "snapshot merging" is what we call "revert to snapshot" in ddsnap (google Zumastor ddsnap). The latter is more appropriate terminology IMHO. For a snapshotted volume, this just requires copying any blocks that belong to the snapshot and not the origin back to the origin. Similarly, one could revert any snapshot "back" (quotes because there is not necessarily any relationship in time) to any other. For a filesystem it will not be nearly so simple, because at best only part of the job can be done at the physical block level.

In btrfs there's no need to merge. The original is still there and you just use it instead of the snapshot. Both the original and the snapshot are writable, you can pick whichever one you want to continue forward with.

Said a different way, the underlying metadata structures and capabilities of the snapshot and the original are the same. The only difference between the two is their starting state.

-chris