Thursday, February 2, 2012

Creating quotas in Netapp

Creating quotas in Netapp.

1. Create the /etc/quotas file and add entries to reflect the quota target, type, disk and file size limitations.  In our case, we want the type to be qtree.
Example for an entry in the quota file:
#Quota Target type disk files
/vol/repository/apps    tree  200G 400K

2.  To modify a quota, edit the /etc/quotas file to reflect the changes.
There are two methods to reinitialize the quotas after editing the /etc/quotas file.
a. To cause the filer to reread the entire /etc/quotas file if a new quota entry is created:

filer>quota off [vol_name]
filer>add new entries or make changes to existing quota values
filer>quota on [vol_name] (if adding new entries into /etc/quota file)
filer>quota resize [vol_name] (To cause the filer to only update quota entries that previously existed and only disk and/or file size was modified)

Note: If resizing existing quotas values only, it is more efficient to use the quota resize [vol_name] as only the quotas whose value has changed is recalculated.

3. Test the quota by copying over a directory as a user in the directory group.  Here, we copy over a 2GB ISO file to the mysql directory as root.  Since root is part of the mysqldir NIS group, for which there’s a 1 GB quota, Netapp catches it and causes the write to fail:

[root@server]# pwd
[root@server]# scp -p RHEL4-U5-x86_64_DVD.iso remote-host:/d0/mysql/test2
RHEL4-U5-x86_64_DVD.iso                       100% 2474MB  10.1MB/s   04:03
scp: /d0/mysql/test2: Disk quota exceeded

No comments:

Post a Comment