ONTAP Discussions

huge disprepancy in du output

ACHOU_SIMG
2,527 Views

ONTAP 9.1 RC1

CentOS 6.3

NFS v3

 

Hi,

 

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.

 

 

Thanks,

 

1 REPLY 1

robinpeter
2,500 Views

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.

 

robin.

Public