huge disprepancy in du output
2017-05-08 07:25 PM
ONTAP 9.1 RC1
As an exmaple, I have filer:/vol/vol0/home/[username] hosting user's homes. The size of vol0 is a few TB and it also contains other directories other than home but individual user home has quota set to 10GB. On Linux I have automount set up so that each user's home mounted like:
/home/[username] -> filer:/vol/vol0/home/[username]
If I am in a user's home directory (ie, /home/[username]) and do 'du .', it will take some time and the returned size is huge. By huge I mean it's over 1TB. If I cd to the same user's home via /net/filer/vol/vol0/home/[username]/ and du, it's fast and returns a few GB. If I am back in /home/[username]/ and do 'du . --exclude *snapshot*' then it returns a few GB which matches the results from doing du via /net/...
I understand du is not an accurate way to see actual disk usage but it can't be this off. And I don't think this only applies specifically to user home directories.
What's going on here? Why du in /home/[userhome] seems to take the snapshots into account? Is it expected behavior? I don't think it's like this in 7 mode at least and possibly in the earlier version of cDOT?
The goal here is to have a way to allow users to see his/her space consumption without admin's involvement.
1 REPLY 1
Re: huge disprepancy in du output
2017-05-08 09:14 PM
If you have user quota enabled, on your home directory volume
You might have to use the "quota-report" API call to get the user quota, thats the most efficient way.
Using the "du" or "df" linux commands won't give you accurate info in case of user quota.
Send me a direct message if you need more help for creating an perl/python script to query user quota info from filer.