On Sun, Dec 02, 2012 at 11:17:26PM +0100, Aastha Mehta wrote:
> I am looking at btrfs to understand some of its features. One of them
> is the snapshot feature. Please tell me if my following understanding
> about snapshots in btrfs is correct or not.
> 
> Btrfs supports both readonly and writeable snapshots. Writeable
> snapshots are like clone volumes (or subvolumes as in btrfs). We get a
> point in time copy of the subvolume in both case.
> 
> I looked through the kernel code and it seems that creating a
> subvolume and taking a snapshot (readonly and writeable) all have a
> common ioctl interface.
> 
> What I am not completely clear about is whether snapshots get same
> fsid as the source subvolume fsid or different.

   Yes, it's the same UUID, because they're all part of the same
filesystem.

> Also, I do not understand what does it mean to be able to take
> snapshot of a snapshot.

   Snapshots are completely equal partners with their original
subvolumes. This is not the case in, say, LVM.

> What are benefits compared to say, being able to take snapshots only
> of the active subvolume and not of the snapshots?

   Let's say you take a snapshot (B) of your root filesystem (A). Then
you decide to "roll back" to using the old version, so you mount B as
root instead of A. Later that night, your backup process starts up and
tries to take a temporary read-only snapshot (C) of your root
filesystem (which is now B) so that it can make a stable backup.
That's a snapshot of a snapshot.

> Probably before that, I need to get some clarity on why does a
> subvolume always belong in the directory of some parent subvolume. Is
> it possible to have more than one root subvolumes or more than one
> subvolumes in the same parent subvolume directory?

   No, there's precisely one top-level subvolume (subvolid=5).
Everything else in the filesystem lives within that. However, you can
have as many subvolumes as you like below that, and in whatever
directories or subvolumes you want.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
           --- Quidquid latine dictum sit,  altum videtur. ---           

Attachment: signature.asc
Description: Digital signature

Reply via email to