I tried using btrfs subvolume quotas today. I think I understand in its most basic usage now so I wrote these notes.
If anyone knows any better, please tell me what else I should know about the basics of btrfs quotas or any common pitfalls I should be aware of.
My understanding is that taking snapshots of the /home subvol will not recursively snapshot its child subvolumes.
First I enabled quota support on my btrfs /home partition, which initially didn’t have any subvolumes configured.
sudo btrfs quota enable /home
I created a “root” subvol for my /home called @home
sudo btrfs sub create /home/@home
After creating /home/@home, I copied everything from /home
into /home/@home
then updated the ‘’‘/home’‘’ entry in /etc/fstab
to something like:
<DISK-UUID> /home btrfs subvol=@home,... 0 2
Then rebooted to mount my /home in a subvolume. I can then create new btrfs subvol home dirs by running a command like:
sudo btrfs sub create /home/$user
Limits can be applied to subvolumes with a command like:
sudo btrfs qgroup limit 1024M /home/$user
The quota for a users subvol can be checked by running:
sudo btrfs qgroup show -r /home/$user
The subvol quota being listed as the last (bottom) value in the max_rfer
column from the btrfs qgroup show -r
command output.