Hard Disk and DMA Problems

The Problem:

If you see the following when you boot:

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

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 <Shift><PageUp> to scroll the display backwards and check the boot messages.

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.

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'!

Fixing the Problem:

You can ameliorate the situation by passing “ide0=noautotune” 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.

Most distributions begin installation by giving you a “boot:” prompt. You can pick an alternate kernel and pass parameters to the selected kernel to use when it boots. Simply pass the string, “ide0=noautotune” 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, “Use another distribution?”.

As the system boots, you may then see a message similar to the following:

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

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!

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 Boot Preferences Holy War 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 “ide0=noautotune” parameter when it boots. If you screw up—say, by using LILO—and the system doesn't boot, you still have options: remember GRUB? I have reasons for using it.

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:

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

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—or your LILO boot went South—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.

Good luck!

Last updated: