Skip to contentSkip to conversation

How Snapshots Inter-relate?

DISCUSSION [email protected] 4 participants 5 messages Apr 21, 2011 – Apr 22, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

I have set up a backup server in the garage which does rsync backups of all my servers weekly, and snapshots those backups. It works wonderfully, and I was able to set it up thanks to help from this listserv, thank you.

But I'm accumulating quite a few backups now, unnecessarily. After a couple months I only need a representative one, once a month. I am afraid to delete three of my weekly snapshots out of each month, as I'm afraid they're cumulative. I might end up with nothing valid if each builds on the last, forever.

How do I resolve this?

#1 lore raw
Quoted 10 lines · On Thu, 2011-04-21 at 10:17 -0700, [email protected] wrote:

I have set up a backup server in the garage which does rsync backups of all my servers weekly, and snapshots those backups. It works wonderfully, and I was able to set it up thanks to help from this listserv, thank you.

But I'm accumulating quite a few backups now, unnecessarily. After a couple months I only need a representative one, once a month. I am afraid to delete three of my weekly snapshots out of each month, as I'm afraid they're cumulative. I might end up with nothing valid if each builds on the last, forever.

You have nothing to worry about. You can delete any snapshot on btrfs without losing data from any other snapshot. Each snapshot is completely independent.

This works because data which is shared between multiple snapshots is reference counted, and won't be deleted until you remove the last snapshot that references that data.

Signature · 1 line
Calvin Walton <[email protected]>
#2 lore raw
Quoted 7 lines · On Thursday 21 April, 2011 11:47:25 Calvin Walton wrote:

You have nothing to worry about. You can delete any snapshot on btrfs without losing data from any other snapshot. Each snapshot is completely independent.

This works because data which is shared between multiple snapshots is reference counted, and won't be deleted until you remove the last snapshot that references that data.

Wow. Awesome job, BTRFS team.

Would it be good practice to say, once a year, do a completely new fresh snapshot?

#3 lore raw
Quoted 1 line · On Fri, Apr 22, 2011 at 10:03 PM, <[email protected]> wrote:

Would it be good practice to say, once a year, do a completely new fresh snapshot?

There's no such thing as "new fresh snapshot".

You can create a new, empty subvolume.
Or you can create snapshot of existing root/subvolume, which once created, behaves just like another subvolume (with the exception that it contains identical content to the origin root/subvolume). Or you can create snapshot of a snapshot (which, again, is just another subvolume with identical content) so in practice there will be no difference between the first snapshot and the second snapshot.

So if by "new fresh snapshot" you mean "creating a snapshot of root/subvolume at that time", then you can do it as often as you need. But if by "new fresh snapshot" you mean something like full backup in traditional tape backup, then like Calvin said every snapshot is already independent, so in a way it's a "full backup".

Of course if you're using it for backup purposes then it's usually best to have a copy elsewhere (not on the same disk/server/datacenter), but that's beyond the scope of this list.

Signature · 1 line
Fajar
#4 lore raw
In reply to Calvin Walton

Hallo, Calvin,

Du meintest am 21.04.11:

Quoted 2 lines
Quoted 2 lines

I have set up a backup server in the garage which does rsync backups of all my servers weekly, and snapshots those backups.

[...]

Quoted 7 lines

You have nothing to worry about. You can delete any snapshot on btrfs without losing data from any other snapshot. Each snapshot is completely independent.

This works because data which is shared between multiple snapshots is reference counted, and won't be deleted until you remove the last snapshot that references that data.

That sounds like "hard links"; I use that with my favourite backup program "rsnapshot". I like it.

But: if the (only) target of the (many) hard links fails, then it fails in all backups. It's a very good idea to make monthly or yearly backups of one such hard linked backup to another disk.

Viele Gruesse!
Helmut