nachoparker / btrfs-du

Easily print BTRFS subvolume/snapshot disk usage
GNU General Public License v3.0
112 stars 17 forks source link

On legacy systems: "btrfs qgroup show: unrecognized option '--sync'" #2

Closed jpluimers closed 6 years ago

jpluimers commented 6 years ago

On some legacy systems (before opensuse-Tumbleweed), you get this:

btrfs qgroup show: unrecognized option '--sync'

If it is hard to workaround: Maybe just document this and defer to https://github.com/agronick/btrfs-size which does not need the --sync option of btrfs-qgroup which:

--sync To retrieve information after updating the state of qgroups, force sync of the filesystem identified by <path> before getting information.

Example full output:

# ./btrfs-du/btrfs-du  /
btrfs qgroup show: unrecognized option '--sync'
usage: btrfs qgroup show -pcreFf [--sort=qgroupid,rfer,excl,max_rfer,max_excl] <path>

    Show subvolume quota groups.

    -p      print parent qgroup id
    -c      print child qgroup id
    -r      print max referenced size of qgroup
    -e      print max exclusive size of qgroup
    -F      list all qgroups which impact the given path(include ancestral qgroups)
    -f      list all qgroups which impact the given path(exclude ancestral qgroups)
    --sort=qgroupid,rfer,excl,max_rfer,max_excl
            list qgroups in order of qgroupid,rfer,max_rfer or max_excl
            you can use '+' or '-' in front of each item.
            (+:ascending, -:descending, ascending default)

btrfs qgroup show: unrecognized option '--sync'
usage: btrfs qgroup show -pcreFf [--sort=qgroupid,rfer,excl,max_rfer,max_excl] <path>

    Show subvolume quota groups.

    -p      print parent qgroup id
    -c      print child qgroup id
    -r      print max referenced size of qgroup
    -e      print max exclusive size of qgroup
    -F      list all qgroups which impact the given path(include ancestral qgroups)
    -f      list all qgroups which impact the given path(exclude ancestral qgroups)
    --sort=qgroupid,rfer,excl,max_rfer,max_excl
            list qgroups in order of qgroupid,rfer,max_rfer or max_excl
            you can use '+' or '-' in front of each item.
            (+:ascending, -:descending, ascending default)

Subvolume                                                    Total      Exclusive  ID        
─────────────────────────────────────────────────────────────────────────────────────────
tmp                                                          256                             
./btrfs-du/btrfs-du: line 61: EXCL_TOTAL +  : syntax error: operand expected (error token is "+  ")
─────────────────────────────────────────────────────────────────────────────────────────
                                                                Total exclusive data: 
nachoparker commented 6 years ago

Hi,

It is not hard to work around, just need to sync before the operation

thanks for reporting.

jpluimers commented 6 years ago

@nachoparker thanks. My underlying assumption that btrfs might do more than just a plain sync . Thanks for teaching me it doesn't.