<!--#include virtual="HTML_begin.inc"-->
  <title>Hard Disk and DMA Problem on Linux</title>
  <meta name="keywords" content="Computer, Linux, FreeBSD"/>
  <meta name="keywords" content="hard disk, dma, ide0, noautotune, grub, lilo"/>
  <meta name="keywords" content="DriveReady SeekComplete Error"/>
  <meta name="keywords" content="DriveStatusError BadCRC"/>
<!--#include virtual="HTML_head_end.inc"-->
<!--#include virtual="Computer_tabs.inc"-->

<div id="content">
<h2>Hard Disk and DMA Problems</h2>

<h3>The Problem:</h3>

<p>If you see the following when you boot:</p>

<pre>
  hda:hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }
  hda: dma_intr: error=0x84 { DriveStatusError BadCRC }
  hda: dma-intr: error=0x51{ DriveReady SeekComplete Error }
  . . .
</pre>

<p>You may then have a kernel panic and the machine may lock up. Sometimes,
when installing a new distribution, you may fail to notice the errors mentioned
above and go completely through the installation and then not be able to boot
the newly installed system!  Check close for the above errors and stop
everything until you fix the problem. Before you login you should be able to do
&lt;Shift&gt;&lt;PageUp&gt; to scroll the display backwards and check the boot
messages.</p>

<p>With regard to this particular problem, the Internet is full of really BAD
information. Searching on the error messages will find people who condemn your
HD as over-the-hill and that the sky is falling. More likely, if you just
started using a 2.4 or higher kernel on an older machine that was formerly
using a 2.2 (or less) kernel, you have awakened a sleeping dragon. The new
kernel wants to use DMA; the drive, for some reason, doesn't.</p>

<p>Now, the drive COULD be bad. But if the drive was working before you tried
to upgrade the kernel, you will likely be able to fix the problem and use the
drive. So, let's get fixin'!</p>


<h3>Fixing the Problem:</h3>

<p>You can ameliorate the situation by passing
&ldquo;<tt>ide0=noautotune</tt>&rdquo; to your kernel at boot time. This will
turn off DMA when the kernel boots thus not making that specific demand on,
what may be, your HD.</p>

<p>Most distributions begin installation by giving you a
&ldquo;<tt>boot:</tt>&rdquo; prompt. You can pick an alternate kernel and pass
parameters to the selected kernel to use when it boots. Simply pass the string,
&ldquo;<tt>ide0=noautotune</tt>&rdquo; to the kernel by typing it at the boot
prompt. If your distribution doesn't give you the opportunity to pass
parameters to the kernel at boot time, I don't know what to say except maybe,
&ldquo;Use another distribution?&rdquo;.</p>

<p>As the system boots, you may then see a message similar to the
following:</p>

<pre>
  ******************************************************
  * Warning: The dma on your hard drive is turned off. *
  * This may really slow down the fsck process.        *
  ******************************************************
</pre>

<p>Don't worry. DMA has been turned off, but the disk will probably be usable
since it booted and got far enough along to give you the warning message!</p>

<p>After the new system is installed, your biggest problem will be to make sure
that when it boots for the first time the boot parameter is passed to the
kernel. Here is where <b>Boot Preferences Holy War</b> makes its first
appearance. I prefer using GRUB to boot my machines; so, I'll describe how to
boot the system using GRUB. Your milage may vary so try what you want. All you
really have to do is get the new kernel to use the
&ldquo;<tt>ide0=noautotune</tt>&rdquo; parameter when it boots. If you screw
up&mdash;say, by using LILO&mdash;and the system doesn't boot, you still have
options: remember GRUB? I have reasons for using it.</p>

<p>While you're installing the system you may be given an opportunity to choose
GRUB or LILO. Choose GRUB and edit the boot stanza to include your new boot
parameter:</p>

<pre>
  # Slackware 10.0 Linux (typical boot stanza for GRUB)
  title  Linux
  root (hd0,0)
  kernel /boot/vmlinuz root=/dev/hda1 <b>ide0=noautotune</b> ro
</pre>

<p>Make sure GRUB is installed properly: I prefer the MBR but a floppy will
do. GRUB can boot most OS's, including Windows, FreeBSD, Plan 9, Hurd,
etc.. If, at first, this doesn't work&mdash;or your LILO boot went
South&mdash;you can use a GRUB floppy or a rescue disk to fix the boot
information on the HD. Grub can boot the system by passing the correct
parameters. A good boot floppy can do the same. Once booted you can fix the
problem and try again.</p>

<p>Good luck!</p>

</div>

<p class="lastupdate">Last updated: <!--#echo var="LAST_MODIFIED" --></p>
<!--#include virtual="HTML_end.inc"-->
