Wednesday, March 19, 2008

sata compatibility mode

I started having big problems today while making a copy of a 7 GB directory structure on a software (Linux md) raid-1 mirror in one of my Linux boxes. It would slow to a crawl/halt and basically do nothing. Didn't seem like that complex of a task to me, but what do I know?

At first I blamed it on ReiserFS since it seemed to be the likely candidate and pulled another set of blank hard drives to move the partition over to a new set running ext3. However, when I ran mkfs.ext3 to format the new mirror, it got about 2/3 done and slowed to a halt again!

Then it occurred to me that for whatever reason the disks showed up as "hda", "hdb", when booting off the Gentoo install CD, akin to the old days of IDE disks. It turned out that the BIOS was stuck in "SATA Compatibility mode" and probably had been ever since I first turned the machine on. I switched it to "Enhanced" mode (i.e. Native SATA) and from then on things started behaving correctly. I'm not sure why board manufacturers (esp. SuperMicro!) would ship a board these days with this setting on by default. I imagine it has something to do with poor Windows support or the like.

If you're running any remotely modern version of the Linux kernel, make sure to turn off SATA compat and keep it that way. Unless someone is aware of something I'm not, it does way more harm than good.

No comments: