btrfs-qgroup - Linux


Overview

btrfs-qgroup is a tool for managing Block Transparent File System (Btrfs) quota groups, which allow administrators to define limits on disk space and other resources for specific users or groups of users. This enables efficient resource allocation and prevents individual users from consuming an excessive amount of shared storage.

Syntax

btrfs-qgroup <options> ... <command> [<args>] ...

Options/Flags

  • -h, –help: Display help and usage information.
  • -V, –version: Show the version of btrfs-qgroup.
  • –new: Create a new quota group.
  • –remove: Remove an existing quota group.
  • –limits: Set or modify the limits for an existing quota group.
  • –show: Display the current settings of a quota group.
  • –list: List all existing quota groups.
  • –group-id: ID of the group to manage.

Examples

Create a new quota group:

btrfs-qgroup --new quota-group-name

Set limits for a quota group:

btrfs-qgroup --limits quota-group-name --space 5G --files 10000

Display limits for a quota group:

btrfs-qgroup --show quota-group-name

List all quota groups:

btrfs-qgroup --list

Common Issues

  • If you encounter errors while creating or removing a quota group, check if the file system is mounted with the subvol= option.
  • If you experience issues setting limits, verify that the quota group exists and that you have sufficient permissions.
  • Quota groups are only applicable to Btrfs file systems, so ensure that you have the correct file system type.

Integration

btrfs-qgroup can be combined with other btrfs commands for advanced management tasks. For example:**

btrfs qgroup --limits quota-group-name --space 10G && btrfs sync

This command increases the space limit of the quota group quota-group-name to 10GB and then synchronizes the file system to ensure the changes are applied.

Related Commands

  • btrfs: Main Btrfs management tool.
  • btrfs-quota: Equivalent tool for managing user quotas (individual user limits).
  • quota: General quota management command.