<div dir="ltr"><div><div><div>Hi,<br></div>That is exactly what I was looking for. Thanks a lot.<br><br></div>Regards,<br></div>Asen Asenov<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 1, 2015 at 2:51 PM, Sachin Pandit <span dir="ltr">&lt;<a href="mailto:spandit@redhat.com" target="_blank">spandit@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
----- Original Message -----<br>
&gt; From: &quot;M S Vishwanath Bhat&quot; &lt;<a href="mailto:msvbhat@gmail.com">msvbhat@gmail.com</a>&gt;<br>
&gt; To: &quot;aasenov1989&quot; &lt;<a href="mailto:aasenov1989@gmail.com">aasenov1989@gmail.com</a>&gt;<br>
&gt; Cc: &quot;<a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a> List&quot; &lt;<a href="mailto:gluster-users@gluster.org">gluster-users@gluster.org</a>&gt;<br>
</span><span class="">&gt; Sent: Monday, June 1, 2015 3:02:08 PM<br>
&gt; Subject: Re: [Gluster-users] Features - Object Count<br>
&gt;<br>
&gt;<br>
&gt;<br>
</span><span class="">&gt; On 29 May 2015 at 18:11, aasenov1989 &lt; <a href="mailto:aasenov1989@gmail.com">aasenov1989@gmail.com</a> &gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hi,<br>
&gt; So is there a way to find how many files I have on each brick of the volume?<br>
&gt; I don&#39;t think gluster provides a way to exactly get the number of files in a<br>
&gt; brick or volume.<br>
&gt;<br>
&gt; Sorry if my solution is very obvious. But I generally use find to get the<br>
&gt; number of files in a particular brick.<br>
&gt;<br>
&gt; find /brick/path ! -path &quot;/brick/path/.glusterfs*&quot; | wc -l<br>
<br>
</span>Hi,<br>
<br>
You can also do getfattr -d -m . -e hex &lt;brick_path&gt;<br>
This command is to get the extended attributes of a directory.<br>
When you issue this command after enabling quota then<br>
you can see an extended attribute with name &quot;trusted.glusterfs.quota.size&quot;<br>
That basically holds the size, file count and directory count.<br>
<br>
The extended attribute consists of 48 hexadecimal numbers. First 16 will give<br>
you the size, next 16 the file count and last 16 the directory count.<br>
<br>
Hope this helps.<br>
<br>
Thanks,<br>
Sachin Pandit.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
&gt;<br>
&gt;<br>
&gt; Best Regards,<br>
&gt; Vishwanath<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Regards,<br>
&gt; Asen Asenov<br>
&gt;<br>
&gt; On Fri, May 29, 2015 at 3:33 PM, Atin Mukherjee &lt; <a href="mailto:atin.mukherjee83@gmail.com">atin.mukherjee83@gmail.com</a><br>
&gt; &gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Sent from Samsung Galaxy S4<br>
&gt; On 29 May 2015 17:59, &quot;aasenov1989&quot; &lt; <a href="mailto:aasenov1989@gmail.com">aasenov1989@gmail.com</a> &gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; Hi,<br>
&gt; &gt; Thnaks for the help. I was able to retrieve number of objects for entire<br>
&gt; &gt; volume. But I didn&#39;t figure out how to set quota for particular brick. I<br>
&gt; &gt; have replicated volume with 2 bricks on 2 nodes:<br>
&gt; &gt; Bricks:<br>
&gt; &gt; Brick1: host1:/dataDir<br>
&gt; &gt; Brick2: host2:/dataDir<br>
&gt; &gt; Both bricks are up and files are replicated. But when I try to set quota on<br>
&gt; &gt; a particular brick:<br>
&gt; IIUC, You won&#39;t be able to set quota at brick level as multiple bricks<br>
&gt; comprise a volume which is exposed to the user. Quota team can correct me if<br>
&gt; I am wrong.<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; gluster volume quota TestVolume limit-objects /dataDir/ 9223372036854775807<br>
&gt; &gt; quota command failed : Failed to get trusted.gfid attribute on path<br>
&gt; &gt; /dataDir/. Reason : No such file or directory<br>
&gt; &gt; please enter the path relative to the volume<br>
&gt; &gt;<br>
&gt; &gt; What should be the path to brick directories relative to the volume?<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt; Asen Asenov<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Fri, May 29, 2015 at 12:35 PM, Sachin Pandit &lt; <a href="mailto:spandit@redhat.com">spandit@redhat.com</a> &gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; ----- Original Message -----<br>
&gt; &gt;&gt; &gt; From: &quot;aasenov1989&quot; &lt; <a href="mailto:aasenov1989@gmail.com">aasenov1989@gmail.com</a> &gt;<br>
&gt; &gt;&gt; &gt; To: &quot;Humble Devassy Chirammal&quot; &lt; <a href="mailto:humble.devassy@gmail.com">humble.devassy@gmail.com</a> &gt;<br>
&gt; &gt;&gt; &gt; Cc: &quot; <a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a> List&quot; &lt; <a href="mailto:gluster-users@gluster.org">gluster-users@gluster.org</a> &gt;<br>
&gt; &gt;&gt; &gt; Sent: Friday, May 29, 2015 12:22:43 AM<br>
&gt; &gt;&gt; &gt; Subject: Re: [Gluster-users] Features - Object Count<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Thanks Humble,<br>
&gt; &gt;&gt; &gt; But as far as I understand the object count is connected with the quotas<br>
&gt; &gt;&gt; &gt; set<br>
&gt; &gt;&gt; &gt; per folders. What I want is to get number of files I have in entire<br>
&gt; &gt;&gt; &gt; volume -<br>
&gt; &gt;&gt; &gt; even when volume is distributed across multiple computers. I think the<br>
&gt; &gt;&gt; &gt; purpose of this feature:<br>
&gt; &gt;&gt; &gt; <a href="http://gluster.readthedocs.org/en/latest/Feature%20Planning/GlusterFS%203.7/Object%20Count/" target="_blank">http://gluster.readthedocs.org/en/latest/Feature%20Planning/GlusterFS%203.7/Object%20Count/</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Hi,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; You are absolutely correct. You can retrieve number of files in the entire<br>
&gt; &gt;&gt; volume if you have the &quot;limit-objects&quot; set on the root. If &quot;limit-objects&quot;<br>
&gt; &gt;&gt; is set on the directory present in a mount point then it will only show<br>
&gt; &gt;&gt; the number of files and directories of that particular directory.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; In your case, if you want to retrieve number of files and directories<br>
&gt; &gt;&gt; present in the entire volume then you might have to set the object limit<br>
&gt; &gt;&gt; on the root.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Thanks,<br>
&gt; &gt;&gt; Sachin Pandit.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &gt; is to provide such functionality. Am I right or there is no way to<br>
&gt; &gt;&gt; &gt; retrieve<br>
&gt; &gt;&gt; &gt; number of files for entire volume?<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Regards,<br>
&gt; &gt;&gt; &gt; Asen Asenov<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; On Thu, May 28, 2015 at 8:09 PM, Humble Devassy Chirammal &lt;<br>
&gt; &gt;&gt; &gt; <a href="mailto:humble.devassy@gmail.com">humble.devassy@gmail.com</a> &gt; wrote:<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Hi Asen,<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; <a href="https://gluster.readthedocs.org/en/latest/Features/quota-object-count/" target="_blank">https://gluster.readthedocs.org/en/latest/Features/quota-object-count/</a> ,<br>
&gt; &gt;&gt; &gt; hope<br>
&gt; &gt;&gt; &gt; this helps.<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; --Humble<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; On Thu, May 28, 2015 at 8:38 PM, aasenov1989 &lt; <a href="mailto:aasenov1989@gmail.com">aasenov1989@gmail.com</a> &gt;<br>
&gt; &gt;&gt; &gt; wrote:<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Hi,<br>
&gt; &gt;&gt; &gt; I wanted to ask how to use this feature in gluster 3.7.0, as I was<br>
&gt; &gt;&gt; &gt; unable to<br>
&gt; &gt;&gt; &gt; find anything. How can I retrieve number of objects in volume and number<br>
&gt; &gt;&gt; &gt; of<br>
&gt; &gt;&gt; &gt; objects in particular brick?<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Thanks in advance.<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Regards,<br>
&gt; &gt;&gt; &gt; Asen Asenov<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt; &gt;&gt; &gt; Gluster-users mailing list<br>
&gt; &gt;&gt; &gt; <a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
&gt; &gt;&gt; &gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-users</a><br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt; &gt;&gt; &gt; Gluster-users mailing list<br>
&gt; &gt;&gt; &gt; <a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
&gt; &gt;&gt; &gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-users</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Gluster-users mailing list<br>
&gt; &gt; <a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
&gt; &gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Gluster-users mailing list<br>
&gt; <a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
&gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-users</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Gluster-users mailing list<br>
&gt; <a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
&gt; <a href="http://www.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-users</a><br>
</div></div></blockquote></div><br></div>