linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Finding only non-snapshots via btrfs subvol list
@ 2016-07-21 14:55 Holger Hoffstätte
  2016-09-08 17:38 ` Holger Hoffstätte
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Hoffstätte @ 2016-07-21 14:55 UTC (permalink / raw)
  To: linux-btrfs


I'm trying to find non-snapshots, i.e. 'top-level' subvolumes in a
filesystem and this seems harder than it IMHO should be.

The fs is just like:

/mnt/stuff
 subvolA
 subvolA-date1
 subvolA-date2
 subvolB
 subvolB-date1
 subvolB-date2
..

All I want are the subvol{A,B} *without* the snapshots, but so
far I haven't been able to accomplish this easily with "subvol list"
and its options. -s lists only snapshots, but what I want is the
exact opposite.

So far the best I could find - except for relying on my ad-hoc naming
conventions and inverse-grepping for that - is via -q (print parent UUID)
and matching on that:

btrfs subvol list -q /mnt/stuff | grep "parent_uuid -" | cut -f 11 -d " "

gives me what I want - but eeww. So somehow I think I'm missing something
trivial. Is there a better, non-greppy way?

Holger

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-08 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 14:55 Finding only non-snapshots via btrfs subvol list Holger Hoffstätte
2016-09-08 17:38 ` Holger Hoffstätte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).