How Do You Troubleshoot “…quota: Cannot open quotafile //aquota.user: Permission denied”?

Problem scenario
You run a quota command. But you get "quota: Cannot open quotafile…" //aquota.group or //aquota.user … "Permission denied."

What should you do?

Possible Solution #1
Maybe you do not have permissions. Can you run it with "sudo "?

If you run it with sudo and just see the quota governing the root user, then try running a command like this:

sudo quota -u jdoe
# Replace "jdoe" with the non-root user

You may want to find the relevant files with commands like this:

sudo find / -name aquota.group
sudo find / -name aquota.user

Possible Solution #2
This assumes you have the chattr utility installed; if you need assistance, see How Do You Install chattr on Ubuntu?

Change the immutable bit with this:

cd /path/to/aquota.user # change directories to the one with the file
sudo chattr -ia aquota.user

This was adapted from https://www.thecpaneladmin.com/aquota-user-permission-denied/.

Possible solution #3
You could try running a quotacheck command (e.g., sudo quotacheck -vug). This solution was adapted from https://sourceforge.net/p/linuxquota/bugs/94/.
This command can clear the immutable bit. If you want to read about the immutable bit, see What Is the Immutable Bit vs the Sticky Bit?

Leave a comment

Your email address will not be published. Required fields are marked *