Red Antigua Logo slogan
Ads by Goooooogle
Search this site (by Google)
Menu
Home
About
Tools
Perl modules
Perl tutorials
C tutorials
Server configurations
UNIX on Windows
Misc. FreeBSD/UNIX
Redirect a web page
JavaScript
Virus list
Old stuff
Off topic

Tools    (top)
Your IP
Check a site for broken links
(W3C)

Perl modules    (top)
Tree::Numbered::Tools
(CPAN)
Perl tutorials    (top)
Perl modules
HTML::Template
CGI::Application
Mail::POP3Client
Mail::Send
MIME::Tools
Cookies with CGI::Application
Upload files with CGI::Application
Download files with CGI::Application
Redirect with CGI::Application
CPAN shell
Install DBD::mysql from the CPAN shell
Perl trim function
Validate an IP with Perl
Run suid Perl scripts under Apache
Perl taint mode
Perl date functions with Date::Calc

In Spanish
Curso de Perl

C tutorials    (top)
C - Introduction
C - Absolute beginner's Emacs
C - Examples for beginners
C - Makefile examples
C - Autotools examples
Server configurations    (top)
DNS
Apache
Apache Authentication and Access Control
mod_perl on FreeBSD
MySQL
MySQL add account
phpMyAdmin
Squid
DHCP

UNIX on Windows    (top)
Apache setup on Windows
MySQL setup on Windows
PHP setup on Windows
Perl setup on Windows
Emacs setup on Windows
UnxUtils
PuTTY
WinSCP
GIMP on Windows
MinGW - gcc on Windows
MSYS - make-in-a-shell on Windows
msysDTK - autotools on Windows
GDB for MinGW on Windows

Misc. FreeBSD/UNIX    (top)
CD and DVD creation on FreeBSD using 'k3b' on FreeBSD
'ipf' on FreeBSD
'pf' on FreeBSD
'su' on FreeBSD
Mount an ISO image under FreeBSD
Load the correct sound driver under FreeBSD without knowing what sound card you are using
Simultaneous sound channels on FreeBSD
Boot floppies for FreeBSD
Problems with old disks/controllers and the 'ata' driver
FreeBSD network stuff
DOS-to-UNIX file conversion
favicon.ico on UNIX
Emacs tips
Sendmail tips
GKrellm
Command Line Calculator
Save multimedia streams with 'mplayer'
xargs - solution to 'Argument list too long'
Process multiple images from the command line using 'ImageMagick'
Turn the system bell off under X Windows
Process each line in an input file from the command line (or in a shell script)
How to keep a program running in the background using 'nohup'
How to remove symbolic links in the current directory using 'find' and 'rm'
How to remove Emacs backup files in the current directory and all subdirectories using 'find' and 'rm'
How to execute .profile without logging in
Configure X to handle non-English characters
How to move /var to /usr/var

Redirect a web page    (top)
Redirect to another web page
Apache redirect
C redirect
Perl redirect
PHP redirect
HTML redirect
JavaScript redirect

Javascript    (top)
Trim function
Login form
Register form
Popup window

Virus list    (top)
Latest viruses - Computer Virus HQ (external)
Latest 10 viruses - Sophos

Links    (top)
HTML and PHP Scripts - Html Web Template

Old stuff    (top)
POP3 server setup
About AnyMail
AnyMail downloads

Off topic    (top)
Personal links

Validated by
Valid HTML 4.01!
Valid CSS!
Powered by
apache.org
Problems with old disks/controllers and the 'ata' driver
Problems with old disks/controllers and the 'ata' driver        
According to the FreeBSD mailing lists, this is a common problem.
Every combination of hardware is different, this was my solution, yours may differ.
In my case, I had a dual-boot IDE disk, Win98 and FreeBSD 3.1.
FreeBSD 3.1 was using the 'wd' driver, no problem.
I upgraded to FreeBSD 4.2, using the 'ata' driver, still no problem.
When I had a motherboard failure and changed to a new one, the same old disk and the new disk controller continued working for Win98, but FreeBSD couldn't manage the new situation but screwed up the whole disk (the first and only time I have been disappointed with FreeBSD).
I tried to installed FreeBSD 4.2 from scratch various times, but the disk made timeouts and then reboot before finishing the installation.
Finally I returned to FreeBSD 3.1.
Recently, I read about improvements in the 'ata' driver, and tried to upgrade to FreeBSD 4.7.
Now the installation finished, but a minimal install took about an hour and a half.
On the debug screen (tty2) the screen filled up with:
ad0: WRITE command timeout tag=0 serv=0 - resetting
ata0: resetting devices ..ad0:DMA limited to UDMA33, non-ATA66 cable or device
I could log in to the system, but every now and then I had this annoying message, and the system freezing for at least 10 seconds.
I checked
# man ata
and looked for DMA-related issues, there was sysctl hw.ata.ata_dma. Anyhow, sysctl hw.ata.ata_dma returned 1 (DMA enabled), while my error message told me not to use DMA.
Trying
# sysctl hw.ata.ata_dma="0"
sysctl: oid 'hw.ata.ata_dma' is read only
The man page referred to 'atacontrol', so the next step was:
# man atacontrol
The first attempt was
# atacontrol list
which only confirmed that the HDD (primary master) was set to DMA, while the CDROM (primary slave) was set to PIO4.
The first success was
# atacontrol mode 0 PIO4 PIO4
which set both the HDD and the CDROM to PIO4 mode. No more timeouts!
I installed distributions, ports, etc.
Then I had a system failure, leaving the file systems dirty.
The system rebooted, setting hw.ata.ata_dma to 1 (DMA enabled) by default.
When 'fsck' tried to fix the dirty file system, the HDD timeout "confused" 'fsck' (my theory).
I got the following error messages:
PARTIALLY ALLOCATED INODE I=7595634
UNEXPECTED SOFT UPDATE INCONSISTENCY

CLEAR? [yn] y

PARTIALLY ALLOCATED INODE I=7595638
UNEXPECTED SOFT UPDATE INCONSISTENCY

CLEAR? [yn] y
and so on.
I could not clean the system, but had to reinstall FreeBSD again (sigh!).
In man ata I read "The following tunables are setable from the loader:":
hw.ata.ata_dma
set to 1 for DMA access 0 for PIO (default is DMA)
This lead me to
# man loader
which told me to put
hw.ata.ata_dma="0"
in
/boot/loader.conf
Voila! I am up and running, my HDD boots forced to use PIO4 mode, no more disk crasches.
(In BIOS, I disabled DMA, and explicitly set Primary Master to PIO4 mode, but the 'ata' driver ignored that.)
Analizing this problem could lead to one of the following reasons:
  • A bad hard disk.
  • A bad hard disk controller.
  • Conflicting modes on the same IDE bus
    (a master HDD in DMA mode and a slave CDROM in PIO4 mode).
  • An old 40-wire cable instead of a new 80-wire.
Changing one or more of the above maybe would allow me to use DMA instead of PIO.
Anyway, this solution was a successful workaround.
Last modified: Wed Apr 28 21:45:57 CST 2004