Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Pottage <david@electric-spoon.com>
To: miguel@rozsas.eng.br
Cc: linux-btrfs@vger.kernel.org
Subject: Re: How to find the parent folder of a sub-volume ?
Date: Wed, 13 May 2020 09:27:03 +0100	[thread overview]
Message-ID: <ee4c18f1b87cebd2875d684e4b7c769d@electric-spoon.com> (raw)
In-Reply-To: <CAP5D+wYLQUh+XqBCU3MVq1vY41fbPgjabm7GkORmio+kFOYaqg@mail.gmail.com>

On 2020-05-12 18:17, miguel@rozsas.eng.br wrote:
> Hi there !
> 
> root@fenix:/home/miguel# btrfs --version
> btrfs-progs v5.2.1
> root@fenix:/home/miguel# btrfs subvolume list /home/miguel/tmp/
> ID 265 gen 20670 top level 5 path miguel
> ID 266 gen 23573 top level 265 path miguel/Documentos
> ID 267 gen 23575 top level 265 path miguel/Downloads
> ID 269 gen 23537 top level 265 path miguel/Misc
> ID 270 gen 23522 top level 265 path miguel/Musica
> ID 271 gen 23526 top level 265 path miguel/ProgramasRFB
> ID 272 gen 23574 top level 265 path miguel/tmp
> ID 273 gen 23509 top level 265 path miguel/Videos
> ID 274 gen 23574 top level 265 path miguel/R
> ID 275 gen 23557 top level 265 path miguel/Imagens
> ID 302 gen 23507 top level 265 path miguel/Tech
> ID 595 gen 23517 top level 265 path miguel/src/UPSData
> ID 596 gen 23510 top level 265 path miguel/bin/UPSData
> root@fenix:/home/miguel#
> 
> How to find the parent folder (root tree?) of the above sub-volumes ?
> On this parent folder I expect to see the above sub-folders as regular 
> folders.

Use: btrfs subvolume show on each subvolume in turn, and link up the 
subvolume uuids

If you can read python, I suggest you take a look at the source code of 
btrfs-clone,
as it contains code to walk the subvolume tree of a btrfs filesysysem.

https://github.com/mwilck/btrfs-clone/blob/master/btrfs-clone#L75


-- 
David Pottage

  reply	other threads:[~2020-05-13  8:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 17:17 How to find the parent folder of a sub-volume ? miguel
2020-05-13  8:27 ` David Pottage [this message]
2020-05-13 12:41 ` Zygo Blaxell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee4c18f1b87cebd2875d684e4b7c769d@electric-spoon.com \
    --to=david@electric-spoon.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miguel@rozsas.eng.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox