UFS Solved: quota and du commands show vastly different storage usage

I've been troubleshooting some storage issues (user unable to upload new files) and ran into something weird. The du command and the quota command show a big difference in the amount of storage being consumed by the user.

If I run "quota -v -h guest" it shows this user has consumed 20GB of storage:
Code:
Disk quotas for user guest (uid 1003):
Filesystem        usage    quota   limit   grace  files   quota  limit   grace
/home/guest                   20G      20G     21G           5030    5500   6000

Notice the "usage" field says 20GB. However, when I run "du -ch /home/guest" it's showing
Code:
48G    total

The latter number, 48GB, is correct, based on what I'm seeing when I use the "df" command, it's showing about 50GB of space used by their partition.

So I'm wondering why quota is 30GB short. I ran quotacheck today and it still says 20GB of space is used.

More to the point, if quotacheck isn't setting the right usage amount, then how do I update the quota information to have it show correctly that the user is consuming 48GB of space, not 20GB?
I had wondered if the user somehow had 28GB of files in their home directory that were not theirs, but I checked and all the files in their home directory are owned by their user, UID 1003.

So how can a user have 48GB of files they own in their directory, but only be using 20GB of space, according to the quota command?
 
Update to the above issue: I think the original partition was 20GB in size and was updated to be around 65GB in size. Then the filesystem quota was activated _after_ the resize of the filesystem. But I wonder if quota still sees the original 20GB partition limit as being in place somehow?
 
What file system? Is compression or dedup enabled? Are some of the user's files in different directories, or are some of the files in their directory owned by other users?
 
The filesystem is UFS. No compression or deduplication involved.

All of the user's files are in their home directory. All files in their home directory are owned by the user.
 
I found the answer. I had performed a fsck on the filesystem yesterday and it returned a clean bill of health. But today I decided to take the system off-line (rebooted) and forced a fsck on the off-line filesystem. This time fsck found and fixed a series of errors. Then, when I remounted and ran "quotacheck -a" it discovered the guest user's 50GB of files and updated the quota file with the correct information.

So it looks like this was a case of a corrupted filesystem than could be fixed with a forced fsck. I've updated the user's quotas with edquota and everything seems to be running properly now.

Thanks everyone for the kind help and suggestions.
 
Back
Top