Skip to contentSkip to conversation

REQ: btrfs list <subvols only> option

DISCUSSION Alex 3 participants 8 messages Jan 9, 2014 Btrfs file system

lore
Share & tools
lore

Alex

author
#0 lore raw

Hello

(Using btrfs userland 3.12)

I have my fs set up (below) I borrowed the Ubuntu scheme.

<FS_TREE>/@/
<FS_TREE>/@/etc
<FS_TREE>/@/var
..

get-default is 5 i.e. <FS_TREE>

AFAICT, perhaps I'm missing the obvious, getting the list of subvolumes only (no snapshots) is no longer trivial?

# btrfs  sub list /@
ERROR: can't access '/@'
# btrfs  sub list /@
ERROR: can't access '/@'
# btrfs  sub list /@/
ERROR: can't access '/@/'
# btrfs  sub list @/
ERROR: can't access '@/'
# btrfs  sub list @

I know I'm going to be embarrassed at the answer, but go ahead bite me!

Thank you!

#1 lore raw
Quoted 26 lines · Alex

Hello

(Using btrfs userland 3.12)

I have my fs set up (below) I borrowed the Ubuntu scheme.

<FS_TREE>/@/
<FS_TREE>/@/etc
<FS_TREE>/@/var
..

get-default is 5 i.e. <FS_TREE>

AFAICT, perhaps I'm missing the obvious, getting the list of subvolumes only (no snapshots) is no longer trivial?

# btrfs  sub list /@
ERROR: can't access '/@'
# btrfs  sub list /@
ERROR: can't access '/@'
# btrfs  sub list /@/
ERROR: can't access '/@/'
# btrfs  sub list @/
ERROR: can't access '@/'
# btrfs  sub list @
Quoted 1 line

I know I'm going to be embarrassed at the answer, but go ahead bite me!

Specify the mount point for the Btrfs file system and it will list all subvols on that file system.

Chris Murphy

author
#2 lore raw
Quoted 1 line · Chris Murphy <lists <at> colorremedies.com> writes:

Specify the mount point for the Btrfs file system and it will list all

subvols on that file system.

Quoted 2 lines

Chris Murphy--

Thank you Chris.

When I do that on my version of the 3.12 userland:

# btrfs  sub list / -o
returns nothing (with no error), which I wasn't quite expecting because
there *are* other snapshots and subvols below '/'

AND

# btrfs  sub list / -s
correctly lists the snapshots only.

I don't understand, what or if, I'm doing something wrong. Thank you in advance.

#3 lore raw
Quoted 5 lines · Alex
Quoted 1 line · Chris Murphy <lists <at> colorremedies.com> writes:

Specify the mount point for the Btrfs file system and it will list all

subvols on that file system.

Quoted 1 line
Quoted 8 lines
Quoted 1 line

Chris Murphy--

Thank you Chris.

When I do that on my version of the 3.12 userland:

# btrfs  sub list / -o
returns nothing (with no error), which I wasn't quite expecting because
there *are* other snapshots and subvols below '/'

Not if / is a mounted subvolume that itself contains no subvolumes. / is the OS root, it is not the file system subvol=5 root.

Chris Murphy

#4 lore raw
Quoted 10 lines · Chris Murphy
Quoted 7 lines · Alex
Quoted 1 line · Chris Murphy <lists <at> colorremedies.com> writes:

Specify the mount point for the Btrfs file system and it will list all

subvols on that file system.

Quoted 2 lines

Chris Murphy--

Quoted 8 lines
Quoted 6 lines

Thank you Chris.

When I do that on my version of the 3.12 userland:

# btrfs  sub list / -o
returns nothing (with no error), which I wasn't quite expecting because
there *are* other snapshots and subvols below '/'

Not if / is a mounted subvolume that itself contains no subvolumes. / is the OS root, it is not the file system subvol=5 root.

Hmm, actually you might have found a bug.

# btrfs subvol list /
ID 272 gen 4276 top level 5 path boot
ID 273 gen 4770 top level 5 path root
ID 274 gen 4680 top level 5 path home
ID 275 gen 265 top level 5 path boot_ro_installed
ID 276 gen 280 top level 5 path root_ro_installed
ID 277 gen 280 top level 5 path home_ro_installed
ID 283 gen 327 top level 5 path boot_ro_installed+updates
ID 284 gen 329 top level 5 path root_ro_installed+updates
ID 285 gen 329 top level 5 path home_ro_installed+updates
ID 286 gen 399 top level 5 path boot_ro.3
ID 287 gen 400 top level 5 path root_ro.3
ID 288 gen 1603 top level 5 path home_ro.3
ID 473 gen 2105 top level 5 path boot_ro.2
ID 474 gen 2106 top level 5 path root_ro.2
ID 475 gen 2107 top level 5 path home_ro.2
ID 476 gen 4136 top level 5 path home/chris/Downloads/git
ID 485 gen 3144 top level 5 path boot_ro.1
ID 486 gen 3145 top level 5 path root_ro.1
ID 487 gen 3146 top level 5 path home_ro.1
ID 488 gen 3880 top level 5 path home/chris/Downloads/git/kernel
# btrfs subvol list / -o
# btrfs subvol list /home -o
# btrfs subvol list /home/chris/Downloads/ -o
# btrfs subvol list /home/chris/Downloads/git -o

