1

What I am trying to do is to get quota limit of current system user's home directory, which is btrfs quota-enabled, using the following command:

/usr/sbin/btrfs qgroup show-reF ~/

The above command outputs the following error:

ERROR: can't list qgroups: Operation not permitted

Above command works well for root user. But I wanted to allow users to check the disk usage of their home directory as their is quota limit on users home directory.

I added the user to group of /usr/sbin/btrfs command, but it did not help. can anybody explain the cause of the error? and probably how to resolve it?

1 Answers1

2

With the currently given information and because of the nature of BTRFS Quota groups

... Above command works well for root user ... Can anybody explain the cause of the error?

the command needs to run under higher rights, as root. See in example the thread under How to display quota limit on BTRFS subvolume?.

But I wanted to allow users to check ...

In order to do so you could allow all users to run a given command via sudo and would need to add to the /etc/sudoers file in example

ALL ALL=NOPASSWD: /usr/sbin/btrfs qgroup show-reF ~/

which can then just be executed by the user via

sudo /usr/sbin/btrfs qgroup show-reF ~/

You may also think about to introduce an alias for the command with Cmnd_Alias and see How do I use command arguments with Cmnd_Alias in sudoers?

U880D
  • 1,275