<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="full-disk">
      </a>
      B.3.3.4 How MySQL Handles a Full Disk
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045053851280">
  </a>
  <a class="indexterm" name="idm46045053850240">
  </a>
  <p>
   This section describes how MySQL responds to disk-full errors
          (such as
   <span class="quote">
    “
    <span class="quote">
     no space left on device
    </span>
    ”
   </span>
   ), and to
          quota-exceeded errors (such as
   <span class="quote">
    “
    <span class="quote">
     write failed
    </span>
    ”
   </span>
   or
   <span class="quote">
    “
    <span class="quote">
     user block limit reached
    </span>
    ”
   </span>
   ).
  </p>
  <p>
   This section is relevant for writes to
   <code class="literal">
    MyISAM
   </code>
   tables. It also applies for writes
          to binary log files and binary log index file, except that
          references to
   <span class="quote">
    “
    <span class="quote">
     row
    </span>
    ”
   </span>
   and
   <span class="quote">
    “
    <span class="quote">
     record
    </span>
    ”
   </span>
   should be understood to mean
   <span class="quote">
    “
    <span class="quote">
     event.
    </span>
    ”
   </span>
  </p>
  <p>
   When a disk-full condition occurs, MySQL does the following:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      It checks once every minute to see whether there is enough
              space to write the current row. If there is enough space,
              it continues as if nothing had happened.
     </p>
    </li>
    <li class="listitem">
     <p>
      Every 10 minutes it writes an entry to the log file,
              warning about the disk-full condition.
     </p>
    </li>
   </ul>
  </div>
  <p>
   To alleviate the problem, take the following actions:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      To continue, you only have to free enough disk space to
              insert all records.
     </p>
    </li>
    <li class="listitem">
     <p>
      Alternatively, to abort the thread, use
      <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
       <span class="command">
        <strong>
         mysqladmin kill
        </strong>
       </span>
      </a>
      . The thread is aborted
              the next time it checks the disk (in one minute).
     </p>
    </li>
    <li class="listitem">
     <p>
      Other threads might be waiting for the table that caused
              the disk-full condition. If you have several
      <span class="quote">
       “
       <span class="quote">
        locked
       </span>
       ”
      </span>
      threads, killing the one thread that
              is waiting on the disk-full condition enables the other
              threads to continue.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Exceptions to the preceding behavior are when you use
   <a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
    <code class="literal">
     REPAIR TABLE
    </code>
   </a>
   or
   <a class="link" href="optimize-table.html" title="15.7.3.4 OPTIMIZE TABLE Statement">
    <code class="literal">
     OPTIMIZE TABLE
    </code>
   </a>
   or when the
          indexes are created in a batch after
   <a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
    <code class="literal">
     LOAD
          DATA
    </code>
   </a>
   or after an
   <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
    <code class="literal">
     ALTER
          TABLE
    </code>
   </a>
   statement. All of these statements may create
          large temporary files that, if left to themselves, would cause
          big problems for the rest of the system. If the disk becomes
          full while MySQL is doing any of these operations, it removes
          the big temporary files and mark the table as crashed. The
          exception is that for
   <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
    <code class="literal">
     ALTER
          TABLE
    </code>
   </a>
   , the old table is left unchanged.
  </p>
 </div>
 <br/>
</div>
