13.07.2019 11:27, Ulli Horlacher пишет: > On Sat 2019-07-13 (06:59), Andrei Borzenkov wrote: >> 13.07.2019 2:17, Ulli Horlacher ?8H5B: >> >>> I need to find (all) subvolume directories. > >> That is just coincidence because @/.snapshot subvolume is mounted on >> /.snapshot. It could also be mounted under /var/lib/snapper (insert your >> path here). > > Yes, this is the problem for me! > > >>> But what if a btrfs filesystem does not have a toplevel /@/ directory, but >>> anything else, like /this/is/my/top/directory ? >>> >> >> btrfs does not have "top level directory" beyond single /. > > I used the wrong naming. > I have meant "top level directory beyond /" > > >> It is entirely up to the user who creates it how subvolumes are named and >> structured. You can well have /foo, /bar, /baz mounted as /, /var and >> /home. > > And how can I find them in my mounted filesystem? > THIS is my problem.
I am not sure what problem you are trying to solve, but you can use list of current mounts to build path to each subvolume (as long as it is either below one of mounted subvolumes or explicitly mounted). > As I wrote: "find / -inum 256" is too slow. > >