Managing quotas for HDFS space It is important to understand that in HDFS there must be enough quota space to accommodate the entire block. If a user has, say, 200 MB free in his allocated quota, he cannot create a new file, regardless of the file size, if the HDFS block size is 256 MB. You can set the HDFS space quota for the user by running the setSpace-Quota command. Here is the syntax:
$ hdfs dfsadmin –setSpaceQuota <N> <dirname>...<dirname>
The space quota you specify serves as the upper limit on the total size of all files in the directory. You can set the space quota in bytes (b), megabytes (m), gigabytes (g), terabytes (t) and even petabytes (by specifying p - yes, this is big data!). And here is an example that shows how to set a user space quota of 60 GB:
$ hdfs dfsadmin -setSpaceQuota 60G /user/alapati
You can set quotas for several directories at once, as shown here:
$ hdfs dfsadmin -setSpaceQuota 10g /user/alapati /test/alapati
source share