It seems for sure that the last three should have reported ID 476 and 488. And probably the first should also have listed 272 and 274.

273 is mounted at /
272 is mounted at /boot
274 is mounted at /home

man btrfs " -o print only subvolumes bellow specified <path>."

Small typo while we're at it, below should have one l.

Chris Murphy

#5 lore raw
Quoted 55 lines · Chris Murphy
Quoted 10 lines · Chris Murphy
Quoted 7 lines · Alex
Quoted 1 line · Chris Murphy <lists <at> colorremedies.com> writes:

Specify the mount point for the Btrfs file system and it will list all

subvols on that file system.

Quoted 2 lines

Chris Murphy--

Quoted 8 lines
Quoted 6 lines

Thank you Chris.

When I do that on my version of the 3.12 userland:

# btrfs  sub list / -o
returns nothing (with no error), which I wasn't quite expecting because
there *are* other snapshots and subvols below '/'

Not if / is a mounted subvolume that itself contains no subvolumes. / is the OS root, it is not the file system subvol=5 root.

Hmm, actually you might have found a bug.

# btrfs subvol list /
ID 272 gen 4276 top level 5 path boot
ID 273 gen 4770 top level 5 path root
ID 274 gen 4680 top level 5 path home
ID 275 gen 265 top level 5 path boot_ro_installed
ID 276 gen 280 top level 5 path root_ro_installed
ID 277 gen 280 top level 5 path home_ro_installed
ID 283 gen 327 top level 5 path boot_ro_installed+updates
ID 284 gen 329 top level 5 path root_ro_installed+updates
ID 285 gen 329 top level 5 path home_ro_installed+updates
ID 286 gen 399 top level 5 path boot_ro.3
ID 287 gen 400 top level 5 path root_ro.3
ID 288 gen 1603 top level 5 path home_ro.3
ID 473 gen 2105 top level 5 path boot_ro.2
ID 474 gen 2106 top level 5 path root_ro.2
ID 475 gen 2107 top level 5 path home_ro.2
ID 476 gen 4136 top level 5 path home/chris/Downloads/git
ID 485 gen 3144 top level 5 path boot_ro.1
ID 486 gen 3145 top level 5 path root_ro.1
ID 487 gen 3146 top level 5 path home_ro.1
ID 488 gen 3880 top level 5 path home/chris/Downloads/git/kernel
# btrfs subvol list / -o
# btrfs subvol list /home -o
# btrfs subvol list /home/chris/Downloads/ -o
# btrfs subvol list /home/chris/Downloads/git -o

It seems for sure that the last three should have reported ID 476 and 488. And probably the first should also have listed 272 and 274.

Quoted 7 lines

273 is mounted at /
272 is mounted at /boot
274 is mounted at /home

man btrfs " -o print only subvolumes bellow specified <path>."

Small typo while we're at it, below should have one l.

kernel-3.13.0-0.rc6.git0.1.fc21.x86_64
btrfs-progs-3.12-1.fc20.x86_64

Chris Murphy

author
#6 lore raw
Quoted 9 lines · Chris Murphy <lists <at> colorremedies.com> writes:
Quoted 3 lines

Hmm, actually you might have found a bug.

Small typo while we're at it, below should have one l.

kernel-3.13.0-0.rc6.git0.1.fc21.x86_64
btrfs-progs-3.12-1.fc20.x86_64

Chris Murphy

Thank you muchly!
I'm kinda glad because I didn't really understand your second response in context. ;-) I would have been stuck had you not updated it!

#7 lore raw
In reply to Alex
Quoted 9 lines · Alex
Quoted 1 line · Chris Murphy <lists <at> colorremedies.com> writes:

Specify the mount point for the Btrfs file system and it will list all

subvols on that file system.

Quoted 1 line

Chris Murphy--

Thank you Chris.

When I do that on my version of the 3.12 userland:

# btrfs  sub list / -o

There is a bug for 'btrfs sub list -o path', i will send a patch for this

Thanks,
Wang

Quoted 18 lines

returns nothing (with no error), which I wasn't quite expecting because there *are* other snapshots and subvols below '/'

AND

# btrfs  sub list / -s
correctly lists the snapshots only.

I don't understand, what or if, I'm doing something wrong. Thank you in advance.

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html