How to enable quotas for ext4 Ubuntu 22.04

The first step is to edit your /etc/fstab file as follows:

nano /etc/fstab

After the discard option, add usrquota and grpquota as follows:

LABEL=cloudimg-rootfs   /        ext4   discard,usrquota,grpquota       0 1

Reboot your machine.

Finally, run the following command to enable quotas:

quotacheck -ugm /