Thread (21 messages) 21 messages, 7 authors, 2017-08-23

Re: finding root filesystem of a subvolume?

From: Roman Mamedov <hidden>
Date: 2017-08-22 16:48:19

On Tue, 22 Aug 2017 17:45:37 +0200
Ulli Horlacher [off-list ref] wrote:
In perl I have now:

$root = $volume;
while (`btrfs subvolume show "$root" 2>/dev/null` !~ /toplevel subvolume/) {
  $root = dirname($root);
  last if $root eq '/';
}
If you are okay with rolling your own solutions like this, take a look at
"btrfs filesystem usage <path>". It will print the blockdevice used for
mounting the base FS. From that you can find the mountpoint via /proc/mounts.

Performance-wise it seems to work instantly on an almost full 2TB FS.

-- 
With respect,
Roman
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help