Re: finding root filesystem of a subvolume?
From: Roman Mamedov <hidden>
Date: 2017-08-22 16:48:19
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