Support Questions
Find answers, ask questions, and share your expertise

clrQuota: Cannot clear namespace quota on root Ask Question


hdfs dfsadmin -setQuota 3 / i set the quota for root directory in hadoop but i can't able to clear the quota for the root directory using hdfs dfsadmin -clrQuota / it givesclrQuota: Cannot clear namespace quota on root.


@Kuldeep Kulkarni Please Help, I am facing the same issue

Super Guru
@Abhinav Phutela

Can you please give me command with complete console output?

@Kuldeep Kulkarni

I'm attaching the console output with the commands I ran. Hope to get a solution from your end :


The error says :

clrQuota: Cannot clear namespace quota on root.

Super Guru

@Abhinav Phutela

I checked further and it looks like because it has caused FSImage corruption, community has disabled it intentionally.

Please check below code change as a part of patch on

diff --git src/java/org/apache/hadoop/hdfs/server/namenode/ src/java/org/apache/hadoop/hdfs/server/namenode/
index 24510a4..2c632dd 100644
--- src/java/org/apache/hadoop/hdfs/server/namenode/
+++ src/java/org/apache/hadoop/hdfs/server/namenode/
@@ -1684,6 +1684,8 @@ class FSDirectory implements Closeable {
         throw new FileNotFoundException("Directory does not exist: " + srcs);
       } else if (!targetNode.isDirectory()) {
         throw new FileNotFoundException("Cannot set quota on a file: " + srcs);  
+      } else if (targetNode.isRoot() && nsQuota == FSConstants.QUOTA_RESET) {
+        throw new IllegalArgumentException("Cannot clear namespace quota on root.");
       } else { // a directory inode
         INodeDirectory dirNode = (INodeDirectory)targetNode;
         long oldNsQuota = dirNode.getNsQuota();

This one is still open to support clearing quota for /

Hope this helps.

Super Guru

@Abhinav Phutela

It's intentionally kept like that until we have a fix for HDFS-7133. We cannot do anything for now.

Sure Sir. Thanks

@Kuldeep Kulkarni

The issue is that I'm in administration so can you tell me who exactly can I apply this patch? or where exactly can I find this .java file which I need to edit?