<div dir="ltr"><div> You will get weird results like these if you put two bricks on a single filesystem.  In use case one (presumably replica 2) the data gets written to both bricks, which means there are two copies on the disk and so twice the disk space consumed.  In the second case there is some overhead involved in creating a volume that will consume some disk space even absent any user data added, how much will depend on the factors like the block size you used to create the filesystem. <br></div><div><br></div><div>Best practice is that each brick should be on it&#39;s own block device with it&#39;s own filesystem and not shared with other bricks or applications.  If you must share physical devices then use lvm (or partitions - but lvm is more flexible) to create separate volumes each with it&#39;s own filesystem for each brick.</div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 April 2018 at 23:32, <a href="mailto:hannannan@shudun.com">hannannan@shudun.com</a> <span dir="ltr">&lt;<a href="mailto:hannannan@shudun.com" target="_blank">hannannan@shudun.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div><span></span></div><div><span><div style="MARGIN:10px;FONT-FAMILY:verdana;FONT-SIZE:10pt"><div><span style="font-family:Arial;font-size:14px;line-height:1.7;background-color:transparent">I create a volume,and mounted it, and use df command to view the volume Available and used .</span></div></div></span></div><blockquote style="margin-Top:0px;margin-Bottom:0px;margin-Left:0.5em"><div class="m_5762692219248366732FoxDiv20180412112546717671"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div id="m_5762692219248366732isForwardContent"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>After some testing, I think the used information displayed by df is the sum of the capacities of the disks on which the brick is located.</div><div>Not the sum of the used of the brick directory.</div><div>(I know the Available capacity, is the physical space of all disks if not quota, </div><div>but used of space should not be sum of the space used by the hard disk,  should be the sum of the size of the brick directory</div><div>beacuse, There may be different volumes of bricks on one disk)</div><div><br></div><div>In my case:</div><div>I want to create multiple volumes on some disks(For better performance, each volume will use all disks of our server cluster),one volume for NFS and replica 2,one volume for NFS and replica 3, one volume for SAMBA。</div><div>I want get the capacity  already used of each volume, but now one of the volumes write data, the other volumes used will also increase when viewed using df command.</div><div><br></div><div>Example:</div><div>eg1:</div><div>I create a volume with two bricks and the two bricks are on one disk. And write 1TB of data for the volume</div><div>using the df command, View the space used by the volume.</div><div>Display volume uses 2TB of space</div><div><br></div><div>eg2:</div><div>such as :When I create a volume on the root partition,I didn&#39;t write any data to the volume,But using df shows that this volume has used some space。</div><div>In fact, these spaces are not the size of the brick directory, but the size of the disk on which the brick is located.</div><div><br></div><div><div>How do I get the capacity of each volume in this case?</div></div><div><br></div><div><div>[<a href="mailto:root@f08n29glusterfs-3.7.20" style="color:rgb(19,129,68)" target="_blank">root@f08n29glusterfs-3.7.20</a>]# df -hT | grep f08n29</div><div><b>f08n29:/usage_test fuse.glusterfs   50G   24G   27G  48% /mnt</b></div><div><br></div><div>[<a href="mailto:root@f08n29glusterfs-3.7.20" style="color:rgb(19,129,68)" target="_blank">root@f08n29glusterfs-3.7.20</a>]# gluster volume info usage_test</div><div>Volume Name: usage_test</div><div>Type: Distribute</div><div>Volume ID: d9b5abff-9f69-41ce-80b3-<wbr>3dc4ba1d77b3</div><div>Status: Started</div><div>Number of Bricks: 1</div><div>Transport-type: tcp</div><div>Bricks:</div><div><b>Brick1: f08n29:/brick1</b></div><div>Options Reconfigured:</div><div>performance.readdir-ahead: on</div><div><br></div><div>[<a href="mailto:root@f08n29glusterfs-3.7.20" style="color:rgb(19,129,68)" target="_blank">root@f08n29glusterfs-3.7.20</a>]# du -sh /brick1</div><div><b>100K/brick1</b></div><div><b><br></b></div><div>Is there any command that can check the actual space used by each volume in this situation?</div></div><div><br></div></div><br><br><span title="neteasefooter"><p> </p></span></div></div><br><br><span title="neteasefooter"><p> </p></span></div></blockquote>
</div><br>______________________________<wbr>_________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-users" rel="noreferrer" target="_blank">http://lists.gluster.org/<wbr>mailman/listinfo/gluster-users</a><br></blockquote></div><br></div></div>