btrfs-progs icon indicating copy to clipboard operation
btrfs-progs copied to clipboard

Feature request: "btrfs qgroup show" should show path

Open jkufner opened this issue 8 years ago • 3 comments

The btrfs qgroup show command should show path assigned to each qgroup. This little piece of information would significantly helped when managing snapshots.

Example:

# btrfs qgroup show /
qgroupid         rfer         excl   path
--------         ----         ----   -----
0/5          16.00KiB     16.00KiB   /
0/257         1.57TiB      1.57TiB   /home

Following script produces the desired output (not sure if correct, though):

#!/bin/sh
(btrfs subvolume list "$1" && btrfs qgroup show "$1") \
| awk '$1 == "ID" { p["0/"$2] = $9} $1 != "ID" { print $0 "  " p[$1] }'

I also found few scripts doing this and a lot of question how to achieve this, but I think this feature should be integrated in btrfs-progs.

jkufner avatar Sep 12 '17 01:09 jkufner

If no one else has already started this matter, maybe I can do it.

littleroad avatar Sep 28 '17 02:09 littleroad

Thanks, it's yours.

kdave avatar Sep 28 '17 11:09 kdave

I have posted the following patch to implement this feature. https://patchwork.kernel.org/patch/9995307/

littleroad avatar Oct 12 '17 01:10 littleroad

Implemented since v6.0.1.

kdave avatar Oct 17 '23 16:10 kdave