NetApp ONTAP Tip – Quick File Count Reporting with Null Quotas

A customer with hundreds of millions of files asked if there was a quick method to report file counts. Their former process of running the Linux “du” command took days to enumerate the file counts on their exports. Linux “du” is similar to Windows “Properties” or MacOS “Get Info” menu items to see file counts. To immediately report the file counts, we applied the NetApp quota feature without enforcement using the dash “-“. This is also known as applying null quotas. Using null quotas and the “quota report” command, the real-time report is instant without waiting for the full scan method from a client.

Below is an example detailing the steps on the ONTAP 9.6 VSIM using a small file set, but still one that takes a while to enumerate. The example is shown using the command line and can easily be repeated using the System Manager GUI.

For future tips, stay tuned for my next blog where I will demonstrate a similar method using infinite QoS policies. Also, I will work on RESTful API and Ansible examples for these methods.

CLI  example creating a null quota for tracking
Create a Qtree
cluster1:> qtree create -volume quota_vol1 -qtree qtree1

Create a quota policy
cluster1:> quota policy create -policy-name null -vserver quotas

Create a quota policy rule
cluster1:> quota policy rule create -policy-name null -volume quota_vol1 -type tree -target “” -vserver quotas -disk-limit – -file-limit – -threshold –

Modify the SVM quota policy from default
cluster1:> vserver modify -vserver quotas -quota-policy null

Enable quotas on the volume
cluster1:> quota on -vserver quotas -volume quota_vol1

Quota Report Real-time
cluster1:> quota report

quota report.png