* What are "parent" and "parent_uuid" in "btrfs sub list"?
@ 2016-10-17 16:53 Andrei Borzenkov
2016-10-17 17:41 ` Hans van Kranenburg
0 siblings, 1 reply; 2+ messages in thread
From: Andrei Borzenkov @ 2016-10-17 16:53 UTC (permalink / raw)
To: linux-btrfs@vger.kernel.org
I try to understand how to build a tree of snapshots (i.e. - which
subvolume was used to snapshot/clone other subvolume). What is the
correct way to determine it? In particular, "btrfs sub list -p" always
prints something for "parent snapshot", while btrfs sub list -q" only
prints parent_uuid for actual snapshots (i.e. for subvolumes I know are
snapshots). Are "parent" and "parent_uuid" related to each other? Of
not, what do they mean?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: What are "parent" and "parent_uuid" in "btrfs sub list"?
2016-10-17 16:53 What are "parent" and "parent_uuid" in "btrfs sub list"? Andrei Borzenkov
@ 2016-10-17 17:41 ` Hans van Kranenburg
0 siblings, 0 replies; 2+ messages in thread
From: Hans van Kranenburg @ 2016-10-17 17:41 UTC (permalink / raw)
To: Andrei Borzenkov, linux-btrfs@vger.kernel.org
On 10/17/2016 06:53 PM, Andrei Borzenkov wrote:
> I try to understand how to build a tree of snapshots (i.e. - which
> subvolume was used to snapshot/clone other subvolume). What is the
> correct way to determine it? In particular, "btrfs sub list -p" always
> prints something for "parent snapshot", while btrfs sub list -q" only
> prints parent_uuid for actual snapshots (i.e. for subvolumes I know are
> snapshots). Are "parent" and "parent_uuid" related to each other? Of
> not, what do they mean?
It's confusing because there are two different things, which both are
called a parent.
* parent is the subvolume another subvolume is placed in
* parent_uuid is the uuid of a subvolume that this is a snapshot from
So:
-# btrfs sub create foo
Create subvolume './foo'
-# btrfs sub list -p -q .
ID 3486 gen 3368 parent 5 top level 5 parent_uuid - path foo
foo has parent 5, because I created it at the top of the filesystem, and
the top level subvolume (the fs itself) has id 5
-# btrfs sub create bar
Create subvolume './bar'
-# btrfs sub list -p -q .
ID 3486 gen 3368 parent 5 top level 5 parent_uuid - path foo
ID 3487 gen 3369 parent 5 top level 5 parent_uuid - path bar
now I have a second one...
-# mv foo bar/
-# btrfs sub list -p -q .
ID 3486 gen 3368 parent 3487 top level 3487 parent_uuid - path bar/foo
ID 3487 gen 3369 parent 5 top level 5 parent_uuid - path bar
if I move the foo subvolume *into* the bar subvolume, it gets the bar as
parent
-# btrfs sub snap -r bar bar-snap
Create a readonly snapshot of 'bar' in './bar-snap'
-# btrfs sub list -p -q .
ID 3486 gen 3368 parent 3487 top level 3487 parent_uuid - path bar/foo
ID 3487 gen 3370 parent 5 top level 5 parent_uuid - path bar
ID 3488 gen 3370 parent 5 top level 5 parent_uuid
8de7ab74-4654-e542-a29b-169848ee73b3 path bar-snap
and there's the parent_uuid...
--
Hans van Kranenburg
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-17 17:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-17 16:53 What are "parent" and "parent_uuid" in "btrfs sub list"? Andrei Borzenkov
2016-10-17 17:41 ` Hans van Kranenburg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox