Thank you both for informative replies, much appreciated.<br><br>I ended up doing the tedious job of shuffling data around to get a more reasonable distance to ENOSPC, as there was no way I could free up the needed contiguous free space with my dataset. <div>
<br></div><div><br></div><div>Thanks,</div><div><br></div><div>André<br><br><div class="gmail_quote">On 20 June 2012 08:07, Dave Chinner <span dir="ltr">&lt;<a href="mailto:david@fromorbit.com" target="_blank">david@fromorbit.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 class="HOEnZb"><div class="h5">On Tue, Jun 19, 2012 at 07:36:24AM -0500, Geoffrey Wehrman wrote:<br>
&gt; On Tue, Jun 19, 2012 at 02:05:34PM +0200, André Øien Langvand wrote:<br>
&gt; | Hi,<br>
&gt; |<br>
&gt; | I know there are quite a few posts regarding similar issues around, but I<br>
&gt; | can&#39;t seem to find a solution or at least an answer to why this is<br>
&gt; | happening in my case, so I thought I&#39;d try the mailing list and I hope<br>
&gt; | that&#39;s okay.<br>
&gt; |<br>
&gt; | We have 2 file servers with identical hardware and identical configuration<br>
&gt; | (Dell R610&#39;s, H800 controllers, MD1200 DAS, RAID-5) set up with rsync to<br>
&gt; | mirror the contents. The content is music in several formats (from PCM WAV<br>
&gt; | to 64kbit AAC previews), which means file sizes of about 1 - 40mb. Both<br>
&gt; | systems running SLES 11 SP1. Same kernel (2.6.32.59-0.3-default), same<br>
&gt; | xfsprogs version (xfsprogs-3.1.1-0.1.36).<br>
&gt; |<br>
&gt; | My example partition on the source now has 9.9G (of 9.1T) available space<br>
&gt; | and still doesn&#39;t report the drive as full. On the destination, however, it<br>
&gt; | wont allow me to use any of the remaining 51G. This is obviously a problem<br>
&gt; | when trying to do mirroring.<br>
&gt; |<br>
&gt; | Both file systems have been mounted with inode64 option since first mount,<br>
&gt; | there are plenty of inodes available and I&#39;ve also verified that there are<br>
&gt; | noe sparse files (find -type f -printf &quot;%S\t%p\n&quot; 2&gt;/dev/null | gawk &#39;{if<br>
&gt; | ($1 &lt; 1.0) print $1 $2}&#39;), just in case.<br>
&gt; |<br>
&gt; | I have tried repairing (xfs_repair), defragmenting (xfs_fsr) and alter<br>
&gt; | imaxpct without any luck. Rsync is run like this: # ionice -c3 rsync -rv<br>
&gt; | --size-only --progress --delete-before --inplace.<br>
&gt; |<br>
&gt; |<br>
&gt; | More detailed information on source file system:<br>
&gt; |<br>
&gt; | # df -k | grep sdg1<br>
&gt; | /dev/sdg1            9762777052 9752457156  10319896 100% /content/raid31<br>
&gt; |<br>
&gt; | # df -i | grep sdg1<br>
&gt; | /dev/sdg1            7471884 2311914 5159970   31% /content/raid31<br>
&gt; |<br>
&gt; | # xfs_info /dev/sdg1<br>
&gt; | meta-data=/dev/sdg1              isize=2048   agcount=10, agsize=268435424<br>
&gt; | blks<br>
&gt; |          =                       sectsz=512   attr=2<br>
&gt; | data     =                       bsize=4096   blocks=2441215991, imaxpct=5<br>
&gt; |          =                       sunit=16     swidth=80 blks<br>
&gt; | naming   =version 2              bsize=4096   ascii-ci=0<br>
&gt; | log      =internal               bsize=4096   blocks=521728, version=2<br>
&gt; |          =                       sectsz=512   sunit=16 blks, lazy-count=1<br>
&gt; | realtime =none                   extsz=4096   blocks=0, rtextents=0<br>
&gt; |<br>
&gt; | # xfs_db -r &quot;-c freesp -s&quot; /dev/sdg1<br>
&gt; |    from      to extents  blocks    pct<br>
&gt; |       1       1   69981   69981   2.99<br>
&gt; |       2       3  246574  559149  23.86<br>
&gt; |       4       7  315038 1707929  72.88<br>
&gt; |       8      15     <a href="tel:561%20%20%20%206374%20%20%200.27" value="+15616374027">561    6374   0.27</a><br>
&gt; | total free extents 632154<br>
&gt; | total free blocks 2343433<br>
&gt; | average free extent size 3.70706<br>
&gt; |<br>
&gt; |<br>
&gt; |<br>
&gt; | More detailed information on destination file system:<br>
&gt; |<br>
&gt; | # df -k | grep sdj1<br>
&gt; | /dev/sdj1            9762777052 9710148076  52628976 100% /content/sg08/vd08<br>
&gt; |<br>
&gt; | # df -i | grep sdj1<br>
&gt; | /dev/sdj1            28622264 2307776 26314488    9% /content/sg08/vd08<br>
&gt; |<br>
&gt; | # xfs_info /dev/sdj1<br>
&gt; | meta-data=/dev/sdj1              isize=2048   agcount=10, agsize=268435424<br>
&gt; | blks<br>
&gt; |          =                       sectsz=512   attr=2<br>
&gt; | data     =                       bsize=4096   blocks=2441215991, imaxpct=5<br>
&gt; |          =                       sunit=16     swidth=80 blks<br>
&gt; | naming   =version 2              bsize=4096   ascii-ci=0<br>
&gt; | log      =internal               bsize=4096   blocks=521728, version=2<br>
&gt; |          =                       sectsz=512   sunit=16 blks, lazy-count=1<br>
&gt; | realtime =none                   extsz=4096   blocks=0, rtextents=0<br>
&gt; |<br>
&gt; | # xfs_db -r &quot;-c freesp -s&quot; /dev/sdj1<br>
&gt; |    from      to extents  blocks    pct<br>
&gt; |       1       1   81761   81761   0.62<br>
&gt; |       2       3  530258 1147719   8.73<br>
&gt; |       4       7  675864 3551039  27.01<br>
&gt; |       8      15  743089 8363043  63.62<br>
&gt; |      16      31     102    1972   0.02<br>
&gt; | total free extents 2031074<br>
&gt; | total free blocks 13145534<br>
&gt; | average free extent size 6.47221<br>
&gt; |<br>
&gt; |<br>
&gt; | I would be grateful if anyone could shed some light on why this is<br>
&gt; | happening or maybe even provide a solution.<br>
&gt;<br>
&gt; You are using 2 KiB inodes, so an inode cluster (64 inodes) requires<br>
&gt; 128 KiB of contiguous space on disk.  The freesp output above shows that<br>
&gt; the largest possible contiguous free space chunk available is 31 * 4 KiB<br>
&gt; or 4 KiB short of 128 KiB.  You don&#39;t have enough contiguous space to<br>
&gt; create a new inode cluster, and your existing inodes are likely all<br>
&gt; used.  This can be verified using xfs_db:<br>
&gt;       xfs_db -r -c &quot;sb&quot; -c &quot;p ifree&quot; /dev/sdj1<br>
&gt;<br>
&gt; xfs_fsr does not defragment free space, it only makes the problem worse.<br>
&gt; A possible solution:<br>
&gt;   1.  mount the filesystem with the ikeep mount option<br>
&gt;   2.  delete a few large files to free up some contiguous space<br>
<br>
</div></div>large -contiguous- files. It&#39;s likely any files written recently<br>
will be as fragmented as the free space....<br>
<div class="im"><br>
&gt;   3.  create a few thousand files to &quot;preallocate&quot; inodes<br>
&gt;   4.  delete the newly created files<br>
<br>
</div>That will work for a while, but it&#39;s really just a temporary<br>
workaround until those &quot;preallocated&quot; inodes are exhausted. Normally<br>
to recover from this situation you need to free 15-20% of the disk<br>
space to allow sufficiently large contiguous free space extents to<br>
reform naturally and allow the allocator to work at full efficiency<br>
again....<br>
<div class="im"><br>
&gt; The ikeep mount option will prevent the space for inodes from being<br>
&gt; reused for other purposes.<br>
<br>
</div>The problem with using ikeep is that the remaining empty inode<br>
chunks prevent free space from defragmenting itself fully as you<br>
remove files from the filesystem.<br>
<br>
Realistically, I think the problem is that you are running your<br>
filesystems at near ENOSPC for extended periods of time. That is<br>
guaranteed to fragment free space and any files that are written<br>
when the filesytem is in this condition. As Geoffrey has said -<br>
xfs_fsr will not fix your problems - only changing the way you use<br>
your storage will prevent the problem from occurring again.<br>
<br>
Cheers,<br>
<br>
Dave.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Dave Chinner<br>
<a href="mailto:david@fromorbit.com">david@fromorbit.com</a><br>
</font></span></blockquote></div><br></div>